Following is my set for statusline, thanks a lot for Tony. It works well.
" Format the statusline
set statusline=CWD:\ %{CurDir()}%h\ \ 
set statusline+=\ \ File:\ %{HasPaste()}%t%m%r%y%w[%{&fenc}]\ \ Line:\ 
%l/%L:%c\ \ Value:\ 0x%B\ \ %<%p%% 
set statusline+=[wc:%{WordCount()}]


let g:word_count="<???>"
function! WordCount()
 return g:word_count
endfunction

function! UpdateWordCount()
 let s = system("wc -w ".expand("%p"))
 let parts = split(s, ' ')
 if len(parts) > 1
 let g:word_count = parts[0]
 endif
endfunction

augroup WordCounter
au! CursorHold * call UpdateWordCount()
au! CursorHoldI * call UpdateWordCount()
augroup END

function! CurDir()
 let curdir = substitute(getcwd(), '/Users/lee/', "~/", "g")
 return curdir
endfunction

function! HasPaste()
 if &paste
 return 'PASTE MODE '
 else
 return ''
 endif
endfunction




-- 
Arthur Lee
Sent with Sparrow (http://www.sparrowmailapp.com/?sig) 

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to