VimWiki入门

简介

VimWiki,官方给出的解释:

    Vimwiki is a personal wiki for Vim -- a number of linked text files that have their own syntax highlighting. 

通过VimWiki,你可以:

  • organize notes and ideas
  • manage todo-lists
  • write documentation

安装

首先下载插件(下载1, 下载2),然后:

Windows: 
======== 
1. Unpack. 
2. Open vimwiki-N-N.vba with Vim. (N-N is version number ie 1-1) 
3. Source it with :so % command 

Linux: 
====== 
1. Open vimwiki-N-N.vba.gz with Vim. (N-N is version number ie 1-1) 
2. Source it with :so % command 

配置

官方建议在.vimrc中添加以下代码:

set nocompatible 
filetype plugin on 
syntax on 

然后继续做其他配置:

" vimwiki
let g:vimwiki_list = [{'path': '~/vimwiki/',
    \ 'path_html': '~/vimwiki/html/',
    \ 'template_path': '~/vimwiki/template/',
    \ 'template_default': 'template',
    \ 'template_ext': '.html'}]

let g:vimwiki_camel_case = 0

map <F4> <Plug>Vimwiki2HTML
map <S-F4> <Plug>VimwikiAll2HTML
  • path指定wiki路径
  • path_html制定生成的html路径,一些相关调用的css,js也都放在这里
  • template_path是模板的路径
  • template_default指定默认的模板名称
  • template_ext指定模板的后缀名
  • 综上,template_path/template_default.template_ext就是模板了
  • 绑定快捷键F4为把wiki页面转为html页面

使用

打开wiki

<Leader>键一般是\

<Leader>ww -- Open default wiki index file. 
<Leader>wt -- Open default wiki index file in a new tab. 
<Leader>ws -- Select and open wiki index file. 
<Leader>wd -- Delete wiki file you are in. 
<Leader>wr -- Rename wiki file you are in. 
<Enter> -- Folow/Create wiki link 
<Shift-Enter> -- Split and folow/create wiki link 
<Ctrl-Enter> -- Vertical split and folow/create wiki link 
<Backspace> -- Go back to parent(previous) wiki link 
<Tab> -- Find next wiki link 
<Shift-Tab> -- Find previous wiki link 

语法

可以:h vimwiki 或者看这个vimwiki quick reference card

参考的文章

Vim插件-VimWiki
拾墨.Wiki
Xbeta Pkm工具:Vimwiki
VimWiki,创建你自己的Wiki世界!
使用 VimWiki 进行知识管理
vimwiki中文文档

最后修改


(转自)http://www.wutianqi.com/wiki/vimwiki.html

posted @ 2012-05-16 00:36  smallest  阅读(1578)  评论(1)    收藏  举报