Fiddling with my vim statusline

This:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function! FileSize()  
let bytes = getfsize(expand("%:p"))  
if bytes <= 0  
return ""  
endif  
if bytes < 1024  
return bytes  
else  
return (bytes / 1024) . "k"  
endif  
endfunction

set statusline=%1* "color to user mode 1  
set statusline+=%<%t%w%h%m%r "tail of current file and its flags  
set statusline+= [%{strlen(&fenc)?&fenc:'none'}/ "file encoding /  
set statusline+=%{&ff}/ "file format /  
set statusline+=%Y] "file type  
set statusline+= [%{getcwd()}] "cwd() ;-)  
set statusline+= %{FileSize()}  
set statusline+=%= "align the rest to right  
set statusline+=%-7.(%l of %L [%p%%] - Col: %c%V%) "Current line, percentage of size, column  
set laststatus=2

Gives me this:

Incidentally, the erlang brush for SyntaxHighlighter is the closest for vim config files.

Apr 18th, 2011

Comments