From 1b33cd105d089e6e503d32f800cab0dab654ca83 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 13 Oct 2020 20:33:47 +1000 Subject: [PATCH] Add support for NeoVim I'm not really a vimscript hacker yet, but I pulled these changes from https://github.com/droptheplot/abcgo/issues/1 Was running into issues opening up my vimwiki on nvim with your plugin installed. Haven't tested extensively, but it seems to do the job --- after/ftplugin/vimwiki.vim | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/after/ftplugin/vimwiki.vim b/after/ftplugin/vimwiki.vim index 4f0bcbe..013963d 100644 --- a/after/ftplugin/vimwiki.vim +++ b/after/ftplugin/vimwiki.vim @@ -36,8 +36,12 @@ augroup vimwiki function! s:pull_changes() if g:zettel_synced==0 let g:zettel_synced = 1 - let gitjob = job_start("git -C " . g:zettel_dir . " pull origin master", {"exit_cb": "My_exit_cb", "close_cb": "My_close_cb"}) - let taskjob = job_start("task sync") + if has("nvim") + let gitjob = jobstart("git -C " . g:zettel_dir . " pull origin master", {"exit_cb": "My_exit_cb", "close_cb": "My_close_cb"}) + let taskjob = jobstart("task sync") + else + let gitjob = job_start("git -C " . g:zettel_dir . " pull origin master", {"exit_cb": "My_exit_cb", "close_cb": "My_close_cb"}) + let taskjob = job_start("task sync") endif endfunction @@ -45,8 +49,12 @@ augroup vimwiki " it seems that Vim terminates before it is executed, so it needs to be " fixed function! s:push_changes() - let gitjob = job_start("git -C " . g:zettel_dir . " push origin master") - let taskjob = job_start("task sync") + if has("nvim") + let gitjob = jobstart("git -C " . g:zettel_dir . " push origin master") + let taskjob = jobstart("task sync") + else + let gitjob = job_start("git -C " . g:zettel_dir . " push origin master") + let taskjob = job_start("task sync") endfunction " sync changes at the start