Spaces or Tabs based on your git repo
I use the same vim file on different projects and sometimes some projects use different settings. So to avoid switching things around for each project I just let the if statements handle it.
function Tabulate()
"check the repo
let l:repo = system('git remote show -n origin | grep "Fetch URL"')
"use match to check what repo it is.
if match(repo, ''domian'') > 1
set noexpandtab "tabs not spaces
else
set expandtab "spaces not tabs
endif
endfunction
autocmd BufEnter * :call Tabulate()
Written by Rodolfo Ovalles
Related protips
1 Response
I've had good luck with DetectIndent:
http://www.vim.org/scripts/script.php?script_id=1171
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#