Skip to content

Instantly share code, notes, and snippets.

@drkarl
Created July 21, 2017 08:03
Show Gist options
  • Save drkarl/4c503bccb62558dc85e8b1bc0f29e9cb to your computer and use it in GitHub Desktop.
Save drkarl/4c503bccb62558dc85e8b1bc0f29e9cb to your computer and use it in GitHub Desktop.

VimWiki Cheatsheet

[number] refers to the wiki number, set by the order in your vimrc. The default is 1.

Wiki Management

  • [number] <leader> ww - open wiki index file
  • [number] <leader> wt - open wiki index file in new tab
  • <leader> ws - list and select available wikis
  • <leader> wd - delete wiki page
  • <leader> wr - rename wiki page

Diary management

  • [number] <leader> wi - open diary index file for wiki
  • <leader> w <leader> i - update current diary index
  • [number] <leader> w <leader> w - open today’s diary file for wiki
  • [number] <leader> w <leader> t - open today’s diary file for wiki in new tab
  • <C-Up> - open previous day’s diary
  • <C-Down> - open next day’s diary

Navigation

  • <CR> - follow/create wiki link
  • <C-S-CR> - follow/create wiki link in new tab
  • <backspace> - go back to previous wiki page
  • <Tab> - go to next link on current page
  • <S-Tab> - go to previous link on current page

Editing shortcuts

  • <C-Space> - toggle list item on/off
  • = - add header level
  • - - remove header level
  • + - create/decorate links
  • glm - increase indent of list item
  • gll - decrease indent of list item
  • gl* or gl8 - switch or insert “*” symbol
  • gl# or gl3 - switch or insert “#” symbol
  • gl- - switch or insert “-“ symbol
  • gl1 - switch or insert “1.” symbol

Table shortcuts

  • <A-Left> move column left
  • <A-right> move column right
  • <CR> (insert mode) go down/create cell
  • <Tab> (insert mode) go next/create cell
  • gqq or gww reformat table

Text objects

ah section between 2 headings including empty trailing lines ih section between 2 headings excluding empty trailing lines a\ table cell i\ inner table cell ac table column ic inner table column

@thepenguinthatwants
Copy link

how to remap it so it only affects vimwiki files?

@PasiBergman
Copy link

PasiBergman commented Mar 28, 2021

how to remap it so it only affects vimwiki files?

For example. Map <leader>wx to toggle list item checked/unchecked on VimWiki filetype buffers
autocmd FileType vimwiki nnoremap <buffer> <Leader>wx :VimwikiToggleListItem<CR>

@pankajrlal
Copy link

How do I make the top row of a table as header row which gets slightly different formatting when html is generated. Basically be able to add the separator line between the header row and the rest of the table rows

@qadzek
Copy link

qadzek commented Jul 8, 2023

how to remap it so it only affects vimwiki files?

You can do it this way:

augroup vimwiki_mapping
  autocmd!
  autocmd FileType vimwiki nnoremap zM zM \| :set foldlevel=1<CR>
augroup END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment