- 配置文件: %HOMEPATH%/_vimrc
- 插件目录: %HOMEPATH%/vimfiles/
命令: gg=G
- install jslint http://www.javascriptlint.com/download.htm
- install vim script for jslint http://www.vim.org/scripts/script.php?script_id=2578
jslint在每次保存文件的时候进行自动的代码检查
- 安装 ctags 5.5 以上版本 http://ctags.sourceforge.net/
- 将 catgs 的可执行文件路径加入到系统 path 变量
- 安装 tagbar vim插件: http://www.vim.org/scripts/script.php?script_id=3465
- 如果(2)的设置不起作用,那么在 _vimrc 中显性定义 ctags 路径: let g:tagbar_ctags_bin = 'C:\ctags58\ctags.exe'
- 在 _vimrc 中定义 tagbar 的快捷键到F8:
nnoremap :TagbarToggle
在使用 vim 编辑 js 文件时,按 F8 显示和隐藏文件中的 tags 列表
- use better js syntax file: http://www.vim.org/scripts/script.php?script_id=1491
- enable auto indent in .vimrc
set cindent
set smartindent
set autoindent
set expandtab
set softtabstop=4
set shiftwidth=2
set cinkeys=0{,0},:,0#,!,!^F
if has("gui")
" C-Space seems to work under gVim on both Linux and win32
inoremap <C-Space> <C-n>
else " no gui
if has("unix")
inoremap <Nul> <C-n>
else
" I have no idea of the name of Ctrl-Space elsewhere
endif
endif
a very good vim-newbie write up: http://stevelosh.com/blog/2010/09/coming-home-to-vim/#using-the-leader