dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

statusline.vim (3394B)


      1 if exists("g:loaded_statusline") || &cp
      2   finish
      3 endif
      4 
      5 let g:loaded_statusline = 1
      6 
      7 set laststatus=2                                                      " Always show status bar
      8 set statusline=%#statuslinenormmode#%{(mode()=='n')?'\ \ N\ ':''}     " Normal mode indicator
      9 set statusline+=%#DiffAdd#%{(mode()=='i')?'\ \ I\ ':''}               " Insert mode indicator
     10 set statusline+=%#DiffAdd#%{(mode()=='t')?'\ \ T\ ':''}               " Insert mode indicator
     11 set statusline+=%#DiffDelete#%{(mode()=='r')?'\ \ R\ ':''}            " Replace mode indicator
     12 set statusline+=%#Todo#%{(mode()=='v')?'\ \ V\ ':''}                  " Visual mode indicator
     13 set statusline+=%#Todo#%{(mode()=='s')?'\ \ S\ ':''}                  " Select mode indicator
     14 set statusline+=%#statuslinefile#\ %f                                 " Relative path and filename
     15 set statusline+=\ โŒช%*                                                " Separator and clear highlighting
     16 set statusline+=%(\ %m%r%w\ %)                                        " Flags (modified, readonly, help, preview). don't show if empty.
     17 set statusline+=%#error#                                              " Start error highlighting
     18 set statusline+=%(%{statusline#StatuslineTabWarning()}%)              " Inconsistent indentation warning
     19 set statusline+=%*                                                    " Clear highlighting
     20 set statusline+=%{statusline#StatuslineRemoteFile()}                  " If editing remote file via netrw, show filename
     21 set statusline+=%=                                                    " Move everything after this to the right
     22 set statusline+=%<                                                    " Start truncating here
     23 set statusline+=\ %{statusline#StatuslineBuildCwd()}\                 " Current working directory, replacing home with ~
     24 set statusline+=%#statuslinefile#                                     " Highlight same as filename
     25 set statusline+=%(\ %{&spell?'๐Ÿ“–\ ':''}%)                             " Show spellcheck status
     26 set statusline+=%(\ %{statusline#StatuslineVimtexCompiler()}%)        " Vimtex compiler status
     27 set statusline+=%(\ %{statusline#StatuslineAle()}%)                   " ALE status
     28 set statusline+=%(\ %y\ \|%)                                          " File type
     29 set statusline+=\ %{&expandtab?'โคป':'โฅ…'}\                              " Using spaces or tabs
     30 set statusline+=%{statusline#StatuslineSpacesUsed()}                  " Spaces in a tab
     31 set statusline+=%(\ \|\ %{&paste?'๐Ÿ“‹':''}%)                           " Is paste set?
     32 set statusline+=\ \|\ %{statusline#StatuslineWrapCol()}\              " Textwidth/wrapmargin info
     33 set statusline+=\ %#statuslinenormmode#                               " Highlight same as normal mode indicator
     34 set statusline+=\ [%{statusline#StatuslineFoldmethod()}]              " The current foldlevel
     35 set statusline+=\ %l/%L\                                              " Cursor line/total lines
     36 set statusline+=\ %{strftime(\"%H:%M\")}\                             " Time
     37 
     38 augroup statusline
     39   " recalculate the tab/trailing whitespace warning flags when idle and after writing
     40   autocmd!
     41   autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning
     42 augroup END
     43 
     44 command! StatuslineWCAdd setlocal statusline+=%{statusline#StatuslineWordCount()}
     45 command! StatuslineWCRem setlocal statusline-=%{statusline#StatuslineWordCount()}