Tag Info

Hot answers tagged

128

I'll post what I think are the main benefits of each: Emacs has considerably more extensions to let you do tasks that are only vaguely text-editor related, like browsing the filesystem or messing with version control, and extensions that are in no way text-editor related, like reading RSS feeds. If you want an environment instead of just a text editor, ...


42

There is a vi available on every unix system (or almost), however you can't say this about any other editor. This is the #1 reason, imo, to learn and familiarize yourself with vi (please note 'vi' not 'vim'). I've never seen Emacs be available in a default install. I'm not saying don't use Emacs or this is the only reason to use Vim, but when you want to be ...


32

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.


17

There used to be more restrictions, but since GNU Emacs 23, the text mode interface can do most of what the GUI interface can do. Also, since GNU Emacs 23, you can combine X frames and text mode frames in the same Emacs instance. Running in a terminal limits the input key combinations Emacs can recognize, because the terminal emulator often doesn't transmit ...


17

By setting your readline editing to either emacs (the default) or vi (set -o vi) you are essentially standardizing your editing commands, across the shell and your editor of choice1. Thus, if you want to edit a command in the shell you use the same commands2 that you would if you were in your text editor. This means only having to remember one command ...


14

I use both on a regular basis. I view Emacs as a "live in" editor, whereas I use Vim for quick, one-off tasks. Superficially, Emacs is much more bloated than Vim is, and so it really isn't quite so convenient to "Fire up" as Vim, but I also find that the philosophies of user interface from one to the other support this paradigm. Emacs is much more built ...


14

I think they're both awesome. I think either one can do just about anything you can imagine, and they're both so customizable, that by the time you finish customizing them, they're both just exactly what you want them to be, nothing more nor less. Emacs stands out to me in being a bit closer (although still does not meet) to ISO/IEC standards of usability ...


12

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 ...


12

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 ...


11

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 ...


11

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/vim73/colors/ blue.vim darkblue.vim default.vim delek.vim desert.vim elflord.vim evening.vim koehler.vim morning.vim ...


10

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, ...


10

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 ...


10

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 ...


10

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 ...


10

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 ...


9

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 ...


9

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.


9

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"


9

Elvis and Vim are both highly capable vi clones, so your finger memory will serve you well when switching between them. They share many vi extensions: Syntax highlighting Multiple undo and redo Visual mode, via v and V Command history and completion Tag stacks (e.g. :tags, :tn, etc.) Multiwindow editing, via :split, Ctrl-W, etc. Extended regexes: ...


9

Even though they type vi or call it vi it may still be vim. And at least vim can do all the "modern" features like auto-completion and syntax-highlighting, too. It can also mark/copy/paste text using the mouse if you wish. I however prefer vim and the console because I can do 100% of the work without ever taking one hand off the keyboard. Try that with a ...


9

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 ...


8

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 ...


8

This is not possible with a stock gedit; there's an open ubuntu brainstorm idea for adding the ability. However, there are plugins that add it, such as advanced-find. If you install that, one of the sections on the "Advanced Find/Replace" dialog is "Scope"; choose "All Opened Documents":


8

Nowadays, XEmacs is essentially dead. The last major release was XEmacs 21 in 1999; the last minor release to be promoted stable was XEmacs 21.4 in 2003, and the last maintenance release was XEmacs 21.4.22 in 2009. I don't think there is any major XEmacs feature that isn't in GNU Emacs 23. Historically, XEmacs was for a long time (from the Lucid days in the ...


8

You may also use WinSCP (using ssh) to navigate remotely (similar to windows explorer). When you edit file via WinSCP, it will download it locally and start your preferred editor (check in the options). Once you save the local file, WinSCP will automatically upload it to it's remote location. This gives the ability to edit remote files with the feeling of ...


8

This will delete all the files with a name ending in .swp, ~, .netrwhist, .log or .bak anywhere under your home directory. No prompt, no confirmation, no recovery, the files are gone forever. find ~ -type f \( -name '*.swp' -o -name '*~' -o -name '*.bak' -o -name '.netrwhist' \) -delete (I purposefully omit *.log because it sounds dangerous, this is not a ...


7

As a Blogger user who has been repeatedly burned by Blogger's web editor, I find myself using Tomboy to draft my blogs, and then I use the Tomboy Blogposter add-in to upload the blog as a draft, and make any necessary tweaks. This is nice because I'm already a heavy Tomboy user so drafting blog posts in a Tomboy note feels natural. Also, the add-in works ...


7

Since you mention Gvim specifically I assume that its the editor your prefer. Gvim/vim does support right-to-left text. Use the option :set rl or the long form :set rightleft to enable it. You can add this to your .vimrc if you want to always use it. vim will need to be compiled with the +rightleft option. I'm not 100% sure if Ubuntu does this, but ...


7

As a general purpose editor, probably not, but as a way to get yourself out of a pinch, it's good to know a few basics. The good news is that if you know your way around vim, it's likely you can use that knowledge to blunder around in ed. The times are changing, but there are still systems that it might be your best editor or connection scenarios that call ...



Only top voted, non community-wiki answers of a minimum length are eligible