commit aac7a091f61d89016af19d02c462eb5ad6109a7d
parent e7ad9b8dc16a37bbf9153be5bfe0101c2b862981
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Mon, 6 Apr 2020 11:31:59 +0200
vim: various configs
Former-commit-id: 62bc5e58d19cf71ce0a3987131264718ecf4262d
Diffstat:
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/vim/autoload/statusline.vim b/vim/autoload/statusline.vim
@@ -66,3 +66,11 @@ function! statusline#StatuslineWrapCol()
return "TW ".&textwidth
endif
endfunction
+
+function! statusline#StatuslineSpacesUsed()
+ if &expandtab
+ return strlen(&shiftwidth) ? &shiftwidth : 'none'
+ else
+ return &tabstop
+ endif
+endfunction
diff --git a/vim/plugin/statusline.vim b/vim/plugin/statusline.vim
@@ -17,7 +17,7 @@ set statusline+=%= " Move every
set statusline+=%{&spell?'[spell]\ ':''} " Show spellcheck status
set statusline+=%y " File type
set statusline+=\ [%{&expandtab?'spaces':'tabs'}, " Using spaces or tabs
-set statusline+=%{strlen(&shiftwidth)?&shiftwidth:'none'}] " Spaces in a tab
+set statusline+=%{statusline#StatuslineSpacesUsed()}] " Spaces in a tab
set statusline+=\ [%{statusline#StatuslineFoldmethod()}] " The current foldlevel
set statusline+=\ {%{statusline#StatuslineWrapCol()}} " Textwidth/wrapmargin info
set statusline+=\ %l/%L\ " Cursor line/total lines
diff --git a/vim/vimrc b/vim/vimrc
@@ -650,6 +650,7 @@ command! -nargs=1 Cheat terminal curl cheat.sh/<args>
command! Reveal exe "silent !open ".shellescape(expand("%:p:h")) | redraw!
command! Softwrap setlocal textwidth=0 wrapmargin=0 wrap
command! Hardwrap setlocal textwidth< wrapmargin< nowrap
+command! Syncwin windo set scrollbind! cursorbind!
" Fat finger fixes/convenience abbreviations
cnoreabbrev E Explore