Vi and Vim Asked by 200_success on December 27, 2020
How can I move the cursor to the nth byte in the buffer?
How can I display the current cursor position in the ruler in terms of the byte offset, rather than lines and columns? (Follow-up question: can it be displayed in both decimal and hexadecimal?)
:goto 2356
jumps to the 2356th byte in the buffer.
Use the %o
field in 'statusline'
or 'rulerformat'
to display the byte number of the character under your cursor.
Use %O
to display the value in hexadecimal format.
Reference:
:help :goto
:help 'statusline'
:help 'rulerformat'
Correct answer by romainl on December 27, 2020
To display the byte position you can use the following command
:echo line2byte(line("."))+col(".")-1
Answered by Vivian De Smedt on December 27, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP