vim tips: motion keys 

The biggest "level up" tip I could give to any beginner to moderate user is: learn all the movement keys and use them obsessively.

Deleting some characters? Mashing backspace in insert mode wastes keystrokes, mashing "x" is annoying to undo.

dt_ -- delete up to the next _
df_ -- delete up to and including the next _
ct_ -- delete to the next _ and switch to insert mode
di} -- delete inside the current braces
4dt_ -- delete until the 4th underscore

:help motion.txt

re: vim tips: motion keys 

@annika the d/c + i combo gets way more powerful than that too! Vim will understand pretty much any delimiter-- I end up using: ci" a lot to edit strings, and, if vim detects that you are editing an HTML file, you can even do: cit to "change in tag". Vim is a fractal of composability.
Follow

@11backslashes The one I don't use nearly enough is d/foo (delete until the search result "foo")

· · Web · 1 · 0 · 0
@annika I love seeing how everyone's exploration of this editor is different. I highly recommend making that one part of your workflow— I use it all the time! Along with using f to navigate. These were great speedups.
Sign in to participate in the conversation
XOXO Zone

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!