- Home page vimwiki plugin page
- GitHub page: vimwiki/vimwiki: Personal Wiki for Vim
- vimwiki issue queue: Issues · vimwiki/vimwiki
What is it?
vimwiki is a vim plugin that helps you write a wiki, which is just a collection of hyperlinked documents.
What makes it so good?
I’m still learning the ropes but the short answer is:
- Double tap
<enter>
on word or highlighted group of words to open and edit a new wike page. - Type into your new document
- Hit
<backspace>
to return to your original document - Easily navigate between your wiki pages
- Easily maintain a diary. See keeping a diary
- Absolutely fantastic for generating content as an outline which is far faster and easier to write than prose.
Random tech notes
- vimwiki is running out of my
~/git_repos
directory using thecustomizations
branch
Searching and navigating a vimwiki quickly
- use CtrlP plugin to jump to files
- Searching the wiki:
- use
:VWS /term/
- use
:lopen
to see results
- use
- use
Diary navigation
<C-Up_Arrow>
- Open the previous day’s diary link if available.
<C-Down_Arrow>
- Open the next day’s diary link if available.
Other Tips, Tricks and Advice
If used in conjunctions with a Jekyll site
- Be sure to use markdown as the syntax for best integration with Jekyll site generation
- Do not place diary in subdirectory (this is the default)
- Instead, ensure entries are created in same folder as wiki so that documents
in diary can link to wiki documents not in the diary
- Accomplished by modifying
g:vimwiki_list
:let wiki_1.diary_rel_path = '.'
- Accomplished by modifying
- Instead, ensure entries are created in same folder as wiki so that documents
in diary can link to wiki documents not in the diary
- use fzf and ripgrep to search vimwiki
- see maps section below
Shell integration
Useful aliases
Launch default wiki pages from command line:
# launch diary from command line:
alias diary='vim -c ":VimwikiMakeDiaryNote"'
## launch index page from command line
alias vw='vim -c ":VimwikiIndex"'
Musings on the usefulness of vim and vimwiki
Maps
- Insert link to another wiki page:
- type in first couple of letters and then:
inoremap <buffer> <leader>xo <C-o>"cciW[](<C-r>c)<left><c-x><c-o>
- Then to actually select a file:
inoremap <buffer> <c-y><c-y> <c-y><esc><esc>T(vt)y<esc>F[pf)a <left>
- type in first couple of letters and then:
- Rewrite
<cr>
toVimwiki 3, 5
per help file- Needed if you are using hard wraps
- This will create a bullet on the next line after hitting return if there is more than one line in the bullet
- faster indenting
<c-d>
and<c-t>
outdent and indent- too cumbersome to type
- remap
<<
to outdent -
remap
>>
to indent" faster in/outdenting inoremap << <c-d> inoremap >> <c-t> "outdent all the way to margin inoremap <leader>,, <esc>0dt*$a nnoremap <leader>,, 0dt*$ " needed for vimwiki plugin with hard wrapping inoremap <cr> <esc>:VimwikiReturn 3, 5<cr> " in/outdent next bullet imap <c-i><cr> <cr><c-t> imap <c-i><c-i><cr> <cr><c-d>
- remap
- too cumbersome to type
- search file names, buffers and file text quickly with fzf/fzf vim plugin
nnoremap <leader>f :up<cr>:Files<cr> nnoremap <leader>r :up<cr>:Rg<cr> nnoremap <leader>b :up<cr>:Buffers<cr>
- see How FZF and ripgrep improved my workflow | by Sidney Liebrand | Medium for more details
<tab>
key should be remapped- by default vimwiki maps
<tab>
toVimwikiNextLink
- Since
<tab>
and<c-i>
are the same as a result of some terminal quirk, you are also overriding the default behavior of<c-i>
- default behavior is to go forward in jump list
- Since
- I use:
nmap <leader>n <Plug>VimwikiNextLink
- by default vimwiki maps
- Create link and new vimwiki page with same title as bullet:
inoremap <leader>lb <esc>^wy$i[<esc>$a](/<esc>pa)<esc>:VimwikiFollowLink<cr>i# <esc>p:w<cr>a<cr><cr>
Resources
- https://mkaz.blog
- Getting started guide
broken link as of 7/16/2020 -
- guy in video keeps syaing to use mod-v
- actual combo by default:
-
ww - consult documentation for how to quickly open other wikis
- :h vimwiki-global-mappings
-
- actual combo by default:
- guy in video keeps syaing to use mod-v
Bugs and Troubles
Stuff I’m having problems with
Other notes linking here:
View the edit history