I've tried learning Vim several times, but the need to switch modes and back for cursor movement has been a huge turnoff, especially considering the location of the ESC key. It seems to just conflict with the way that I type, where I am frequently jumping my cursor around in the middle of text editing, which is effortless in Emacs. Maybe mastering Vim is not just about memorizing key combos but about changing your coding workflow?
Mastering vim is about learning a language (of verbs and objects) for communicating effectively with your text editor.
The modal aspects are there, but my experience has been that 80% of my editing time is spent reading and finding the right place to put something, and the default when opening a file is reading to find the right spot. Further, switching from read mode to write mode is often done with different purposes, and vim lets me express those different intents when changing modes (insert here, replace this word, replace this line, etc).
I think there is probably a little bit of changing your workflow, but for me it's been largely about learning how vim fits my workflow.
Exactly. Or remap it to any key combination that makes sense for your work, if you like using Capslock for its original purpose, which I happen to.
For example, I have jj and jk mapped to ESC. So I just tap j twice while in insert mode, and it switches to normal/command mode. If you find yourself needing to type jj or jk often in insert mode, just pick other letters that make sense for you.
To use mine, plop these in your .vimrc:
inoremap jj <Esc>
inoremap jJ <Esc>
inoremap jk <Esc>
You can also remap it to multiple keys. My preference is `jk`, since that letter combination is rarely used, still on home row, and can be typed about as fast as a single key. Useful, since it's a common action I take.
I go for jj since it removes the mental overhead. Often I'm just pawing through the code from top to bottom and in either normal or insert mode I just start hammering at jj and I start moving.
I feel the same way. vim is optimized for editing text rather than writing new text. The assumption is that we are editing existing text more often than writing new text when coding.
I don't even remember how to do this common things, if not in vim. How do you swap two lines? Something like "Home", "Shift+End", Ctrl +X", "Up", "Ctrl + V"? Or with the mouse?
I'm assuming you're jumping the cursor around to get to a different location in the text to make an edit? I use / (search forward) and ? (search backwards) a lot. It means that when you think to yourself "I need to edit XYZ" the command is, jump to XYZ, instead of down-across
-across etc.
No doubt, becoming proficient in vim is a big commitment that you really have to work at. Personally I think it's a great editor though.