Skip to content

Instantly share code, notes, and snippets.

@TaurusOlson
Last active April 2, 2020 10:42
Show Gist options
  • Save TaurusOlson/5626884 to your computer and use it in GitHub Desktop.
Save TaurusOlson/5626884 to your computer and use it in GitHub Desktop.
My Vim statusline. Specificities: - Simple - Show the current function and the current Git branch (using taglist and fugitive)
set statusline =
" Buffer number
set statusline +=[%n]
" File description
set statusline +=%f\ %h%m%r%w
" Filetype
set statusline +=%y
" Name of the current function (needs taglist.vim)
set statusline +=\ [Fun(%{Tlist_Get_Tagname_By_Line()})]
" Name of the current branch (needs fugitive.vim)
set statusline +=\ %{fugitive#statusline()}
" Date of the last time the file was saved
set statusline +=\ %{strftime(\"[%d/%m/%y\ %T]\",getftime(expand(\"%:p\")))}
" Total number of lines in the file
set statusline +=%=%-10L
" Line, column and percentage
set statusline +=%=%-14.(%l,%c%V%)\ %P
@TaurusOlson
Copy link
Author

The current tag can also be displayed with tagbar instead of taglist with:

set statusline +=\ [Fun(%{tagbar#currenttag('%s','')})]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment