It has been quite effortless to delete or replace words or lines but every time I've tried getting more adventurous with it - say, surround every line of text with double quotes etc, I end up finding the commands unintuitive or hard to remember.
There's also an issue with my older muscle memory of `CMD+Z` which works on a different stack than `u` and `CTRL+R` and I end up messing up my code.
It’s worth noting that u and ctrl-r don’t operate on an undo stack but on an undo tree.
So if you have a series of edits and undo them all then do something else you can still get back to where you were before.
Use g+ and g- to walk the tree and the Gundo plugin is gives you a nice visual diff interface.
So having a separate shortcut and “stack” is actually a great feature of Vim IMHO.
Do you have any other similar recs that would help for learning?
set path+=**
to your vimrc, and open vim from the top level directory for your project :find <unique_filename_part> will just workSetting up ctags will give vim some IntelliSense-like functionality that people tend to miss from their IDEs. More info here: https://andrewra.dev/2011/06/08/vim-and-ctags/
Be wary of this, it can end up being quite slow. Here is an excellent write up detailing the usage of the path setting.
https://gist.github.com/romainl/7e2b425a1706cd85f04a0bd8b389...
His book Practical Vim[1] is particularly good because it teaches you the “vim way” without plugins.
Not that there’s anything wrong with plugins, I use a load of them, but there’s loads you can do without them.
1. https://pragprog.com/titles/dnvim2/practical-vim-second-edit...