Using VIM how do I 'set statusline' to align right? -


my ~/.vimrc uses following statusline setting

set statusline=%f%m%r%h%w\ %{&ff}\ %y\ [0x\%02.2b]\ %l/%l,%v\ %p%% 

everything left aligned. help 'statusline' says - character used "left justify item. default right justified when minwid larger length of item."

however, haven't been able use (or not use) - ever align things right.

so example of having 1 group of items left aligned , 1 group right aligned?

i've tried use = prints = sign.

you need prefix = percent sign: %=.

using example:

set statusline=%f%m%r%h%w\ %{&ff}\ %y\ [0x\%02.2b]\ %=l/%l,%v\ %p%% 

will right-align "%l/%l,%v\ %p%%" group. should force truncation using %< in suitable place accommodate narrow windows:

set statusline=%f%m%r%h%w%<\ %{&ff}\ %y\ [0x\%02.2b]\ %=l/%l,%v\ %p%% 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -