Created
November 12, 2012 19:11
-
-
Save davesque/4061243 to your computer and use it in GitHub Desktop.
Quickly set tab space size in 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
" 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