1. 初始环境spf13-vim
2. 利用bundle安装vim-man插件
echo Bundle \'vim-utils/vim-man\' > ~/.vimrc.bundles.local
vim
PluginInstall (或BundleInstall等命令)
3. vim中使用:
:Man printf
- openprintf(1)
man page in a split:Vman 3 putc
- openputc(3)
man page in a vertical split (read more here on what the manual page numbers mean, they are really useful):Man pri<Tab>
- command completion for man page names:Man 3 pri<Tab>
- completion "respects" the man page section argument:Man 6 <Ctrl-D>
- list all man pages from section 6
4. shell中使用:
You can use vim-man from the shell (instead of standard man
program) using the following script:
#! /bin/sh
vim -c "Man $1 $2" -c 'silent only'
Save it in /usr/bin/
as a file named viman
, give it execution permission with:
$ chmod +x /usr/bin/viman
Then from your shell you can read a DOC with:
$ viman doc
Or you can use the alias alias man=viman
so you can do (as usual):
$ man doc