aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2018-05-30 11:00:53 -0600
committerCody Hiar <codyfh@gmail.com>2018-05-30 11:00:53 -0600
commit0521732fedd5b091558dcd89f7351d21bcdb964e (patch)
treef3267c4079f543c480e916a9ae702c10772ef315
parent6de7a10eb06ab1de087ebd3ca594abdea841727a (diff)
Update autocommands to work on enter/leave
-rw-r--r--plugin/vim-options.vim13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugin/vim-options.vim b/plugin/vim-options.vim
index 66bd0d0..16690c2 100644
--- a/plugin/vim-options.vim
+++ b/plugin/vim-options.vim
@@ -24,10 +24,10 @@ set statusline+=%2*\« " LEFT-POINTING DOUBLE ANGLE QUOT
set statusline+=%2*\ %=\ %l/%L\ (%02p%%)\ " Rownumber/total (%)
" Set spacing of filetypes
-autocmd FileType sh,python setlocal tabstop=4
-autocmd FileType make setlocal tabstop=4 noexpandtab
-autocmd FileType ledger setlocal tabstop=2
-autocmd FileType vim setlocal tabstop=2
+au FileType sh,python setlocal tabstop=4
+au FileType make setlocal tabstop=4 noexpandtab
+au FileType ledger setlocal tabstop=2
+au FileType vim setlocal tabstop=2
" Setup colorscheme
syntax enable
@@ -42,8 +42,9 @@ highlight DiffText cterm=BOLD ctermfg=NONE ctermbg=23
" Highlight lines at 80 mark/120 mark
highlight ColorColumn ctermbg=cyan
-autocmd FileType python call matchadd('ColorColumn', '\%81v', 100)
-autocmd FileType python call matchadd('Error', '\%121v', 100)
+au BufEnter *.py let w:m1=matchadd('ColorColumn', '\%81v', 100)
+au BufEnter *.py let w:m2=matchadd('Error', '\%121v', 100)
+au BufLeave *.py call clearmatches()
" Neovim (Docker) vs Vim
if has('nvim')