From ac53dbd4ef3836e69d5ff425e228960ca4adf7c3 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 17 Jun 2020 18:41:07 +0200 Subject: vim: lazy-load vimwiki plugin, add aucmds when opening wiki page --- .vim/init.vim | 9 +++++++-- .vim/plug.vim | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to '.vim') 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 au FileType gitmessengerpopup nmap (git-messenger-close) au FileType vista nmap :wincmd p - au FileType help,qf,vista nmap q - au FileType vimwik if filereadable(expand('%')) | read !zet new | endif + au FileType help,qf,vista nmap q + + au FileType vimwiki + \ if filereadable(expand('%')) && line('$') == 1 && getline(1) == '' + \ | read !zet new + \ | endif + au FileType vimwiki Vista!! augroup END " augroup AutoSaveFolds diff --git a/.vim/plug.vim b/.vim/plug.vim index 49a655f..5578cc3 100644 --- a/.vim/plug.vim +++ b/.vim/plug.vim @@ -26,7 +26,7 @@ call plug#begin('~/.vim/plugged') Plug 'SirVer/ultisnips' \| Plug 'honza/vim-snippets' - Plug 'vimwiki/vimwiki' + Plug 'vimwiki/vimwiki', { 'for': ['vimwiki'], 'on': 'VimwikiIndex' } " search " Plug 'junegunn/fzf', -- cgit 1.4.1