Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Useful Vim Commands (vimtricks.com)
69 points by alwillis on Oct 25, 2022 | hide | past | favorite | 5 comments


These are useful but I think there’s a lot of redundancy in the list because only specific sequences of keystrokes are listed instead of the more general vim count-destination-verb-adverb-noun syntax that produces them. For instance, when starting with a verb, `a` and `i` act on _all_ and _inside_, respectively, and what follows determines the boundary of those two regions. `da(` deletes everything between and including the current pair of parentheses. `cit` deletes everything between and excluding the current HTML tag and enters insert mode. `cs(]` changes the surrounding parentheses, replacing them with square brackets (this might require on a plugin?). Etc etc.

Just like natural language, Vim’s command language has a finite syntax with only a handful of forms; once you learn them, you can substitute “parts of speech” and things will work as you expect.


I wrote a similar post the other day but with my top 10 vim commands: https://catonmat.net/top-10-vim-shortcuts


Good stuff.


Thanks!


Nice. I don't remember coming across `+` movement before (move to the first non-whitespace character of the next line)

I'm also doing a Vim tip series: https://learnbyexample.github.io/tips/#vim (or, you can also check out my Vim Reference Guide ebook: https://learnbyexample.github.io/vim_reference/Introduction....)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: