diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0ac43bf..ff870e7 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -419,7 +419,7 @@ endfunction function! vimwiki#base#goto(...) - let key = a:1 + let key = a:0 > 0 ? a:1 : input('Enter name: ') let anchor = a:0 > 1 ? a:2 : '' call vimwiki#base#edit_file(':e', diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 995f81a..daa82c0 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -323,6 +323,12 @@ NORMAL MODE *vimwiki-local-mappings* Maps to |:VimwikiPrevLink|. To remap: > :nmap wp VimwikiPrevLink +< + *vimwiki_wn* +wn Goto or create new wiki page. + Maps to |:VimwikiGoto|. + To remap: > + :nmap nn VimwikiGoto < *vimwiki_wd* wd Delete wiki page you are in. @@ -770,7 +776,8 @@ Vimwiki file. :VimwikiGoto HelloWorld < opens/creates HelloWorld wiki page. - Supports |cmdline-completion| for link name. + Supports |cmdline-completion| for link name. If name is not specified, a + prompt will be shown. *:VimwikiDeleteLink* Delete the wiki page you are in. @@ -3418,6 +3425,7 @@ https://github.com/vimwiki-backup/vimwiki/issues. 2.5 (in progress)~ New:~ + * PR #673: Add :VimwikiGoto key mapping. * PR #689: Allow |vimwiki-option-diary_rel_path| to be an empty string. * PR #683: Improve layout and format of key binding documentation in README and include note about key bindings that may not work. diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index d7f456f..a450a63 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -264,7 +264,7 @@ exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep '. exe 'command! -buffer -nargs=* VWS lvimgrep '. \ escape(vimwiki#vars#get_wikilocal('path').'**/*'.vimwiki#vars#get_wikilocal('ext'), ' ') -command! -buffer -nargs=+ -complete=custom,vimwiki#base#complete_links_escaped +command! -buffer -nargs=* -complete=custom,vimwiki#base#complete_links_escaped \ VimwikiGoto call vimwiki#base#goto() command! -buffer VimwikiCheckLinks call vimwiki#base#check_links() @@ -358,6 +358,8 @@ nnoremap