Hot answers tagged editors
To change the default editor at the system level: sudo update-alternatives --config editor and then follow the onscreen prompts.
vim can easily do that: ctrl+ws - Split windows ctrl+ww - switch between windows ctrl+wq - Quit a window ctrl+wv - Split windows vertically :sp filename will open filename in new buffer and split a window.
There are many color schemes which are usually distributed together with vim. You can select them with the :color command. You can see the available color schemes in vim's colors folder, for example in my case: $ ls /usr/share/vim/vimNN/colors/ # where vimNN is vim version, e.g. vim74 blue.vim darkblue.vim default.vim delek.vim desert.vim elflord.vim ...
You can do that via scp like this: vim scp://user@myserver[:port]//path/to/file.txt Notice the two slashes // between server and path, which is needed to correctly resolve the absolute path. [:port]is optional. This is handled by vim's netrw.vim standard plugin. Several other protocols are supported.
You could do this by mounting the remote folder as a file-system using sshfs. To do this, first some pre-requisites: sudo apt-get install sshfs #for Debian based OS, use yum or zypper depending on your OS sudo adduser <username> fuse Now, do the mounting process: mkdir ~/remoteserv sshfs -o idmap=user ...
See edit-command-line in zshcontrib. bindkey -M vicmd v edit-command-line
vim is a modal editor. Hit the ESC key to get into Normal (command) mode then type :q and press Enter. To quit without saving any changes, type :q! and press Enter. See also Getting out in Vim documentation.
As you are using a dark background in your terminal, you simply need to set :set background=dark instead of the default :set background=light The colors are then automatically correctly set. If you want to have this permanently, add the line set background=dark to your $HOME/.vimrc file.
A normal, "modeless" editor is like Notepad on Windows: there is only one mode, where you input text. Vi, and it's successor Vim, are modal: there are two primary modes1, insert mode where you type text into the editor and it is committed to the document, and normal mode where you enter arguments via the keyboard that perform a variety of functions, ...
Cut 2 kilobytes from end of file: truncate -s-2K file
You can do :100,200w filename Of course 100,200 is the range of lines you want to write.
This works (in the .vimrc file) for all files: autocmd BufWritePre * :%s/\s\+$//e This works for just ruby(.rb) files: autocmd BufWritePre *.rb :%s/\s\+$//e
I use pdftk mainly. But here are some others to consider: pdfsam (PDF Split and Merge): "pdfsam is an open source tool (GPL license) designed to handle pdf files" PDFJam "A small collection of shell scripts which provide a simple interface to much of the functionality of the excellent pdfpages PDF file package (by Andreas Matthias) for pdfLaTeX." (You can ...
It's easier to learn than Vi, faster to start than Emacs, and more powerful than Pico/Nano (e.g. it has ctags support for programming). But it's unlikely to be installed everywhere, so you should still know the basics of Vi and Emacs.
This can be done using Emacs. It works in GUI and in terminal mode. You can even split multiple times. Here are some basic key combinations: C-x 2 Split the selected window into two windows, one above the other (split-window-below). C-x 3 Split the selected window into two windows, positioned side by side (split-window-right). C-Mouse-2 ...
From the command line, you could try paste -d '\0' file1 file2 > file3 That does exactly what you want. Visual Block mode in vim is also perfectly suited for this task. Are you sure you did it correctly? You should Go to visual block mode Select text and press y for yanking Go to the other file, on the upper left corner of the to be paste data (last ...
Emacs/Vim/Eclipse/... - Personally I am an Emacs user. If you find the control sequences tire your pinky, just Viper-Mode it up. Emacs is so well integrated into unix, making it very easy to control everything all from one place. Vim also does a good job here, but I find Elisp to be a much more powerful extension language than Vim Script. One could talk ...
In case you prefer Emacs keybindings: autoload -z edit-command-line zle -N edit-command-line bindkey "^X^E" edit-command-line
With vim, you can use split or vsplit. The first one will split horizintally and the second one will split vertically. CTRLw then to navigate through split screens. You can also use tab. tabnew filename will open filename in a new tab. You can use tabnext and :tabprevious to navigate between tabs. I personnaly maps the left and right arrows to navigate ...
In Vim you can also just do the global replace on the start of all lines: :%s/^/;/
I've had the most luck with this: :%!xmllint --format % It's strict about your tags, though, so it will error out if your opening and closing tags don't match. It also adds an XML declaration at the top of your file, if you don't have one as well. This page recommends the following, although I can't get it to work: :set filetype=xml :filetype indent on ...
I know two programs for manipulating PDFs under Linux: PDEedit "Pdf Editor is primary created for simple editation and manipulation with objects of documents in PDF format and storing them as new version of document. Editation and manipulation with objets is by graphical and by commandline interface too. For simple use command line is using script language, ...
I love Geany It's a quick GUI editor that can manage small projects if necessary (it can remember list of files and a few other neat things). It supports many syntax highlighting including Shell scripting. It supports plug-ins, and I have used the VC (version control) plug-in once, but the basic features of Geany are enough for most of the work I do with ...
gedit can be a great editor when extended with gedit-plugins
The most general: Move cursor to first line of the group you want to write. Hit m and a sequentiall. That's "set mark named 'a'". Move cursor to last line of the group, hit 'm' and 'b'.' Change over to command mode hit: as a sequence do :'a,'b w filename then hit return. That will work in vi, nvi and vim. Another method, works in more modern vim: Put ...
For editing/creating files from shell: Most linux distros come with nano which is quite friendly. Another alternative would be vi, but that's a little more complicated. For a '.bat' equivalent for sequencing commands: Depending on the shell you are using (most likely bash) you will need to write shell script, traditionally with a .sh extension (or with ...
For vim, you have powerful scripting available. For example, in my .vimrc, I have: " Stolen from http://www.debian-administration.org/articles/571 " Sets +x on stuff starting with the magic shebang. au BufWritePost * if getline(1) =~ "^#!" | silent !chmod a+x <afile> If you want to do it by filename only, instead of looking for the #! line, you ...
Install pandoc, then select any of the markup formats it supports as input. Write your manuscript in that format, then convert to .docx. I'd suggest using: Markdown if you don't need much in the way of formatting. The occasional italicized word, maybe a headline, some bullets. This site uses a variant of Markdown for posts, so you already know it. DocBook ...
Try using hexedit I haven't tried it on HP-UX but it should work. It allows you to move to a location in a file and truncate. I'm pretty sure that it does not read the whole file in but just seeks to the appropriate location for display. Usage is fairly simple once you have launched it the arrow keys allow you to move around. F1 gives help. Ctrl-G moves to ...
Menu Search->Replace (or Ctrl+h). Fill in find and replace boxes, expand Replace All, click In Session Step-by-step: Select "Replace" from Search menu. Expand "Replace All" Click "In Session"
Only top voted, non community-wiki answers of a minimum length are eligible