Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created October 27, 2009 00:19
Show Gist options
  • Save nelstrom/219168 to your computer and use it in GitHub Desktop.
Save nelstrom/219168 to your computer and use it in GitHub Desktop.
tabsize.vim
" 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