Created
February 16, 2012 09:37
-
-
Save hokaccha/1843651 to your computer and use it in GitHub Desktop.
indent_toggle.vim
This file contains hidden or 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
" タブの設定を切り替えのトグル | |
function! TabToggle() | |
fun! l:Set1() | |
setlocal softtabstop=2 | |
setlocal shiftwidth=2 | |
setlocal expandtab | |
endfun | |
fun! l:Set2() | |
setlocal softtabstop=4 | |
setlocal shiftwidth=4 | |
setlocal noexpandtab | |
endfun | |
fun! l:Set3() | |
setlocal softtabstop=4 | |
setlocal shiftwidth=4 | |
setlocal expandtab | |
endfun | |
if !exists('b:idx') || b:idx > 2 | |
let b:idx = 0 | |
endif | |
let b:idx = b:idx + 1 | |
exe 'call l:Set'.b:idx.'()' | |
endfunction | |
nnoremap <silent> <C-k> :<C-u>call TabToggle()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment