分享 vim status bar 的設定

1170 views
Skip to first unread message

FourDollars

unread,
Oct 22, 2009, 9:15:01 AM10/22/09
to Vim-Taiwan
剛剛從 pct 那邊學到的~ :D

" status bar
set laststatus=2
set statusline=%4*%<\ %1*[%F]
set statusline+=%4*\ %5*[%{&encoding}, " encoding
set statusline+=%{&fileformat}]%m " file format
set statusline+=%4*%=\ %6*%y%4*\ %3*%l%4*,\ %3*%c%4*\ \<\ %2*%P%4*\ \>
highlight User1 ctermfg=red
highlight User2 term=underline cterm=underline ctermfg=green
highlight User3 term=underline cterm=underline ctermfg=yellow
highlight User4 term=underline cterm=underline ctermfg=white
highlight User5 ctermfg=cyan
highlight User6 ctermfg=white

c9s

unread,
Oct 22, 2009, 11:50:07 AM10/22/09
to Vim-Taiwan
Ahaha! Nice !

c9s

unread,
Oct 22, 2009, 11:54:56 AM10/22/09
to Vim-Taiwan
我之前的 statusline 是這樣:

set statusline=%<%f\ %h%m%r%=%k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?
\",bom\":\"\")}]\ %-14.(%l,%c%v%)\ %p

不過被我 mark 起來很久了。XD

c9s

unread,
Oct 22, 2009, 11:56:16 AM10/22/09
to Vim-Taiwan
如果要 hack git 的東西還可以整合 git 的東西:

if winwidth(0) >= 120
set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?
&fenc:&enc).':'.&ff.']'}%y\ %(%{GitBranch()}\ %)\ %F%=[%{GetB()}]\ %l,
%c%V%8P
else
set statusline=%<[%n]%m%r%h%w%{'['.(&fenc!=''?
&fenc:&enc).':'.&ff.']'}%y\ %(%{GitBranch()}\ %)\ %F%=[%{GetB()}]\ %l,
%c%V%8P
endif

當然要寫一下 GetBranch function 跟 GetB function.

:p

闲耘™

unread,
Oct 22, 2009, 11:57:31 AM10/22/09
to vim-t...@googlegroups.com
我用的这个,for :colo desert:

" User Defined Status Line.
" @see http://www.vim.org/scripts/script.php?script_id=8 for VimBuddy.
set laststatus=2
set statusline=%t\ %1*%m%*\ %1*%r%*\ %1*%h%*\ %1*%w%*%=\ [%{VimBuddy()}]\ [%Y:%{toupper(&ff)}:%{toupper(&fenc!=''?&fenc:&enc)}]\ [ASCII:%b]\ [%l%2*/%L(%p%%)%*,%v]
hi User1 guibg=red guifg=yellow
hi User2 guibg=#C2BFA5 guifg=#666666

?ui=2&view=att&th=1247cf77c436bf26&attid=0.1&disp=attd&realattid=ii_1247cf77c436bf26&zw


--
闲耘™ (@hotoo, xianyun.org)
Sent from Hangzhou, 33, China


2009/10/22 c9s <corneli...@gmail.com>
vim-status-line.png

ChenKaie

unread,
Oct 22, 2009, 12:10:08 PM10/22/09
to Vim-Taiwan
My setting:
set statusline=File:\ %t\%r%h%w\ [%{&ff},%{&fileencoding},%Y]\ %m%=
\ [AscII=\%03.3b]\ [Hex=\%02.2B]\ [Pos=%l,%v,%p%%]\ [LINE=%L]
Snapshot: <img src="http://farm4.static.flickr.com/
3443/3933760963_2b6a99bde6_o.png"/>

On Oct 22, 9:15 pm, FourDollars <fourdoll...@gmail.com> wrote:

凍仁翔

unread,
Oct 31, 2012, 12:01:43 PM10/31/12
to vim-t...@googlegroups.com
請問上述的 Hex 是指什麼?請指示一下,謝謝 <(_ _)>

Kent Chen於 2009年10月23日星期五UTC+8上午12時10分08秒寫道:

凍仁翔

unread,
Oct 31, 2012, 12:02:32 PM10/31/12
to vim-t...@googlegroups.com
補上目前的 status line :P

set statusline=%y\ %t\%r%h%w\ %m%=\ %{&fileencoding}\ [%{&ff}]\ [AscII=\%03.3b]\ [Hex=\%02.2B]\ [LINE=%L]\ [Pos=%l,%v,%p%%]


凍仁翔於 2012年11月1日星期四UTC+8上午12時01分43秒寫道:

Kent Chen

unread,
Oct 31, 2012, 12:35:15 PM10/31/12
to vim-t...@googlegroups.com
看來凍仁大大已參透了 :) 
小弟目前已經切換至 vim-powerline 強大又有質感

賴楚翔 (Chu-Siang Lai)

unread,
Nov 16, 2012, 10:41:33 PM11/16/12
to vim-t...@googlegroups.com

 感謝 @Kent Chen 的分享小的已經開始使用 powerline 了

by the way ...
有人成功自訂 powerline 的 themes 嗎?!

----
jonny@gmail:~$ cat profile.conf
- 賴楚翔 (凍仁翔)



2012/11/1 凍仁翔 <chusia...@gmail.com>
Reply all
Reply to author
Forward
0 new messages