Add :VimwikiMakeYesterdayDiaryNote command

Opens diary for yesterday.
For when you stay up past midnight.
This commit is contained in:
Tomsod M 2015-10-29 01:00:00 +03:00
parent 2afff4c411
commit 64f71bc785
No known key found for this signature in database
GPG Key ID: BA139ADE2272AEA7
2 changed files with 29 additions and 0 deletions

View File

@ -198,6 +198,24 @@ See also |:VimwikiMakeDiaryNote|
See also |:VimwikiTabMakeDiaryNote|
[count]<Leader>w<Leader>y or <Plug>VimwikiMakeYesterdayDiaryNote
Open diary wiki-file for yesterday of the [count]'s wiki.
<Leader>w<Leader>y opens diary wiki-file for yesterday in the first
wiki from |g:vimwiki_list|.
1<Leader>w<Leader>y as above opens diary wiki-file for yesterday in
the first wiki from |g:vimwiki_list|.
2<Leader>w<Leader>y opens diary wiki-file for yesterday in the second
wiki from |g:vimwiki_list|.
3<Leader>w<Leader>y opens diary wiki-file for yesterday in the third
wiki from |g:vimwiki_list|.
etc.
To remap: >
:nmap <Leader>dy <Plug>VimwikiMakeYesterdayDiaryNote
<
See also |:VimwikiMakeYesterdayDiaryNote|
------------------------------------------------------------------------------
3.2. Local mappings
@ -567,6 +585,9 @@ il A single list item.
*:VimwikiTabMakeDiaryNote*
Open diary wiki-file for today of the current wiki in a new tab.
*:VimwikiMakeYesterdayDiaryNote*
Open diary wiki-file for yesterday of the current wiki.
------------------------------------------------------------------------------
4.2. Local commands *vimwiki-local-commands*

View File

@ -523,6 +523,8 @@ command! -count=1 VimwikiMakeDiaryNote
\ call vimwiki#diary#make_note(v:count1)
command! -count=1 VimwikiTabMakeDiaryNote
\ call vimwiki#diary#make_note(v:count1, 1)
command! -count=1 VimwikiMakeYesterdayDiaryNote
\ call vimwiki#diary#make_note(v:count1, 0, strftime(VimwikiGet('diary_link_fmt', v:count1 - 1), localtime() - 60*60*24))
command! VimwikiDiaryGenerateLinks
\ call vimwiki#diary#generate_diary_section()
@ -565,6 +567,12 @@ endif
nnoremap <unique><script> <Plug>VimwikiTabMakeDiaryNote
\ :VimwikiTabMakeDiaryNote<CR>
if !hasmapto('<Plug>VimwikiMakeYesterdayDiaryNote')
exe 'nmap <silent><unique> '.g:vimwiki_map_prefix.'<Leader>y <Plug>VimwikiMakeYesterdayDiaryNote'
endif
nnoremap <unique><script> <Plug>VimwikiMakeYesterdayDiaryNote
\ :VimwikiMakeYesterdayDiaryNote<CR>
"}}}
" MENU {{{