aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorCamil Staps2021-06-13 09:50:28 +0200
committerCamil Staps2021-06-13 09:50:28 +0200
commitd0e5dda9683f93f311f27508fb5bd42892554391 (patch)
tree677d3baa54c3662b4568f933a113b8828a354087 /vim
parentAdd neovim config to use vimrc (diff)
Fix vimrc; redefine functions and commands in case the file is resourced
Diffstat (limited to 'vim')
-rw-r--r--vim/.vimrc8
1 files changed, 4 insertions, 4 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index ceef212..f3aed99 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -123,22 +123,22 @@ endif
map <LocalLeader>s :syn sync fromstart<CR>
-function s:enable_automatic_background()
+function! s:enable_automatic_background()
augroup bg
autocmd bg BufEnter * set bg=dark | call s:detect_terminal_line_border()
autocmd bg BufEnter *.bib,*.md,*.tex,*.txt set bg=light | call s:detect_terminal_line_border()
augroup END
endfunction
-function s:disable_automatic_background()
+function! s:disable_automatic_background()
augroup bg
autocmd! bg
augroup END
augroup! bg
endfunction
-command AutomaticBackgroundEnable call s:enable_automatic_background()
-command AutomaticBackgroundDisable call s:disable_automatic_background()
+command! AutomaticBackgroundEnable call s:enable_automatic_background()
+command! AutomaticBackgroundDisable call s:disable_automatic_background()
call s:enable_automatic_background()