vim相关

扫码查看
"my .vimrc configset nusyntax onset hlsearchset shiftwidth=4set tabstop=4set expandtabset csprg=/usr/bin/cscopeif has("cscope")if filereadable("cscope.out")"cs add /home/liu/src_tar/squid-2.7.STABLE9/cscope.outcs add cscope.out"这里可以写绝对路径endifnmap s :cs find s =expand("")nmap g :cs find g =expand("")nmap c :cs find c =expand("")nmap t :cs find t =expand("")nmap e :cs find e =expand("")nmap f :cs find f =expand("")nmap i :cs find i ^=expand("")$nmap d :cs find d =expand("")"set nottimeoutendif"让vim记忆上次编辑的位置autocmd BufReadPost *\ if line("'\"")>0&&line("'\"")\ exe "normal g'\"" |\ endif"让vim记忆上次编辑的位置"开关tag窗口map :TlistToggleimap i"使用右侧窗口let Tlist_Use_Right_Window=0==============================================在vim中增加Taglist方法:下载一个taglist的安装包http://www.vim.org/scripts/download_script.php?src_id=19574unzip -d taglist taglist_45.zipcd taglistcp doc/taglist.txt /usr/share/vim/vim63/doc/cp plugin/taglist.vim /usr/share/vim/vim63/plugin/如果目录不存在,试下ls /usr/share/vim/ 下查看下vim的版本,将上述红色版本号码变下即可。vim乱码问题http://wenku.baidu.com/view/91f9f164783e0912a2162ad5.html查看文件编码在Linux中查看文件编码可以通 过以下几种方式:1.在Vim中可以直接查看文件编码:set fileencoding即可显示文件编码格式。如果你 只是想查看其它编码格式的文件或者想解决用Vim查看文件乱码的问题,那么你可以在~/.vimrc 文件中添加以下内容:let &termencoding=&encodingset fileencodings=utf-8,ucs-bom,gbk,cp936这样,就可以让vim自动识别文 件编码(可以自动识别UTF-8或者GBK编码的文件),其实就是依照fileencodings提供的编码列表尝试,如果没有找到合适的编码,就用 latin-1(ASCII)编码打开。vim中删除特殊引号间的字符串,dt‘,其中单引号可以换为其他的分隔符‘abc def ghd’vim中光标移动详见:http://blog.csdn.net/love__coder/article/details/6739670行首 ^  或者 0都可以,有细微区别行尾 $移动到单词尾部 e上一屏:ctrl + b下一屏:ctrl + f单词词首或前一个单词词首:b后一个单词词首:wesc的代替键  ctrl-[ 整体移动代码ctrl+v 选中代码,> 右移,vim中的另类拷贝方式::tabe /path/to/another/file然后用Use gt or gT 来切换文件,这个与sp不同的是切换后的界面均在同一窗口中。
10-16 20:48
查看更多