This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/onramp-to-vim-command-language
Totally awesome. I love the /search n . combo.
Thanks! Glad you’re enjoying it.
Very useful video, vim is getting more and more useful for me!
One question: Wouldn’t
/<search term or character> work for any situation, making both
f<search character> or
t<search character> redundant?
@sstgithub you certainly could use search for any
T motion, but I find the explicitness of
T to map well to what I’m thinking. Also, searches only go up to the matching text, so you can’t replicate
This is awesome.
Great stuff. Thanks a bunch.
Great episode! What I still can’t figure out though is how to jump camel or snake case parts of variable, method, and class names?
Hi @alexvbush, thanks for the kind words! For snake case motion you can use
f_ to “find” the next underscore, then
; to repeat that motion to find the next, and the next, and the next. That said, I’d probably use a search to more directly target the thing you’re after, but either would work.
For camel case, you can likely get there directly by targeting the capitalized letter you’re seeking as it will likely be unique, so given
hello[W]orldVariableNameHere, with your cursor on the
W in word, you could use
fN to jump to the
N in name. Again, a search would also work here, and would likely be what I’d use.