专注电子技术学习与研究
当前位置:单片机教程网 >> MCU设计实例 >> 浏览文章

VIM配置文件.vimrc

作者:中华小馒头   来源:中华小馒头的空间   点击数:  更新时间:2014年06月08日   【字体:

 贴出自己使用的VIM的配置文件.vimrc,以供参考:

 
 
runtime! debian.vim
 
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'.  Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
 
" Vim5 and later versions support syntax highlighting. Uncommenting the
" following enables syntax highlighting by default.
if has("syntax")
  syntax on
endif
 
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
 
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'"") > 1 && line("'"") <= line("$") | exe "normal! g'"" | endif
"endif
 
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif
 
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden             " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
 
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif
 
 
set nocompatible "非兼容模式
set ruler "设置标尺
set number "设置显示行号
"set vb t_vb = "消除响铃
set nobackup "无备份
"set cursorline "高亮显示当前行
set guifont=Consolas:h14:cANSI "设置英文字体
"set guifont=Arial_monospaced_for_SAP:h14:cANSI
set guifontwide=SimHei:h14:cGB2312 "设置双字节字体,也就是我们的中文字体
"查找字体可以使用fc-list>font.txt命令,将字体列表输出到font.txt里面
"set paste "设置粘贴,设置之后自动换行无效
"set nopaste
"set autoindent cindent cinoptions=g0
"set backspace=indent,eo1,start
set display=lastline
"set incsearch
"set tabstop=4
set showmatch
set showcmd "一个完整的命令结束前,在右下角显示这个命令
set hls "高亮显示所有与最后一次搜索目标串相匹配的文本
set autowrite "自动保存,特别是在如next或者make命令之前
set whichwrap=b,s,<,>,[,] "消除vim畏首畏尾的特性
"set list "查看制表符
"set listchars=tab:>-,trail:- "设置制表符显示格式
 
"set lines=30 "初始化时行数
"set columns=88 "初始化是列数
set shiftwidth=4 "设置自动缩进为4个字符
set tabstop=4 "设置tab键为四个字符
"几种我喜欢的配色方案
"colorscheme murphy
colorscheme koehler
"colorscheme torte
"colorscheme ron
"colorscheme evening
 
"另外一个关于文件编码的设置,从网上抄下来的
"基本完美解决问题了,其他问题尚未发现
set encoding=utf-8
set termencoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese,cp936
"set langmenu=zh_CN.utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"language messages zh_cn.utf-8
"language messages zh_cn.utf-8
 
"set spell "设置拼写检查,会在错误单词下游波浪线,将光标放到单词下
"z=就可以得到建议拼写,]s下一个。仅对英文有效。
 
 
"关闭时,自动保存图示,保存折叠
"au BufWinLeave * mkview
"关闭时,自动打开图示,保存折叠
"au BufWinEnter * silent loadview
 
filetype plugin indent on "打开自动识别文件类型,使用文件类型plugin以及使用缩进定义文本三项智能
 
"+ normal模式下,上下翻缓冲块
:nmap + :wn
"visual模式下,选中一片区域,批量注释(c语言)
:vmap // "zdi
",eg在normal模式下编辑gvimrc
:nmap ,eg :tabe /etc/vim/gvimrc
",ev在normal模式下编辑vimrc
:nmap ,ev :tabe /etc/vim/vimrc
"firefox
:nmap ,ff :!firefox
"chrome
:nmap ,ch :!chrome
"w3m www.baidu.com
:nmap ,wm :!w3m www.baidu.com
 
"taglist配置文件
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
 
"WinManager
let g:winManagerWindowLayout='FileExplorer|TagList'
"nmap wm :WMToggle
map :WMToggle
 
"多文档编辑器minbufexpl
let g:miniBufExplMapCTabSwitchBufs=1
let g:miniBufExplMapWindowsNavVim=1
let g:miniBufExplMapWindowNavArrows=1
 
 
"set tag=/root/works/openbts-uhd/tags
set tag=/home/hezhonghua/work_usrp/work_fpga/tags
set tag=/home/hezhonghua/LTE_resource_estimate/emb_cpu/tags
set tag=/home/hezhonghua/LTE_resource_estimate/hzh_workspace/tags
set tag=/home/hezhonghua/fmcomm_rf_board/no-OS-master/fmcomms1/tags
"cscope add /home/hezhonghua/work_usrp/work_fpga/cscope.out
:nmap 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("")
 
:nmap :cs find c =expand("")
:nmap :cs find s =expand("")
:nmap :ts =expand("")
:nmap :sts =expand("")
关闭窗口

相关文章