What specific productivity gains do Vim/Emacs prov

2019-01-20 21:36发布

This isn't meant as a troll or flamebait or anything like that. I've been using Vim as my console-editor of choice for a couple months now (for editing configuration files while in my terminal), but I don't think I could stand it for my normal, every day work of writing web applications, which I do with a GUI text editor (which one isn't important).

I feel like my GUI text editor can do everything I need for my work. It has a decent search/replace with auto-complete histories for both. It has syntax highlighting, line numbering, a tabbed interface, easy copying and pasting, etc. The only thing my current editor is missing is regular expression matching, but there are plenty of GUI text editors that will do regex search/replace.

Given what I just said, what productivity advantages does Vim (or even Emacs) have over a GUI text editor aside from that fact that it is installed on every computer. I'd like specific tasks that are better/faster on Vim/Emacs or that are just not possible with existing GUI text editors.

20条回答
叛逆
2楼-- · 2019-01-20 21:58

The "productivity gain" I get for using a lightweight emacs clone for tiny programs is that it starts up like greased lightning. I can usually bang out a quick test program in C# before Visual Studio would have finished loading a "sandbox" solution.

Of course, I could just leave Visual Studio open (or another VS open if I'm working in it at the time) but then it would get swapped out if I left it idle for a while, etc.

For anything of any significant size - or if I don't know the API I'm using pretty well - an IDE is the way forward, IMO.

查看更多
【Aperson】
3楼-- · 2019-01-20 22:00

One thing that I really like about vim is the "repeater" command. Basically, by pressing . in command mode, it repeats your last action. This is just one example of really cool features that "programmer text editors" have that often GUIs don't.

查看更多
一夜七次
4楼-- · 2019-01-20 22:00

I use gvim for windows, so technically it's a GUI text editor, but it is vim..

For productivity enhancements, I find:

  1. I never have to use the mouse, therefore I'm faster.
  2. search, replace, copy/paste etc are all faster with vim keybindings vs mouse movements (once the learning curve was surmounted)
  3. As mentioned in the previous comments, RSI's are reduced significantly. My wrists have thanked me since I moved to vim.
  4. it's lightweight and fast
查看更多
狗以群分
5楼-- · 2019-01-20 22:04

For Vim:

  • Vim has better integration with other tools (shell commands, scripts, compilers, version control systems, ctags, etc.) than most editors. Even something simple like :.!, to pipe a command's output into a buffer, is something you won't find in most GUI editors.

  • A tabbed interface is not as nice as the "windowed" interface that Vim/Emacs give you. You can see two or more files at the same time side-by-side. The more you can see on-screen, the more you free your mind to think about your problem rather than doing mental bookkeeping of variable names and function signatures.

  • Don't underestimate the power of Vim regular expressions. There are a lot of Vim-specific extensions to match a specific column, a mark, the cursor position, certain classes of characters (keywords, identifiers) etc.

  • Integrated diff and grep (platform independent so you don't need to download and learn a new tool every time you change computers).

  • Visual block mode (to edit columns) is something many editors lack, but that I can't live without. I have shocked and awed people at work using just this, making some edit in a few keypresses that someone would've otherwise spent ten minutes doing manually.

  • Multiple copy/paste registers. When you only have one, you end up going through strange contortions to avoid clobbering the clipboard. You shouldn't have to.

  • Vim's undo/redo system is unbeatable. Type something, undo, type something else, and you can still get back the first thing you typed because Vim uses an undo tree rather than a stack. In almost every other program, the history of the first thing you typed is lost in this circumstance.

  • Moving around, copying, pasting, and deleting text is insanely fast in Vim. The commands are simple, single keypresses, and composable. Add up all the times you do a careful, laborious mouse highlight and Ctrl-X, then replace them all with a da( (delete a set of matching parens and everything in them). It saves more time than you'd think

  • The little things, like * to search for the word under the cursor, or . to repeat a command, or % to bounce between an opening and closing paren. Way too many of these to list.

  • Built-in scripting language and powerful key-mapping and macro ability so the editor can be extended in whatever ways you need. Tons of scripts already written and downloadable.

If you look closely enough, you'll find that even features that other editors also have, Vim often does better. All editors have syntax highlighting, but Vim has a syntax file for nearly every file format under the sun, often with lots of configuration options, and it's dirt-simple to write your own. Lots of editors handle different file encodings OK, but Vim gives you very specific and foolproof ways of setting file encodings and converting between them. The very first thing that impressed me about Vim is how perfectly it handles tab/space indentation options and Unix/DOS linebreaks compared to other editors that I had problems with at the time.

Many of these points apply equally well to Emacs (in different but usually equally-powerful ways).

查看更多
太酷不给撩
6楼-- · 2019-01-20 22:06

Record and Replay in VIM is unbeatably awesome, which you are very unlikely to find in GUI based tools.

Also auto increment/decrement gives it data generation capabilities without writing programs for it.

查看更多
相关推荐>>
7楼-- · 2019-01-20 22:07

I'd say one of the big advantages is the extensibility of the vim editor. If I want something to work with CVS I can take the CVSMenu plugin and add it to my editor to get that functionality.

Same with syntax highlighting, behaviour with specific files, etc. All sorts of things can be tailored in vim.

Not so sure if you can do that as easily in GUI type editors.

查看更多
登录 后发表回答