No other editor stands next to vim. A lot of people dislike editors. It's fine. There are a million tools out there that help people become more productive programmers. You might enjoy IntelliJ or you might not. You might like cscope or hate it. Tt doesn't matter. One needs to find the tools that helps him in their day to day job. But if you need an editor, vim is no doubt the single best out there.
https://vimeo.com/53144573 - Precision editing at the speed of thought
All editors should place an emphasis on minimal typing.
Emacs has a few cool precision features too:
http://emacsrocks.com/e10.html - AceJump
Thank you for the links. I do use the AceJump equivalent for vim, and I have it mapped to <space>. It's quite nice, actually :). The only difference is that instead of pressing <space> and getting all the jumps available for each word out there, I press <space> followed by two letters, and it jumps directy to the word which starts with those two letters, or it simply shows me links to words that start with said letters if there's more than a word starting with those letters.
And no other operating system stands next to emacs.
But... there's an abundance of internet quotes like "No other editor stands next to vim" (see parent comment), so I wanted to make sure the reader didn't think I was proselytizing.
The other thing is efficient navigation within one file isn't super useful to me. I spend most my time doing find-in-files or jump-to-definition or rename-across-this-project. Vim kind of sucks for all those use cases. There are plugins of course, but that just brings it up to par with popular IDE's, except with a clunkier interface.
I say this as a person that knows vim well. If I'm SSH'd into a server and I need to edit a config file, vim is the first thing I'll reach for, but for coding, I'm pretty much only using it if I'm using a language that doesn't have a nice IDE already.
The point is well taken, but don't forget that for most people that downside of increased cognitive pressure goes away after a few days or weeks of regular vim usage. I've been using it for about a year and all the combos I normally use are second nature to me (and have been for months). Don't underestimate the human brain's ability to grow and adapt and for incredibly complicated things to quickly turn into routine.
For the record, I almost never use vim's much touted hit a number key then an action to do it n times feature. I have modified it so j and k do the normal down/up one line and J K go down/up seven lines or so for scrolling. [1] If I'm doing something like deleting a line and have to delete a bunch (common case), then I'll "dd" to delete line and then hit "." (which repeats the last action) three or four times until satisfied. Way easier than counting the number of lines to delete then typing "4dd" imo.
[1] Note for anyone who wants to duplicate this: it was still unbearably slow to just hold down J or K to scroll because the default delay between depressing a key and when OSX decides you are actually holding it down and not just pressing it once is too long. Decrease it in the native settings of your OS for a smoother experience.
If someone wants to use vim I'm not saying they shouldn't, I just think it's vastly overhyped.
If I had to delete four lines, I'd most likely mash dd until done, or maybe Vjjjd. It would be completely automatic and not require reaching for numbers or the arrow keys, making it significantly faster and more comfortable as well.
I find that vim is extremely good for reading code, since navigating around a file is very easy (and I am in no danger of accidentally editing code while not in insert mode.).
Not having to reach for the arrow keys while navigating is a huge plus as well, since it keeps my fingers on the same position whether I am typing or navigating.
EDIT: Vjjjd, not Vjjjjd. Drives home the point that it's automatic, since I can't get it right if I think about it...
My favourite bit is that I use which one pops into my head first. If I think "until the next occurrence of 'nded?'" then that's what I do, with d/nded?<RET>. If I think "up to line 438" then I can do d438g. It reduces the number of decisions I have to make, which increases my mental stamina.
"""I say this as a person that knows vim well."""
These two phrases don't go together.
Would you say you knew how to play a piano well if you were still consciously thinking about where each note was?
If you don't use vim to the level that it's subconscious and "in your fingers" it might not seem all that useful...
Fwiw "ag" and the various plugins around it make your use case pretty trivial.
Sure they do. VIM has such a culture of minimizing keystrokes that pretty much anything you do, you start wondering if you could have done it with fewer key strokes, or if you could have done it better. It's hard NOT to think that way because that's the entire point of getting into VIM in the first place.
For whatever reason, I find it easier to use commandline tools to do large search and replaces. I do embrace the vim-as-text-editor within the larger Linux-program-composability philosophy, but I understand that not everyone else does. So I use ack and perl, as mentioned in this StackOverflow post: http://stackoverflow.com/a/8744108/1141805
(Actually, sometimes I distinctly do things the wrong way. I open a scratch buffer, `:r! ls` to get my file names, restrict to those that I want, create a macro that does what I want on the file under the cursor, and then repeat the macro. I am not proud.)
It uses Ag to search over each file and Perl to perform the necessary regex. It also creates *.bak backup files in case I replaced something that wasn't supposed to be replaced, but will remove those backup files if I'm in a Git repo (because I basically had to `git clean -f` every time after using this command...so I just wrote it into the command)
What about emacs?
What I do know is that if there's something I want done, I suspect there is a plugin that does it. So at least morally, there are sufficiently developers for both emacs and vim (in my experience).
Maybe it's just my anecdotal evidence, but I've looked for alternatives to certain emacs plugins used by my co-workers (such as org-mode and ensime) and couldn't find a suitable replacement (I know there are some alternatives for vim, but they pale in comparison to their emacs counterparts).
From this, and I think HN is a good place for such a poll, it looks half as many people use Emacs compared to Vim.
https://news.ycombinator.com/item?id=8678339
And it actually should be even less, judging from people in my university and in every workplace I've been.
(Sorry. I had to. Don't hate me!)
I still vi/vim everyday too though, mostly because some things, like embedded stuff I work on, emacs would be too much, so it's very much situational.
F5 Up F2
Left Down Right
Tab Del Backspace
Enter Space ESC
This speeds me up greatly. Especially in mixed GUI/keyboard input situations.I might just get one to try out something similar. I'm thinking it might also be useful to have a different mode on the mouse that have the buttons map to keys on the numpad for calculations.
[0] https://i3wm.org
[1] https://chrome.google.com/webstore/detail/vimium/dbepggeogba...
I chose xmonad at one time, but it was more or less by chance --- someone else used it that I knew, and so I tried it. But I haven't actually compared any.
Last time I tried spf-vim[0] but while it looked 'cool' (it has colors, it does code completion, it somwhere have the folder/file tree view and maybe eve tabs/panels...) yet it is overly complicated, quite badly documented (there is no intro like tutorial on getting you up to speed with what you may want from a text editor, just some strange sounding plugin list with few shortcuts here and there) and overloaded with plugins I am not interested in (PHP related ones) not to mention having few strange issues requiring googling and writing additional configuration just to make VIM behave...
So, while I'd love to use VIM for its speed, the fact its easily portable with the configuration and is available on almost every OS (BSD, Mac, Windows, Linux, you name it) I still write 99% of my code in Sublime, and only use VIM on servers to change this and that. Perhaps another time ;)
I'm happy to act as a coach for you (and anyone else), if it's helpful. If you have a good plan of attack, you can get Sublime-like functionality pretty quickly.
My setup is after trial and error: vim + (nerd tree, command-T, tagbar, Gundo) inside a tmux session. On another tmux window, I use 'find ... exec...' to search. So far excellent for me, I feel Zen like coding with this setup with no IDE noise :-).
What you call tabs are what vim calls buffers. (EDIT vim has something called tabs as well but they do something else.)
Completion press e.g. control-x (although I actually use a plugin here so I don't know how good vim's built in is).
Visual selection add set mouse=a to the .vimrc
Or using the "v" command
I have tabn/tabp bound to <leader>l and <leader>h for easy nav and <leader>t for create.
If you're in the #1 camp, chalk it up to experience and move on.
Otherwise, at some point consider giving it another try, but Google up some articles specifically about the language aspect of vim. It's a lot easier to get up to speed and make better use of vim that way.
You should try `vimtutor` (it usually ships with vim). For the first 1-2 weeks of using vim, you will be less productive than with your usual editor but you have to force yourself to use it. Eventually, you will not want to go back.
As an example, having used Vim for ten years, just within the last few weeks I started to seriously learn and use Ultisnips, SkyBison, Vim-swoop, etc. It has been pure fun and rewarding.
To be clear, I don't use that many plugins. Often time I discover something already built into Vim proper which can replace a plugin (after some light scripting/configurations), then I usually uninstall that plugin. This has happened more frequently in recent years, possibly because of my improved Vim-fu (still a mediocre user I am sure). So both productivity and portability get improved while I am having fun learning new things.
But I find that I can usually accomplish the same thing with macro or a targeted search and replace.
in visual block mode (CTRL-V or CTRL-Q), select a column of lines you would like to edit. Then, you can enter insert mode or paste and it will do the same thing on all the lines selected.
so to edit 4 lines at once it would be (CTRL-Q)3jI and then type in whatever i want and when I exit back to normal mode the text will appear on all 4 lines.
As a sysadmin, I appreciate the fact that some form of vi exists on any vaguely unix-like machine I log into. Even without a .vimrc, the basic commands for line editing and searching work and they match with tools like less (or does less match vi?) and using vi has become second nature over time because it's everywhere and it tends to be the default (I hate it when someone makes nano the default $EDITOR so that eg. sudoedit doesn't do the right thing)
I wish Windows servers shipped with vi, too. A decent text editor is the one thing I consistently find myself missing. Notepad most definitely does not count.
https://www.kickstarter.com/projects/1666150716/keymousetm-t...
I didn't end up backing it though because I didn't want to dump $250 on a v1 product would likely have many issues to sort out. That and the ergonomics of the typing didn't look that great.
Using VIM saves you time and a smart user will search out the ways the editor can help her, but there's no value in making the user go cold turkey.
Opening up a virgin vim session on a new system kind of makes you realize how much you'll miss out on if you don't know about :set number, :set wrap, :set syntax <whatever>.
You can disable the menus, and using MacVim doesn't require you to use the menus. I use Vim 100% with the keyboard, and I still use MacVim.
No other text editor has as many developers working on
plugins than VIM. Virtually anything that exists in
another text editor which isn’t mouse driven has some
very popular, very supported, very documented plugin
you can use.
And the Vim equivalent of org mode is what again? I'm a Steve Litt fan, but Vim Outliner isn't even in the same league as org mode.As a Vim user of many years I still believe it to be superior to emacs when it comes to editing text. That said, emacs is a vastly superior programming environment. And like many people I find org mode to be indispensible.
Happily, these things aren't either/or situations. I still use Vim for quick text editing tasks, but for other matters evil+org mode lets me have the best of both worlds.
Edit: typos
VimWiki: https://github.com/vimwiki/vimwiki
Not 100% of the same functionality, but close enough for me as to not matter. For the missing features, I have the rest of the OS.
I daresay it's impossible for someone to not use a tool, however complicated, for nearly 2000 hours and not become quite familiar with its operation.
This is also 1/5th of the (disputed) "magic number" of 10,000 hours to master a skill.
What I'm trying to say is: Yes, you can very much get through a year or more of using vim without leveraging it's power. (And you probably will, given how much there is to learn.)
I found a number of things just work way better in emacs than in vim. For example, web-mode was a revelation for me. I could never get vim to get syntax right in mixed HTML-JS files.
Ability to edit very large files with ease was another one in favour of emacs. Vim would freeze up for a seconds or two while saving even half a megabyte file.
helm and family blew my mind away.
Another win spacemacs is it does not hide default emacs functionality. All default emacs keyboard shortcuts would always work, so learning vanilla emacs is still helpful.
Once I got to know spacemacs shortcut layout, it was surprisingly intutive.
(YMMV)
But it's not nearly as portable as vanilla vim. Even vim with several plugins, including vimproc and Unite, I've found is a lot more portable than Spacemacs. Spacemacs is a lot slower as well.
For me, unfortunately portability is really important, which is why so far nothing has been able to sway me away from my trusty tmux + vim + Unite combination.
The minor upgrade in functionality wasn't worth the instability.