yntax on " Configuration file for vim filetype on set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=2 " more powerful backspacing " Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup "set tags=/Users/apple/red54apple/cas/cas/castags set tabstop=4 "set autoindent set hlsearch
mac:
" Configuration file for vim filetype on set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=2 " more powerful backspacing " Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup syntax on set tags=/Users/apple/red54apple/cas/cas/castags set tabstop=4 "set autoindent set hlsearch
参考http://coolshell.cn/articles/5426.html
不会的vim命令:
:help
w
^
g_
u → undo
<C-r> → redo
:e <path/to/file> → 打开一个文件
:saveas <path/to/file> → 另存为 <path/to/file>
:x, ZZ 或 :wq → 保存并退出:
:bn 和 :bp → 你可以同时打开很多文件,使用这两个命令来切换下一个或上一个文件。(陈皓注:我喜欢使用:n到下一个文件)