To vim or not to vim
blog.reneaguirre.net
blog.reneaguirre.net
(Actually, I would not call vim flexible, but I am more of an editor programmer than an editor user.)
I've used vim as far as simple search, visual mode, and copy/paste. One of the things I've noticed when attempting to learn more vim is that when using other editors I use the time it takes to scroll or navigate to think about what I'm doing or what to work on next. From that (possibly naive) perspective, the effort to learn vim seems less necessary. Am I the only one who thinks this way?
Note: I make an exception for regex search and replace as an amazing power feature, but the GUI editor I use most of the time can do that anyway (Notepad++). Also now I'm really interested by snippets after having looked them up.
But if you use an editor for programming or composing more complex documents (such as LaTeX articles/books), then learning vim could save you a lot of time.
vim is also handy for editing lots of small, simple documents scattered all over a filesystem and on many different machines (tasks that system administrators have to do quite frequently).
Take a look through vim.org's script repository for just a small inkling of what vim could do.
http://www.vim.org/scripts/script_search_results.php?order_b...
This list of "best vim tips" should also give you a taste:
- discovering errorformat and using error format and quickfix to solve the complains a style checking tool outputs. This turned 'look in file. unterstand filename and line number and remember the reason, enter long path, navigate to line, fix reason' to ':cn, read reason, fix reason, :w, goto 1', and (opposed to some IDE), I can still focus on getting things done first and then fixing style issues.
- registers and macros. Recently, I had a number of similar fixes to do, even though it was not entirely trivial to describe those fixes with a regular expression. However, it was possible to describe the sequence of operations as a number of vim movements and vim operations. Thus, I could record the editing of a single file into a macro and just apply this macro to each file. This turned around 30-40 minutes of annoying things into like 5 minutes.
- after case b, learning about arglists and argdo, which would have cut down the time required for the change to a few seconds, opposed to several minutes.
Those are just from the top of my head.
How painful can I expect this experience to be? Vim doesn't seem fun at all.
There is a lot to learn, and vim certainly isn't the most intuitively designed editor on the planet; but it is one of the most powerful editors. So the work you put in to learning it will be well rewarded in productivity gains and sheer number of things that can be done in it that most other editors couldn't even dream of doing.
And once you learn it, vim is actually quite fun to use; and you might find that going back to using more traditional editors is painful, because of their inefficiency and lack of features compared to vim.
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
Then do some actual editing and try to navigate as efficiently as possible - make it a sport. Try to use as many different commands as possible.
There are some two letter commands (e.g. ZZ, gg, zt) but not that much. There are some CTRL-key commands, but few important ones. And there are tons of command-mode functions (e.g. substitution), but there are few that you really need to know.
http://www.viemu.com/vi-vim-cheat-sheet.gif
More here:
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...
But I still recommend "vimtutor" as a more structured approach to learning vim.
Ctrl-key commands become really important in insert and command-line modes.
And not to nitpick, but when you speak of "command-mode functions (e.g. substitution)", I think you really mean command-line mode. Command mode is another name for normal mode. Please try not to confuse the new/prospective users.
vim ~/git/con\t
and getting vim ~/git/configs/
and so on. Which seems to work much better in a nix environment.Personally I use emacs most of the time though vim does work well for quick edits.
set wildmode=list:longest
in your ~/.vimrc