- 論壇徽章:
- 0
|
""""""""""""""""""""""""""""""
" Statusline
""""""""""""""""""""""""""""""
"Always hide the statusline
set laststatus=2 "開啟了之后,狀態(tài)欄和命令欄分開了……
" 下面的函數(shù)比較有意思
" getcwd() 就是得到current working directory.
" substitute()是把getcwd() 里面的 /Users/amir/ 替換成 ~/
function! CurDir()
let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
return curdir
endfunction
"Format the statusline
" 具體解釋一下這個:大小寫功能差不多,只是顯示格式不一樣
"%F 是當(dāng)前的文件名i(完整路徑)。%t就只是名字.
"%m 可以顯示是否修改過
"%r 在文件只讀時,是否顯示[RO]。%h是在查閱help時是否顯示[Help]
" %L 是總行數(shù),%l是當(dāng)前行,%c是當(dāng)前列。
" 其實再加上 %y 顯示一下現(xiàn)在文件類型更好。
set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c
其實這里用空格分開不是很明顯,可以用"[]"來分
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u3/103801/showart_2053255.html |
|