專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

VIM配置文件.vimrc

作者:中華小饅頭   來源:中華小饅頭的空間   點(diǎn)擊數(shù):  更新時(shí)間: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 "設(shè)置標(biāo)尺
set number "設(shè)置顯示行號(hào)
"set vb t_vb = "消除響鈴
set nobackup "無備份
"set cursorline "高亮顯示當(dāng)前行
set guifont=Consolas:h14:cANSI "設(shè)置英文字體
"set guifont=Arial_monospaced_for_SAP:h14:cANSI
set guifontwide=SimHei:h14:cGB2312 "設(shè)置雙字節(jié)字體,也就是我們的中文字體
"查找字體可以使用fc-list>font.txt命令,將字體列表輸出到font.txt里面
"set paste "設(shè)置粘貼,設(shè)置之后自動(dòng)換行無效
"set nopaste
"set autoindent cindent cinoptions=g0
"set backspace=indent,eo1,start
set display=lastline
"set incsearch
"set tabstop=4
set showmatch
set showcmd "一個(gè)完整的命令結(jié)束前,在右下角顯示這個(gè)命令
set hls "高亮顯示所有與最后一次搜索目標(biāo)串相匹配的文本
set autowrite "自動(dòng)保存,特別是在如next或者make命令之前
set whichwrap=b,s,<,>,[,] "消除vim畏首畏尾的特性
"set list "查看制表符
"set listchars=tab:>-,trail:- "設(shè)置制表符顯示格式
 
"set lines=30 "初始化時(shí)行數(shù)
"set columns=88 "初始化是列數(shù)
set shiftwidth=4 "設(shè)置自動(dòng)縮進(jìn)為4個(gè)字符
set tabstop=4 "設(shè)置tab鍵為四個(gè)字符
"幾種我喜歡的配色方案
"colorscheme murphy
colorscheme koehler
"colorscheme torte
"colorscheme ron
"colorscheme evening
 
"另外一個(gè)關(guān)于文件編碼的設(shè)置,從網(wǎng)上抄下來的
"基本完美解決問題了,其他問題尚未發(fā)現(xiàn)
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 "設(shè)置拼寫檢查,會(huì)在錯(cuò)誤單詞下游波浪線,將光標(biāo)放到單詞下
"z=就可以得到建議拼寫,]s下一個(gè)。僅對(duì)英文有效。
 
 
"關(guān)閉時(shí),自動(dòng)保存圖示,保存折疊
"au BufWinLeave * mkview
"關(guān)閉時(shí),自動(dòng)打開圖示,保存折疊
"au BufWinEnter * silent loadview
 
filetype plugin indent on "打開自動(dòng)識(shí)別文件類型,使用文件類型plugin以及使用縮進(jìn)定義文本三項(xiàng)智能
 
"+ normal模式下,上下翻緩沖塊
:nmap + :wn
"visual模式下,選中一片區(qū)域,批量注釋(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("")
關(guān)閉窗口

相關(guān)文章