From 832dfa40b7542aa7bb670c58e4943ca551e7d9db Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Wed, 31 Dec 2014 03:28:34 +0100 Subject: [PATCH] vim: Execute update_to_tw upon file save --- ftplugin/vimwiki.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 1c596b7..c82c84d 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -1,3 +1,8 @@ let s:plugin_path = escape(expand(':p:h'), '\') +execute 'pyfile ' . s:plugin_path . '/../autoload/vimwiki_pytasks.py' -exe 'pyfile ' . s:plugin_path . '/../autoload/vimwiki_pytasks.py' +augroup vimwiki_pytasks + " when saving the file sync the tasks from vimwiki to TW + autocmd! + execute "autocmd BufWrite *.".expand('%:e')." python update_to_tw()" +augroup END