diary: use :drop for :VimwikiMakeDiaryNote
I find this is one of the more common reasons I wind up with way too many copies of the same file open. This adds 2 new magic numbers to vimwiki#diary#make_note()'s second parameter: 4 for `tab drop` and 5 for `drop`. It also checks to make sure :drop exists in the current build.
This commit is contained in:
committed by
Brennen Bearnes
parent
8e4202847f
commit
7cfc3eee22
@@ -307,6 +307,13 @@ function! vimwiki#diary#make_note(wnum, ...) abort
|
|||||||
let cmd = 'split'
|
let cmd = 'split'
|
||||||
elseif a:1 == 3
|
elseif a:1 == 3
|
||||||
let cmd = 'vsplit'
|
let cmd = 'vsplit'
|
||||||
|
elseif a:1 == 4
|
||||||
|
let cmd = 'tab drop'
|
||||||
|
elseif a:1 == 5
|
||||||
|
let cmd = 'drop'
|
||||||
|
if exists(':drop')
|
||||||
|
let cmd = 'drop'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if a:0>1
|
if a:0>1
|
||||||
|
|||||||
+2
-2
@@ -362,7 +362,7 @@ command! -count=0 VimwikiDiaryIndex
|
|||||||
\ call vimwiki#diary#goto_diary_index(<count>)
|
\ call vimwiki#diary#goto_diary_index(<count>)
|
||||||
|
|
||||||
command! -count=0 VimwikiMakeDiaryNote
|
command! -count=0 VimwikiMakeDiaryNote
|
||||||
\ call vimwiki#diary#make_note(<count>)
|
\ call vimwiki#diary#make_note(<count>, 5)
|
||||||
|
|
||||||
command! -count=0 VimwikiTabMakeDiaryNote
|
command! -count=0 VimwikiTabMakeDiaryNote
|
||||||
\ call vimwiki#diary#make_note(<count>, 1)
|
\ call vimwiki#diary#make_note(<count>, 1)
|
||||||
@@ -397,7 +397,7 @@ nnoremap <silent><script> <Plug>VimwikiDiaryIndex
|
|||||||
nnoremap <silent><script> <Plug>VimwikiDiaryGenerateLinks
|
nnoremap <silent><script> <Plug>VimwikiDiaryGenerateLinks
|
||||||
\ :VimwikiDiaryGenerateLinks<CR>
|
\ :VimwikiDiaryGenerateLinks<CR>
|
||||||
nnoremap <silent><script> <Plug>VimwikiMakeDiaryNote
|
nnoremap <silent><script> <Plug>VimwikiMakeDiaryNote
|
||||||
\ :<C-U>call vimwiki#diary#make_note(v:count)<CR>
|
\ :<C-U>call vimwiki#diary#make_note(v:count, 5)<CR>
|
||||||
nnoremap <silent><script> <Plug>VimwikiTabMakeDiaryNote
|
nnoremap <silent><script> <Plug>VimwikiTabMakeDiaryNote
|
||||||
\ :<C-U>call vimwiki#diary#make_note(v:count, 1)<CR>
|
\ :<C-U>call vimwiki#diary#make_note(v:count, 1)<CR>
|
||||||
nnoremap <silent><script> <Plug>VimwikiMakeYesterdayDiaryNote
|
nnoremap <silent><script> <Plug>VimwikiMakeYesterdayDiaryNote
|
||||||
|
|||||||
Reference in New Issue
Block a user