vim設定檔(無外掛程式版本)

來源:互聯網
上載者:User

標籤:des   style   blog   color   io   os   ar   for   檔案   

" -------------------- Copyright Header Begin ---------------------------------" Descripation : Facilitates vim settings " Version      : 2.0" Author       : RollStone,[email protected]" Copyright    : RollStone (2007-2014)." -------------------- Copyright Header End -----------------------------------"" Overview for maintainers :" The file is divided into following sections. You may add yours or update these" if/when you choose to enhance this setting file."" + General Settings" + Tips(just need to how use these functions)" + Autocmds" + Mappings"{{{ ---------------- General Settings Begin ---------------------------------"MC: My Contactionabbr mc RollStone,[email protected]"Leaderlet g:mapleader=‘;‘let g:leader=‘;‘"Just more like vim,less viset nocompatible"backupset nobackup"dirsset autochdirset autoreadset autowrite"completeset complete+=kset completeopt=longest,menu"encodesset fileencodings=utf-8,gbk,gb18030,chinese"indentset autoindentset smartindentset noexpandtabset tabstop=4set shiftwidth=4set formatoptions+=mMset cinoptions=:0,l1,t0,g0"searchset showmatchset hlsearchset smartcaseset ignorecaseset incsearch"statuslineset titleset showcmdset laststatus=2set statusline=%F%m%r%h%w,%{&ff},Type:%y,[ASCII:\%03.3b,HEX:0x\%02.2B][%l,%v][Total:%L][Rate:%p%%]\ %*%=\ %{strftime(\"%d-%m-%y\ %H:%M\")}set wildmenu"tabulationset rulerset numberset cursorline"set cursorcolumn"highlight cursorline ctermbg=lightgray"highlight cursorcolumn ctermbg=lightgray"wrapset nowrapset nowrapscan"othersset backspace=indent,eol,startset wildignore=*.bak,*.o,*.e,*~set browsedir=currentset sessionoptions-=curdirset ttimeoutlen=150set vb t_vb="some common gatessyntax onfiletype plugin indent on"}}} ---------------- General Settings End -----------------------------------"{{{ ---------------- Tips Begin ---------------------------------------------"notice: n just be in normal mode"tip1. match ()/{}/[]"n: % (first chang into normal mode,and press shift + 5)"tip2. find the manual content"n: K (first chang into normal mode,and press shift + K)"}}} ---------------- Tips End -----------------------------------------------"{{{ ---------------- Autocmds Begin -----------------------------------------if has("autocmd")"when modifies vimrc or .vimrc reload itau! BufWritePost [ _.]vimrc source ~/.vimrc"auto chdir to curdirau BufEnter * :lchdir %:p:h"change to the lastest cursor positionau BufReadPost * if line("‘\"") > 0 && line("‘\"") <= line("$") | exe "normal! g`\"" | endif endif " has (autocmd)""}}} ---------------- Autocmds End -------------------------------------------"{{{ ---------------- Mappings Begin -----------------------------------------"display line number or notnnoremap <leader> sn :set nu!<cr>"F1 - overrule Linux F1map <silent> <F1> <esc>:exec "help ".expand("<cword>")<cr>"F2 - call file explorer Exmap  <silent> <F2>        :Explorerimap <silent> <F2>   <esc>:Explorer"F3 - write file without confirmationmap  <silent> <F2>        :write<cr>imap <silent> <F2>   <esc>:write<cr>"F4 - remove trail white-spacemap  <silent> <F2>        :%s/[ \t\r]\+$//g<cr>imap <silent> <F2>   <esc>:%s/[ \t\r]\+$//g<cr>"F5-F8 :quickfix :open/close error windows,display prev/next errormap  <silent> <F5>        :copen<cr>map  <silent> <F6>        :cclose<cr>map  <silent> <F7>        :cp<cr>map  <silent> <F8>        :cn<cr>imap <silent> <F5>   <esc>:copen<cr>imap <silent> <F6>   <esc>:cclose<cr>imap <silent> <F7>   <esc>:cp<cr>imap <silent> <F8>   <esc>:cn<cr>"autocomplete parenthesis, brackets and bracesinoremap ( ()<Left>inoremap [ []<Left>inoremap { {}<Left>vnoremap ( s()<Esc>P<Right>%vnoremap [ s[]<Esc>P<Right>%vnoremap { s{}<Esc>P<Right>%"autocomplete quotes (select mode)xnoremap  ‘  s‘‘<Esc>P<Right>xnoremap  "  s""<Esc>P<Right>xnoremap  `  s``<Esc>P<Right>"Open includes files in a new split windowset path=.,include,../include,/usr/include,/usr/local/includenmap gf <c-w><c-f>"{{User defines functions and its‘ map"Format C/CPP codes,and return current linefunction! UDFormatCppCode()    let s:backupCurLine=line(‘.‘)    exec "normal! gg=G <cr>"    exec ":".s:backupCurLineendfuncnmap fmt :call UDFormatCppCode()<cr>imap fmt <esc>:call UDFormatCppCode()<cr>o"}}"}}} ---------------- Mappings End -------------------------------------------

 

vim設定檔(無外掛程式版本)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.