Skip to content

Commit

Permalink
Add support for NeoVim
Browse files Browse the repository at this point in the history
I'm not really a vimscript hacker yet, but I pulled these changes from droptheplot/abcgo#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
  • Loading branch information
Chickensoupwithrice authored Oct 13, 2020
1 parent 57eba6d commit 1b33cd1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions after/ftplugin/vimwiki.vim
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,25 @@ 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

" push changes
" 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
Expand Down

0 comments on commit 1b33cd1

Please sign in to comment.