← Back to Upcase

Command Language


(Upcase ) #1
Command Language Vim allows us to describe the edits we want to make using a concise and expressive language of key mappings that together we refer to as Vim's command language. This language is one of the most powerful and unique aspects of Vim ...
This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/onramp-to-vim-command-language

(arachnid-hq) #2

Totally awesome. I love the /search n . combo.


(Chris Toomey) #3

Thanks! Glad you’re enjoying it.


(sid) #4

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?


(Chris Toomey) #5

@sstgithub you certainly could use search for any t or T motion, but I find the explicitness of f, t, F, and T to map well to what I’m thinking. Also, searches only go up to the matching text, so you can’t replicate f directly.


(MrNagoo) #6

This is awesome.


(Craig) #7

Great stuff. Thanks a bunch.


(Alex Bush) #8

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?


(Chris Toomey) #9

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.

More generally, if you regularly find yourself wanting to move via word based things like that, you might want to check out plugins like CamelCaseMotion or vim-wordmotion.