Created
October 27, 2009 00:19
-
-
Save nelstrom/219168 to your computer and use it in GitHub Desktop.
tabsize.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Set tabstop, softtabstop and shiftwidth to the same value | |
command! -nargs=* Stab call Stab() | |
function! Stab() | |
let l:tabstop = 1 * input('set tabstop = softtabstop = shiftwidth = ') | |
if l:tabstop > 0 | |
let &l:sts = l:tabstop | |
let &l:ts = l:tabstop | |
let &l:sw = l:tabstop | |
endif | |
call SummarizeTabs() | |
endfunction | |
function! SummarizeTabs() | |
try | |
echohl ModeMsg | |
echon 'tabstop='.&l:ts | |
echon ' shiftwidth='.&l:sw | |
echon ' softtabstop='.&l:sts | |
if &l:et | |
echon ' expandtab' | |
else | |
echon ' noexpandtab' | |
end | |
finally | |
echohl None | |
endtry | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment