Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to put cursor at the beginning of `tab`

Tags:

vim

When I open vim help, I press 0 to goto beginning of line;
When I press j to scroll down, the cursor jumps to right 8 spaces when focusing tab
And the cursor jumps back when focusing non-tab
It's not very good for eyes.
Is there an option to let vim focus the beginning of tab to let cursor stay at column 0?

like image 202
kev Avatar asked Dec 10 '11 15:12

kev


2 Answers

Another option:

http://blog.killtheradio.net/how-tos/vim-cursor-at-beginning-of-tab-in-normal-mode/

set list lcs=tab:\ \ 
" Note the extra space after the second \
like image 132
Dan Avatar answered Oct 06 '22 01:10

Dan


You can achieve this by setting

set virtualedit=all

This lets you position the cursor anywhere in the buffer, even beyond the end of the line and before a tab character. In help virtualedit there is a warning that it might break some scripts or plugins, so use it carefully!

like image 24
Prince Goulash Avatar answered Oct 05 '22 23:10

Prince Goulash