Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move to next _ in the current line with VIM

Tags:

vim

I am having a problem when I am looking at words like:

my_class_name

Pressing w will bring me to the end of the word. I however would like to jump to the next occurence of _.

I am using dt_ to delete till _. Is there something similar with a jump command?

like image 589
Hendrik Avatar asked Sep 03 '25 03:09

Hendrik


1 Answers

In normal mode use t_ with no modifier to jump to the character before the next _. Use f_ to jump directly to that character. Or use /_ to search for occurrences across all lines (which will automatically jump to the first match).

like image 101
Wayne Avatar answered Sep 04 '25 22:09

Wayne