Created
May 8, 2014 08:24
-
-
Save markusfisch/5ff8aa4670002ef0fc62 to your computer and use it in GitHub Desktop.
Put this in your .vimrc to easily switch between tabs (F5) and spaces (F6) and highlight improper indent
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
" Use Tabs | |
function! UseTabs() | |
" Highlight tabs within lines, trailing whitespace and | |
" spaces at the beginning of lines | |
match errorMsg /[^\t]\zs\t\+\|\s\+$\|^[\t]*[ ]\+[\t]*[^\*]/ | |
set noexpandtab | |
endfunc | |
nnoremap <F5> :call UseTabs()<CR> | |
" Use Spaces | |
function! UseSpaces() | |
" Highlight tabs | |
match errorMsg /[\t]/ | |
set expandtab | |
endfunc | |
nnoremap <F6> :call UseSpaces()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment