The best way to understand and use vim is to learn the "grammar" of vim and then practice using it until you have muscle memory for common movement and editing commands. This stackoverfow post explains how the vi/vim "grammar" works: https://stackoverflow.com/questions/1218390/what-is-your-mos... . A fun way to develop the muscle memory for the normal mode movement keys is to play Nethack ( https://www.nethack.org/ )…
Learn Vim (the Smart Way): a book to learn the good parts of Vim
61–70 of 134 posts
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#62I recommend swapping your left CTRL and ALT keys when using vim, as well as CAPS and ESC to avoid RSI. Also, the dot operator is king.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#63I'm not trying to be contrarian here, but why would someone continue to use Vim and Emacs when all of its lovely features have been integrated into products like VCode? It just reminds me of serious men with beards working on mainframes and AIX power systems when I started my career.
I think this might be only superficially true. One of the meta-features of vim/emacs is, over months and years of use, they slowly teach you how IDEs "work", and invite you to tweak how yours works to your whim.
example: I notice a process is slow in vim. I'm able to profile the problem, identify the binary responsible, replace it with a faster equivalent program, and enjoy that improvement for the rest of my life. Such a thing may be possible in VS Code, but it's against the norm of "just install this plugin", whereas it is the norm in vim/emacs-world.
Some other scattered ideas:
I also think that, since vim and emacs are fundamentally cli tools also gives them an advantage, because you can hook them in to your terminal workflows (git add -p, git commit -v, etc). also, you can dispatch terminal commands seamlessly from inside vim (I get `make build` in two keystrokes: `,d`).
vim (I can't speak for emacs, don't use it) is also more responsive with a much smaller resource footprint and an equivalent feature set. my work laptop can run a web browser and vim for 6+ hours. With vs code, maybe 3 hours.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#64Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#65Buffers are one of the few parts of vim I never really got the hang of. Neither that nor windows are things I can ever remember how to do without fudging it the first time, having to go look up the manual again for how to do it properly, realize I'm wasting more time than I'm saving by trying to learn it, and give up.
Personally, I can't imagine being productive without windows and buffers. although when I have 3+ buffers open, I usually "cheat" by fzf-finding the file (rather than `:bn`-ing my way there, or `:b` `:b x`).
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#66Earlier quoted context omitted.
I'm personally a fan of remapping jk or jj to esc, there barely any instances in the english language where you would use those two letters together, and it means you can leave insert mode whilst barely moving your hands :D
My issue with this is that it causes a delay with every single j that is entered. Only a visual delay that freezes the cursor and then lets it jump by two characters, but irritating for me regardless. Otherwise it's very practical though.
Haven’t touched that part of my vimrc in years
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#67I'm not trying to be contrarian here, but why would someone continue to use Vim and Emacs when all of its lovely features have been integrated into products like VCode? It just reminds me of serious men with beards working on mainframes and AIX power systems when I started my career.
However, there's also times when I don't have the luxury of using an IDE or when I just need to make quick edits to a single file. In these circumstances, I can just fire up vim and quickly do what I need to do because vim is ubiquitous and editing with it is efficient.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#68Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#69Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
IMHO chording the 'j' and 'k' keys simultaneously [1] is a severely underutilized solution for escape.
Try it. You'll love it.
If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. Capslock escape isn't useful outside of Vim. Backspace is useful everywhere, including inside Vim.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#70Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
I hear this recommendation a lot. You can do that, but much better is to get a keyboard with a proper thumb cluster like a kinesis[1], maltron[2], dactyl[3], ...
Much better to put such a common key on the thumb than stress out a pinky. I have a kinesis, and have esc mapped to the 'end' key there; similar positioning is possible on other keyboards. The keyboards I linked are also much more ergonomic than most flat keyboards—important, if you rely on your hands and wrists for your livelihood. Bit expensive, but well worth it.