Skip to content

Instantly share code, notes, and snippets.

@davesque
Created November 12, 2012 19:11
Show Gist options
  • Save davesque/4061243 to your computer and use it in GitHub Desktop.
Save davesque/4061243 to your computer and use it in GitHub Desktop.
Quickly set tab space size in vim
" With pathogen: place in ~/.vim/bundle/quicktab/plugin
" Without pathogen: place in ~/.vim/plugin
" Sets tab size to `size`.
function! QuickTabSet(size)
let &tabstop = a:size
let &softtabstop = a:size
let &shiftwidth = a:size
echo 'Changed tab size to '.a:size.' spaces'
endfunction
" Default bindings
map <silent> <Leader>4 :call QuickTabSet(4)<CR>
map <silent> <Leader>2 :call QuickTabSet(2)<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment