if has("autocmd") filetype plugin indent on augroup InvisibleCharsHighlight au! autocmd ColorScheme * :call ResetColors() function! ResetColors() "Invisible character colors highlight NonText guifg=#4a4a59 highlight SpecialKey guifg=#4a4a59 endfun augroup END augroup CleanWhitespace au! autocmd BufWritePre * :call StripTrailingWhitespace() function! StripTrailingWhitespace() let pos = getpos('.') %s/\s\+$//e call setpos('.', pos) endfun augroup END augroup InsertTimer au! "Autoexit to normal mode after 15 seconds of inactivity autocmd CursorHoldI * stopinsert autocmd InsertEnter * let updaterestore=&updatetime | set updatetime=15000 autocmd InsertLeave * let &updatetime=updaterestore augroup END augroup vimrc "Automatically reload VIMRC file after saving au! autocmd bufwritepost $MYVIMRC source $MYVIMRC if (exists('g:loaded_airline') && g:loaded_airline) autocmd bufwritepost $MYVIMRC AirlineRefresh endif augroup END augroup diffmode au! " Mappings for diff mode autocmd filterwritepre * if &diff | map { :diffget LOCAL| endif autocmd filterwritepre * if &diff | map \| :diffget BASE| endif autocmd filterwritepre * if &diff | map } :diffget REMOTE| endif augroup END augroup javascript "Custom mappings au! autocmd FileType javascript set ai sw=2 sts=2 et "Javascript Function lookup function! JsFunctionLookup() let l:Name = expand("") execute "/function ".l:Name endfun " autocmd FileType javascript map jj :set ft=javascript.jsx " autocmd BufRead *.js nmap f* :call JsFunctionLookup()zz " autocmd BufRead *.js,*.jsx let g:syntastic_javascript_checkers = ['eslint'] " autocmd BufWritePre *.js Neoformat let g:neoformat_javascript_prettier = { \ 'exe' : 'prettier', \ 'args': ['--stdin', '--trailing-comma=es5', '--single-quote'], \ 'stdin': 1 \ } augroup END augroup ruby au! autocmd FileType ruby,haml,eruby,yaml,html,sass,cucumber,slim set ai sw=2 sts=2 et autocmd BufRead *.rb let g:syntastic_ruby_checkers = ['rubocop', 'mri'] autocmd BufRead *.rb let g:syntastic_ruby_rubocop_exec = '/usr/bin/rubocop' augroup END augroup html au! au BufNewFile,BufRead *.ejs set filetype=html autocmd FileType html call SetHtmlOptions() function! SetHtmlOptions() if(executable('tidy')) let g:syntastic_html_tidy_ignore_errors = [ \' proprietary attribute "property"', \' proprietary attribute "prefix"', \'trimming empty ', \'trimming empty ', \'