dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 0d570e6b54057141ba2c57bfbdbb974c914f8000
parent 080dbc5202df9d9ca6603868a9aaf64fa44ff52b
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Mon, 26 Mar 2018 19:53:22 -0400

Improve statusline

Diffstat:
Mlinks/.vim/plugin/appearance.vim | 92++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Mlinks/.vim/plugins.vim | 7+------
2 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/links/.vim/plugin/appearance.vim b/links/.vim/plugin/appearance.vim @@ -30,24 +30,24 @@ colorscheme tender " statusline helper functions function! StatuslineLinterWarnings() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:all_non_errors == 0 ? '' : printf(' %d ◆ ', all_non_errors) + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:all_non_errors == 0 ? '' : printf(' %d ◆ ', all_non_errors) endfunction " function! StatuslineLinterErrors() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:all_errors == 0 ? '' : printf(' %d ✗ ', all_errors) + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:all_errors == 0 ? '' : printf(' %d ✗ ', all_errors) endfunction function! StatuslineLinterOK() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:counts.total == 0 ? ' ✓ ' : '' + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:counts.total == 0 ? ' ✓ ' : '' endfunction " configure bottom status line @@ -68,34 +68,40 @@ endfunction " default: " set statusline=%f\ %h%w%m%r\ %=%(%l,%c%V\ %=\ %P%) -" define 3 custom highlight groups for statusline coloring -highlight User1 ctermfg=252 guifg=#d0d0d0 ctermbg=240 guibg=#585858 -highlight User2 ctermfg=247 guifg=#969696 ctermbg=240 guibg=#585858 -highlight User3 ctermbg=244 guibg=#808080 ctermfg=238 guifg=#444444 -highlight User4 ctermfg=252 guifg=#d0d0d0 ctermbg=238 guibg=#444444 -highlight User5 ctermfg=252 guifg=#d0d0d0 ctermbg=238 guibg=#444444 -highlight User6 ctermfg=238 guifg=#444444 ctermbg=203 guibg=#e5786d -highlight User7 ctermfg=238 guifg=#444444 ctermbg=173 guibg=#e5786d - -" empty statusline and populate later -set statusline= - -" left -set statusline+=%1* " set User1 color -set statusline+=\ %t\ " tail of filename -set statusline+=%4* " set User4 color -set statusline+=\ %h%w%m%r\ " flags for help file, preview, modified, R/O -set statusline+=%#LineNr# " set default background - -" center spacing -set statusline+=%= " add separation between left and right items - -" right -set statusline+=%4* " set background color -set statusline+=%7*%{StatuslineLinterWarnings()}%4* " ALE warnings -set statusline+=%6*%{StatuslineLinterErrors()}%4* " ALE errors -set statusline+=%{StatuslineLinterOK()} " ALE ok -set statusline+=%2* " set User2 color -set statusline+=\ %{LineNoIndicator()}\ " show file position with single char -set statusline+=%3* " set User3 color -set statusline+=\ %2l:%-2c\ " line and column view + + +augroup StatuslineConfig + + " define 3 custom highlight groups for statusline coloring + highlight User1 ctermfg=252 guifg=#d0d0d0 ctermbg=240 guibg=#585858 + highlight User2 ctermfg=247 guifg=#969696 ctermbg=240 guibg=#585858 + highlight User3 ctermbg=244 guibg=#808080 ctermfg=238 guifg=#444444 + highlight User4 ctermfg=252 guifg=#d0d0d0 ctermbg=238 guibg=#444444 + highlight User5 ctermfg=252 guifg=#d0d0d0 ctermbg=238 guibg=#444444 + highlight User6 ctermfg=238 guifg=#444444 ctermbg=203 guibg=#e5786d + highlight User7 ctermfg=238 guifg=#444444 ctermbg=173 guibg=#e5786d + + " empty statusline and populate later + set statusline= + + " left + set statusline+=%1* " set User1 color + set statusline+=\ %t\ " tail of filename + set statusline+=%4* " set User4 color + set statusline+=\ %h%w%m%r\ " flags for help file, preview, modified, R/O + set statusline+=%#LineNr# " set default background + + " center spacing + set statusline+=%= " add separation between left and right items + + " right + set statusline+=%4* " set background color + set statusline+=%7*%{StatuslineLinterWarnings()}%4* " ALE warnings + set statusline+=%6*%{StatuslineLinterErrors()}%4* " ALE errors + set statusline+=%{StatuslineLinterOK()} " ALE ok + set statusline+=%2* " set User2 color + set statusline+=\ %{LineNoIndicator()}\ " show file position with single char + set statusline+=%3* " set User3 color + set statusline+=\ %2l:%-2c\ " line and column view + +augroup END diff --git a/links/.vim/plugins.vim b/links/.vim/plugins.vim @@ -22,7 +22,6 @@ Plug 'Yggdroot/indentLine' " show indentation level with vertical lines Plug 'vim-scripts/AnsiEsc.vim' " show ANSI colors with :AnsiEsc """""" File system """"""" -Plug 'justinmk/vim-gtfo' " open finder (gof)/tmux pane (got) at pwd Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' " fzf commands from within vim Plug 'ludovicchabant/vim-gutentags' " automatic tag generation @@ -38,7 +37,6 @@ Plug 'junegunn/vim-slash' " clear highlight when moving cursor """""" Text editing """""" Plug 'tpope/vim-surround' " modify surrounding symbols -Plug 'tpope/vim-speeddating' " increment dates and times with C-a and C-x Plug 'tpope/vim-repeat' " repeat plugin bindings with . Plug 'junegunn/vim-easy-align' " align in columns (select > return > space) Plug 'reedes/vim-litecorrect' " autocorrect common typos @@ -51,7 +49,6 @@ Plug 'junegunn/vim-online-thesaurus' " query with :OnlineThesaurusCurrentWord Plug 'maxbrunsfeld/vim-yankstack' """""" Autocomplete """""" -"Plug 'ervandew/supertab' " complete with TAB in insert mode Plug 'honza/vim-snippets' " snippets are separate from ultisnips Plug 'SirVer/ultisnips' " complete boilerplate code @@ -64,8 +61,6 @@ Plug 'airblade/vim-gitgutter' " show line changes since last git commit Plug 'tpope/vim-dispatch' " for asynchronous :Make """""" File types """""" -" General -"Plug 'msanders/snipmate.vim' " boilerplate code " Go Plug 'fatih/vim-go' @@ -87,7 +82,7 @@ Plug 'godlygeek/tabular' " line up text (req for vim-markdown) Plug 'plasticboy/vim-markdown' " Mail -Plug 'vim-scripts/mutt-aliases', { 'for': 'mail' } " complete ~/.mutt/aliases +Plug 'vim-scripts/mutt-aliases', { 'for': 'mail' } " complete aliases w C-x C-u " LaTeX Plug 'lervag/vimtex'