Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

go to character in vim

Tags:

vim

People also ask

How do I jump to a character in vim?

You can type f<character> to put the cursor on the next character and F<character> for the previous one.

How do I go to a specific character in vi editor?

To find a character string, type / followed by the string you want to search for, and then press Return. vi positions the cursor at the next occurrence of the string. For example, to find the string “meta,” type /meta followed by Return. Type n to go to the next occurrence of the string.

How do you go to a specific word in vim?

One can search forward in vim/vi by pressing / and then typing your search pattern/word. To search backward in vi/vim by pressing ? and then typing your search pattern/word. Once word found in vim, you can press the n key to go directly to the next occurrence of the word in backwards.

How do I go to a column in vim?

The | command does what you want, as in 3 0 | will take you to column 30. bar | To screen column [count] in the current line.


:goto 21490 will take you to the 21490th byte in the buffer.


vim +21490go script.py

From the command line will open the file and take you to position 21490 in the buffer.

Triggering it from the command line like this allows you to automate a script to parse the exception message and open the file to the problem position.


Excerpt from man vim:

+{command}

-c {command}

{command} will be executed after the first file has been read. {command} is interpreted as an Ex command. If the {command} contains spaces it must be enclosed in double quotes (this depends on the shell that is used).