diff options
author | Urbain Vaes <urbain@vaes.uk> | 2016-03-23 11:49:58 +0000 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2016-03-23 11:49:58 +0000 |
commit | be786f2755bae230f2fb18ab9a0c8bdeab92cb0d (patch) | |
tree | 728b3a6fddbb473a11d45e0936421d8263f1fecf /vim/vimrc | |
parent | 4f68f0a0c5636a54ca9acdf5d5b884caa30ce369 (diff) |
Add flag for mixed indent
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -71,9 +71,20 @@ Plug 'tpope/vim-commentary' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-flagship' -autocmd BufEnter,BufWritePost * let g:trailing=search('\s\+$','pn') -autocmd User Flags call Hoist("window", "%{g:trailing?'[tw]':''}") -autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag") +function Mixed_indent() + let b:spaces=search('\v(^ +)','n') + let b:tabs=search('\v(^\t+)','n') + return (b:spaces * b:tabs > 0) +endfunction + +augroup myflags + autocmd! + autocmd BufEnter,BufWritePost * let b:trailing=search('\s\+$','n') + autocmd BufEnter,BufWritePost * let b:mixed=Mixed_indent() + autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag") + autocmd User Flags call Hoist("window", "%{b:trailing?'[tw]':''}") + autocmd User Flags call Hoist("window", "%{b:mixed?'[mixed]':''}") +augroup END Plug 'tpope/vim-fugitive' Plug 'tpope/vim-obsession' |