From 86926b721210426a2a782982e847e7749746a99b Mon Sep 17 00:00:00 2001 From: Rane Brown Date: Mon, 15 Jul 2019 08:11:43 -0600 Subject: [PATCH] Update documentation for local key mappings. Original updates from PR #704. --- doc/vimwiki.txt | 539 +++++++++++++++++++++++------------------------- 1 file changed, 257 insertions(+), 282 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 9fbe562..4ccc4cf 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -275,339 +275,316 @@ See also |:VimwikiMakeYesterdayDiaryNote| See also |:VimwikiMakeTomorrowDiaryNote| ------------------------------------------------------------------------------ -3.2. Local mappings +3.2. Local mappings *vimwiki-local-mappings* -To remap one of these keys, either put it in your .vimrc like this > - :nmap wc Vimwiki2HTML -or, the better way, put it in a file .vim/ftplugin/vimwiki.vim like this > - :nmap wc Vimwiki2HTML +Below is a listing of all local key mappings provided by Vimwiki. As local +settings, they are available when |FileType| is set to "vimwiki". These +mappings may overwrite pre-existing mappings but they can be remapped or +disabled (see |g:vimwiki_key_mappings|). -The latter has the advantage that the mapping is local to Vimwiki buffers in -every case. +To remap commands that begin with , you should do the following: -Also note that some keys work in normal mode as well as in visual mode. If you -remap them using :map, they will also run in operator-pending mode. If you -don't want that, use > - :nmap tt VimwikiToggleListItem - :vmap tt VimwikiToggleListItem + :{mode}map {map} {command} -NOTE: if a user mapping or mapping from another plugin uses the same key -sequence as one of the following mappings then Vimwiki will not overwrite it. +For commands that do not begin with , do: + :{mode}noremap {map} {command} -NORMAL MODE *vimwiki-local-mappings* - *vimwiki_wh* -wh Convert current wiki page to HTML. +where + `{mode}` is set to `n` for "normal" mode, `v` for "visual", and `i` for "insert" + `{map}` is the new key sequence of your choosing + `{command}` is the Vimwiki command you are remapping + +Examples: > + :nmap tl VimwikiToggleListItem + :vmap tl VimwikiToggleListItem + :nnoremap glo :VimwikiChangeSymbolTo a) + +The first two lines remap "\tl" to the |:VimwikiToggleListItem| command in both +normal and visual modes. || is set to "\" by default. Use `:echo mapleader` +to determine if it is set to another value. The third map listed +above, which does not contain , maps directly to an |Ex| mode command. + +Note that |map| is needed for commands beginning with . This recursive +version of the "map" command is needed to expand the right hand side to retrieve +the definition. "noremap" will not work. is required and +considered to be part of the command. + +It is recommended that you place your local mappings into a file at +ftplugin/vimwiki.vim within your .vim configuration directory. Create this file +if it doesn't already exist. Or, if you prefer, you can set up a FileType +|autocmd| in your vimrc. + +Note: it may be desirable to add ` ` to mapped commands but +this should only be done if the mappings are placed in ftplugin or in +a Filetype based autocommand. See the Vim help for a description of these +options. + +MAP MODE + *vimwiki_wh* +wh n Convert current wiki page to HTML. Maps to |:Vimwiki2HTML| - To remap: > - :nmap wc Vimwiki2HTML -< - *vimwiki_whh* -whh Convert current wiki page to HTML and open it in the + Remap command: `Vimwiki2HTML` + + *vimwiki_whh* +whh n Convert current wiki page to HTML and open it in the webbrowser. Maps to |:Vimwiki2HTMLBrowse| - To remap: > - :nmap wcc Vimwiki2HTMLBrowse -< - *vimwiki_wi* -wi Update diary section (delete old, insert new) + Remap command: `Vimwiki2HTMLBrowse` + + *vimwiki_wi* +wi n Update diary section (delete old, insert new) Only works from the diary index. Maps to |:VimwikiDiaryGenerateLinks| - To remap: > - :nmap wcr VimwikiDiaryGenerateLinks -< - *vimwiki_* - Follow/create wiki link (create target wiki page if + Remap command: `VimwikiDiaryGenerateLinks` + + *vimwiki_* + n Follow/create wiki link (create target wiki page if needed). Maps to |:VimwikiFollowLink|. - To remap: > - :nmap wf VimwikiFollowLink -< - *vimwiki_* - Split and follow (create target wiki page if needed). + Remap command: `VimwikiFollowLink` + + *vimwiki_* + n Split and follow (create target wiki page if needed). May not work in some terminals. Remapping could help. Maps to |:VimwikiSplitLink|. - To remap: > - :nmap we VimwikiSplitLink -< - *vimwiki_* - Vertical split and follow (create target wiki page if - needed). - May not work in some terminals. Remapping could help. + Remap command: `VimwikiSplitLink` + + *vimwiki_* + n Vertical split and follow (create target wiki page if + needed). May not work in some terminals. Remapping + could help. Maps to |:VimwikiVSplitLink|. - To remap: > - :nmap wq VimwikiVSplitLink -< - *vimwiki_* *vimwiki_* -, Follow wiki link (create target wiki page if needed), + Remap command: `VimwikiVSplitLink` + + *vimwiki_* *vimwiki_* +, n Follow wiki link (create target wiki page if needed), opening in a new tab. May not work in some terminals. Remapping could help. Maps to |:VimwikiTabnewLink|. - To remap: > - :nmap wt VimwikiTabnewLink -< - *vimwiki_* - Go back to previously visited wiki page. + Remap command: `VimwikiTabnewLink` + + *vimwiki_* + n Go back to previously visited wiki page. Maps to |:VimwikiGoBackLink|. - To remap: > - :nmap wb VimwikiGoBackLink -< - *vimwiki_* - Find next link in the current page. + Remap command: `VimwikiGoBackLink` + + *vimwiki_* + n Find next link in the current page. Maps to |:VimwikiNextLink|. - To remap: > - :nmap wn VimwikiNextLink -< - *vimwiki_* - Find previous link in the current page. + Remap command: `VimwikiNextLink` + + *vimwiki_* + n Find previous link in the current page. Maps to |:VimwikiPrevLink|. - To remap: > - :nmap wp VimwikiPrevLink -< - *vimwiki_wn* -wn Goto or create new wiki page. + Remap command: `VimwikiPrevLink` + + *vimwiki_wn* +wn n Goto or create new wiki page. Maps to |:VimwikiGoto|. - To remap: > - :nmap nn VimwikiGoto -< - *vimwiki_wd* -wd Delete wiki page you are in. + Remap command: `VimwikiGoto` + + *vimwiki_wd* +wd n Delete wiki page you are in. Maps to |:VimwikiDeleteLink|. - To remap: > - :nmap dd VimwikiDeleteLink -< - *vimwiki_wr* -wr Rename wiki page you are in. + Remap command: `VimwikiDeleteLink` + + *vimwiki_wr* +wr n Rename wiki page you are in. Maps to |:VimwikiRenameLink|. - To remap: > - :nmap rr VimwikiRenameLink -< - *vimwiki_=* -= Add header level. Create if needed. + Remap command: `VimwikiRenameLink` + + *vimwiki_=* += n Add header level. Create if needed. There is nothing to indent with '==' command in Vimwiki, so it should be ok to use '=' here. - To remap: > - :nmap == VimwikiAddHeaderLevel -< - *vimwiki_-* -- Remove header level. - To remap: > - :nmap -- VimwikiRemoveHeaderLevel -< - *vimwiki_[[* -[[ Go to the previous header in the buffer. - To remap: > - :nmap <- VimwikiGoToPrevHeader -< - *vimwiki_]]* -]] Go to the next header in the buffer. - To remap: > - :nmap -> VimwikiGoToNextHeader -< - *vimwiki_[=* -[= Go to the previous header which has the same level as + Remap command: `VimwikiAddHeaderLevel` + + *vimwiki_-* +- n Remove header level. + Remap command: `VimwikiRemoveHeaderLevel` + + *vimwiki_[[* +[[ n Go to the previous header in the buffer. + Remap command: `VimwikiGoToPrevHeader` + + *vimwiki_]]* +]] n Go to the next header in the buffer. + Remap command: `VimwikiGoToNextHeader` + + *vimwiki_[=* +[= n Go to the previous header which has the same level as the header the cursor is currently under. - To remap: > - :nmap <= VimwikiGoToPrevSiblingHeader -< - *vimwiki_]=* -]= Go to the next header which has the same level as the + Remap command: `VimwikiGoToPrevSiblingHeader` + + *vimwiki_]=* +]= n Go to the next header which has the same level as the header the cursor is currently under. - To remap: > - :nmap => VimwikiGoToNextSiblingHeader -< - *vimwiki_]u* *vimwiki_[u* -]u [u Go one level up -- that is, to the parent header of + Remap command: `VimwikiGoToNextSiblingHeader` + + *vimwiki_]u* *vimwiki_[u* +]u [u n Go one level up -- that is, to the parent header of the header the cursor is currently under. - To remap: > - :nmap -^ VimwikiGoToParentHeader -< - *vimwiki_+* -+ Create and/or decorate links. Depending on the + Remap command: `VimwikiGoToParentHeader` + + *vimwiki_+* ++ n v Create and/or decorate links. Depending on the context, this command will: convert words into wikilinks; convert raw URLs into wikilinks; and add placeholder description text to wiki- or weblinks that are missing descriptions. Can be activated in normal mode with the cursor over a word or link, or in visual mode with the selected text. - To remap: > - :nmap ++ VimwikiNormalizeLink - :vmap ++ VimwikiNormalizeLinkVisual -< - *vimwiki_* - Toggle checkbox of a list item on/off. + Remap commands: + `VimwikiNormalizeLink` (normal mode) + `VimwikiNormalizeLinkVisual` (visual mode) + + *vimwiki_* + n Toggle checkbox of a list item on/off. Maps to |:VimwikiToggleListItem|. See |vimwiki-todo-lists|. - To remap: > - :map tt VimwikiToggleListItem + Remap command: `VimwikiToggleListItem` -gnt *vimwiki_gnt* - Find next unfinished task in the current page. + *vimwiki_gnt* +gnt n Find next unfinished task in the current page. Maps to |:VimwikiNextTask| - To remap: > - :nmap nt VimwikiNextTask -< - *vimwiki_gl* *vimwiki_gL* -gl Remove checkbox from list item. + Remap command: `VimwikiNextTask` + + *vimwiki_gl* *vimwiki_gL* +gl n Remove checkbox from list item. + Remap command: `VimwikiRemoveSingleCB` gL Remove checkboxes from all sibling list items. - To remap: > - :map VimwikiRemoveSingleCB - :map VimwikiRemoveCBInList -< - *vimwiki_gln* *vimwiki_glp* -gln Increase the "done" status of a list checkbox, i.e. + Remap command: `VimwikiRemoveCBInList` + + *vimwiki_gln* *vimwiki_glp* +gln n v Increase the "done" status of a list checkbox, i.e. from [ ] to [.] to [o] etc. See |vimwiki-todo-lists|. glp Decrease the "done" status. - To remap: > - :nmap VimwikiIncrementListItem - :vmap VimwikiIncrementListItem - :nmap VimwikiDecrementListItem - :vmap VimwikiDecrementListItem + Remap command: `VimwikiIncrementListItem` - *vimwiki_gll* *vimwiki_gLl* -gll Increase the level of a list item. + *vimwiki_gll* *vimwiki_gLl* +gll n Increase the level of a list item. + Remap commnad: `VimwikiIncreaseLvlSingleItem` gLl Increase the level of a list item and all child items. - To remap: > - :map >> VimwikiIncreaseLvlSingleItem - :map >>> VimwikiIncreaseLvlWholeItem -< - *vimwiki_glh* *vimwiki_gLh* -glh Decrease the level of a list item. + Remap command: `VimwikiIncreaseLvlWholeItem` + + *vimwiki_glh* *vimwiki_gLh* +glh n Decrease the level of a list item. + Remap command: `VimwikiDecreaseLvlSingleItem` gLh Decrease the level of a list item and all child items. - To remap: > - :map << VimwikiDecreaseLvlSingleItem - :map <<< VimwikiDecreaseLvlWholeItem -< - *vimwiki_glr* *vimwiki_gLr* -glr Renumber list items if the cursor is on a numbered + Remap command: `VimwikiDecreaseLvlWholeItem` + + *vimwiki_glr* *vimwiki_gLr* +glr n Renumber list items if the cursor is on a numbered list item. + Remap command: `VimwikiRenumberList` gLr Renumber list items in all numbered lists in the whole - file. - Also readjust checkboxes. - To remap: > - :nmap VimwikiRenumberList - :nmap VimwikiRenumberAllLists -< - *vimwiki_glstar* *vimwiki_gLstar* -gl* Make a list item out of a normal line or change the + file. Also readjust checkboxes. + Remap command: `VimwikiRenumberAllLists` + + *vimwiki_glstar* *vimwiki_gLstar* +gl* n Make a list item out of a normal line or change the symbol of the current item to *. gL* Change the symbol of the current list to *. - To remap: > - noremap glo :VimwikiChangeSymbolTo * + Remap command: `:VimwikiChangeSymbolTo *` noremap glO :VimwikiChangeSymbolInListTo * -< - *vimwiki_gl#* *vimwiki_gL#* -gl# Make a list item out of a normal line or change the + + *vimwiki_gl#* *vimwiki_gL#* +gl# n Make a list item out of a normal line or change the symbol of the current item to #. gL# Change the symbol of the current list to #. - To remap: > - noremap glo :VimwikiChangeSymbolTo # - noremap glO :VimwikiChangeSymbolInListTo # -< - *vimwiki_gl-* *vimwiki_gL-* -gl- Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolTo #` + Remap command: `:VimwikiChangeSymbolInListTo #` + + *vimwiki_gl-* *vimwiki_gL-* +gl- n Make a list item out of a normal line or change the symbol of the current item to -. + Remap command: `:VimwikiChangeSymbolTo -` gL- Change the symbol of the current list to -. - To remap: > - noremap glo :VimwikiChangeSymbolTo - - noremap glO :VimwikiChangeSymbolInListTo - -< - *vimwiki_gl1* *vimwiki_gL1* -gl1 Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolInListTo -` + + *vimwiki_gl1* *vimwiki_gL1* +gl1 n Make a list item out of a normal line or change the symbol of the current item to 1., the numbering is adjusted according to the surrounding list items. + Remap command: `:VimwikiChangeSymbolTo 1.` gL1 Change the symbol of the current list to 1. 2. 3. ... - To remap: > - noremap glo :VimwikiChangeSymbolTo 1. - noremap glO :VimwikiChangeSymbolInListTo 1. -< - *vimwiki_gla* *vimwiki_gLa* -gla Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolInListTo 1.` + + *vimwiki_gla* *vimwiki_gLa* +gla n Make a list item out of a normal line or change the symbol of the current item to a), the numbering is adjusted according to the surrounding list items. + Remap command: `:VimwikiChangeSymbolTo a)` gLa Change the symbol of the current list to a) b) c) ... - To remap: > - noremap glo :VimwikiChangeSymbolTo a) - noremap glO :VimwikiChangeSymbolInListTo a) -< - *vimwiki_glA* *vimwiki_gLA* -glA Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolInListTo a)` + + *vimwiki_glA* *vimwiki_gLA* +glA n Make a list item out of a normal line or change the symbol of the current item to A), the numbering is adjusted according to the surrounding list items. + Remap command: `:VimwikiChangeSymbolTo A)` gLA Change the symbol of the current list to A) B) C) ... - To remap: > - noremap glo :VimwikiChangeSymbolTo A) - noremap glO :VimwikiChangeSymbolInListTo A) -< - *vimwiki_gli* *vimwiki_gLi* -gli Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolInListTo A)` + + *vimwiki_gli* *vimwiki_gLi* +gli n Make a list item out of a normal line or change the symbol of the current item to i), the numbering is adjusted according to the surrounding list items. + Remap command: `:VimwikiChangeSymbolTo i)` gLi Change the symbol of the current list to i) ii) iii) ... - To remap: > - noremap glo :VimwikiChangeSymbolTo i) - noremap glO :VimwikiChangeSymbolInListTo i) -< - *vimwiki_glI* *vimwiki_gLI* -glI Make a list item out of a normal line or change the + Remap command: `:VimwikiChangeSymbolInListTo i)` + + *vimwiki_glI* *vimwiki_gLI* +glI n Make a list item out of a normal line or change the symbol of the current item to I), the numbering is adjusted according to the surrounding list items. + Remap command: `:VimwikiChangeSymbolTo I)` gLI Change the symbol of the current list to I) II) III) ... - To remap: > - noremap glo :VimwikiChangeSymbolTo I) - noremap glO :VimwikiChangeSymbolInListTo I) -< - *vimwiki_glx* -glx Toggle checkbox of a list item disabled/off. + Remap command: `:VimwikiChangeSymbolInListTo I)` + + *vimwiki_glx* +glx n Toggle checkbox of a list item disabled/off. Maps to |:VimwikiToggleRejectedListItem|. See |vimwiki-todo-lists|. - To remap: > - :map tx VimwikiToggleRejectedListItem -< - *vimwiki_gqq* *vimwiki_gww* -gqq Format table. If you made some changes to a table - or without swapping insert/normal modes this command -gww will reformat it. - To remap: > - :nmap gq VimwikiTableAlignQ - :nmap gw VimwikiTableAlignW -< - *vimwiki_gq1* *vimwiki_gw1* -gq1 Fast format table. The same as the previous, except + Remap command: `VimwikiToggleRejectedListItem` + + *vimwiki_gqq* *vimwiki_gww* +gqq n Reformats table after making changes. + or Remap command: `VimwikiTableAlignQ` +gww Remap command: `VimwikiTableAlignW` + + *vimwiki_gq1* *vimwiki_gw1* +gq1 n Fast format table. The same as the previous, except or that only a few lines above the current line are -gw1 tested. If the alignment of the current line differs, + tested. If the alignment of the current line differs, then the whole table gets reformatted. - To remap: > - :nmap q1 VimwikiTableAlignQ1 - :nmap w1 VimwikiTableAlignW1 -< - *vimwiki_* - Move current table column to the left. + Remap command: `VimwikiTableAlignQ1` +gw1 Remap command:`VimwikiTableAlignW1` + + *vimwiki_* + n Move current table column to the left. See |:VimwikiTableMoveColumnLeft| - To remap: > - :nmap wtl VimwikiTableMoveColumnLeft -< - *vimwiki_* - Move current table column to the right. + Remap command: `VimwikiTableMoveColumnLeft` + + *vimwiki_* + n Move current table column to the right. See |:VimwikiTableMoveColumnRight| - To remap: > - :nmap wtr VimwikiTableMoveColumnRight -< - *vimwiki_* - Open the previous day's diary link if available. + Remap command: `VimwikiTableMoveColumnRight` + + *vimwiki_* + n Open the previous day's diary link if available. See |:VimwikiDiaryPrevDay| - To remap: > - :nmap k VimwikiDiaryPrevDay -< - *vimwiki_* - Open the next day's diary link if available. + Remap command: `VimwikiDiaryPrevDay` + + *vimwiki_* + n Open the next day's diary link if available. See |:VimwikiDiaryNextDay| - To remap: > - :nmap j VimwikiDiaryNextDay -< -Mouse mappings *vimwiki_mouse* + Remap command: `VimwikiDiaryNextDay` + +Mouse mappings *vimwiki_mouse* These mappings are disabled by default. See |g:vimwiki_key_mappings| to enable. @@ -626,57 +603,55 @@ Note: <2-LeftMouse> is just left double click. -INSERT MODE *vimwiki-table-mappings* - *vimwiki_i__table* +TABLE MAPPINGS, INSERT MODE *vimwiki-table-mappings* + *vimwiki_i__table* Go to the table cell beneath the current one, create a new row if on the last one. - *vimwiki_i__table* + *vimwiki_i__table* Go to the next table cell, create a new row if on the last cell. -INSERT MODE *vimwiki-list-mappings* - *vimwiki_i_* +LIST MAPPINGS, INSERT MODE *vimwiki-list-mappings* + *vimwiki_i_* In a list item, insert a new bullet or number in the next line, numbers are incremented. In an empty list item, delete the item symbol. This is useful to end a list, simply press twice. See |vimwiki-lists| for details and for how to configure the behavior. + Remap command: `VimwikiReturn15` - *vimwiki_i_* + *vimwiki_i_* Does not insert a new list item, useful to create - multilined list items. - See |vimwiki-lists| for details and for how to - configure the behavior. + multilined list items. See |vimwiki-lists| for + details and for how to configure the behavior. The + default map may not work in all terminals and may + need to be remapped. + Remap command: `VimwikiReturn22` - *vimwiki_i_* + *vimwiki_i_* Increase the level of a list item. - To remap: > - :imap VimwikiIncreaseLvlSingleItem -< - *vimwiki_i_* + Remap command: `VimwikiIncreaseLvlSingleItem` + + *vimwiki_i_* Decrease the level of a list item. - To remap: > - :imap VimwikiDecreaseLvlSingleItem -< - *vimwiki_i__* + Remap command: `VimwikiDecreaseLvlSingleItem` + + *vimwiki_i__* Change the symbol of the current list item to the next available. From - to 1. to * to I) to a). - To remap: > - :imap VimwikiListNextSymbol -< - *vimwiki_i__* + Remap command: `VimwikiListNextSymbol` + + *vimwiki_i__* Change the symbol of the current list item to the prev available. From - to a) to I) to * to 1. - To remap: > - :imap VimwikiListPrevSymbol -< - *vimwiki_i__* + Remap command: `VimwikiListPrevSymbol` + + *vimwiki_i__* Create/remove a symbol from a list item. - To remap: > - :imap VimwikiListToggle -< + Remap command: `VimwikiListToggle` + ------------------------------------------------------------------------------ 3.3. Text objects *vimwiki-text-objects*