summary refs log tree commit diff
path: root/.vim/init.vim
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2020-06-17 18:41:07 +0200
committerRobert Günzler <r@gnzler.io>2020-06-17 18:41:07 +0200
commitac53dbd4ef3836e69d5ff425e228960ca4adf7c3 (patch)
tree467ce16fe6fe3aa836dce300ca7319b7deb3a4b1 /.vim/init.vim
parent4e3dadd492b261593eb74008522d4961ad1f52f9 (diff)
vim: lazy-load vimwiki plugin, add aucmds when opening wiki page
Diffstat (limited to '')
-rw-r--r--.vim/init.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/.vim/init.vim b/.vim/init.vim
index 9e9171f..444f288 100644
--- a/.vim/init.vim
+++ b/.vim/init.vim
@@ -337,8 +337,13 @@ augroup SpecialBuffers
   au FileType fzf,skim tnoremap <buffer><esc> <c-c>
   au FileType gitmessengerpopup nmap <buffer><esc> <Plug>(git-messenger-close)
   au FileType vista nmap <buffer><space> :wincmd p<CR>
-  au FileType help,qf,vista nmap <buffer>q <c-w><c-q>
-  au FileType vimwik if filereadable(expand('%')) | read !zet new | endif
+  au FileType help,qf,vista nmap <silent><buffer>q <c-w><c-q>
+
+  au FileType vimwiki
+        \ if filereadable(expand('%')) && line('$') == 1 && getline(1) == ''
+	\ | read !zet new
+	\ | endif
+  au FileType vimwiki Vista!!
 augroup END
 
 " augroup AutoSaveFolds