vim的.vimrc檔案設定

來源:互聯網
上載者:User

標籤:des   color   os   檔案   io   width   for   art   

 

set nocompatible
set autowrite
set autoread
set nobackup
set noswapfile


" --- syntax and indent ---
syntax on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set smartindent
set cindent
set expandtab
set nolinebreak
set showmatch
set wrap
" ---editing setting ---
set backspace=2 "use backspace key to delete in insert mode

" ---encoding---
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb2312,gb18030,big5,euc-jp,euc-kr,latin1
set fileencoding=utf-8
set termencoding=utf-8

" ---fileformat---
set ffs=unix,dos,mac
set ff=unix

colorscheme desert
"set columns=120
set number

" statusline
set laststatus=2
set statusline=%f\ %m%y[%{&ff}:%{&fenc}]%=%10.(\ %l,%c%V%)\ %5.(%P%)


filetype on
filetype plugin on

set mouse=a

"---find and substitute ---
set incsearch
set hlsearch
set ignorecase
set sm

" set colors when column is great than 90
"set textwidth=90
"set wrapmargin=90
"au BufWinEnter * let w:m1=matchadd(‘Search‘, ‘\%<101v.\%>90v‘, -1)
"au BufWinEnter * let w:m2=matchadd(‘ErrorMsg‘, ‘\%>100v.\+‘, -1)
"au BufWinLeave * call clearmatches()

"---ctags setting---
set path=.,/usr/include/,/usr/local/include
map <F11> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
set tags+=~/.vim/tag/cpp
set tags+=~/.vim/tag/google
"---Tlist setting---
let Tlist_Ctags_Cmd=‘ctags‘
let Tlist_Use_Right_Window=0
let Tlist_Show_One_File=1
let Tlist_File_Fold_Auto_Close=0
let Tlist_Exit_OnlyWindow=1
let Tlist_Process_File_Always=1
let Tlist_WinHeight=100
let Tlist_WinWidth=24
let Tlist_Inc_WinWidth=0

"---acp setting---
let g:acp_completeoptPreview = 0

"---omni setting---
" 按下F3自動補全代碼,注意該映射語句後不能有其他字元,包括tab;否則按下F3會自動補全一些亂碼
imap <F3> <C-X><C-O>
" 按下F2根據標頭檔內關鍵字補全
imap <F2> <C-X><C-I>
set completeopt=menu,menuone " 關掉智能補全時的預覽視窗
let OmniCpp_MayCompleteDot = 1 " autocomplete with .
let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
let OmniCpp_MayCompleteScope = 1 " autocomplete with ::
let OmniCpp_SelectFirstItem = 2 " select first item (but don‘t insert)
let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr = 1 " show function prototype in popup window
let OmniCpp_GlobalScopeSearch=1 " enable the global scope search
let OmniCpp_DisplayMode=1 " Class scope completion mode: always show all members
let OmniCpp_DefaultNamespaces=["std","_GLIBCXX_STD"]
let OmniCpp_ShowScopeInAbbr=1 " show scope in abbreviation and remove the last column
let OmniCpp_ShowAccess=1

 

"---bufexploerr seting---
let g:bufExplorerDefaultHelp=0 " Do not show default help.
let g:bufExplorerShowRelativePath=1 " Show relative paths.
let g:bufExplorerSortBy=‘mru‘ " Sort by most recently used.
let g:bufExplorerSplitRight=0 " Split left.
let g:bufExplorerSplitVertical=1 " Split vertically.
let g:bufExplorerSplitVertSize = 40 " Split width
let g:bufExplorerUseCurrentWindow=1 " Open in new window.
autocmd BufWinEnter \[Buf\ List\] setl nonumber

"---project setting---
let g:proj_flags="imstFST"

"---WinManager :WMToggle---
let g:winManagerWindowLayout=‘FileExplorer,BufExplorer|TagList‘
let g:winManagerWidth=30
let g:defaultExplorer=0
nmap wm :WMToggle<CR>

"---protobuf---
augroup filetype
au! BufRead,BufNewFile *.proto setfiletype prototype
augroup end

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.