使用多年的vimrc

來源:互聯網
上載者:User
" Vimrc file, http://phuzz.orgset fileencodings=utf-8,cp936,ucs-bom,latinset fileencoding=cp936set encoding=utf-8let &termencoding=&encodingset nocompatible    " use vim defaults"set ls=2            " allways show status lineset tabstop=4       " numbers of spaces of tab characterset shiftwidth=4    " numbers of spaces to (auto)indentset scrolloff=3     " keep 3 lines when scrollingset showcmd         " display incomplete commandsset hlsearch        " highlight searchesset incsearch       " do incremental searchingset ruler           " show the cursor position all the timeset visualbell t_vb=    " turn off error beep/flashset novisualbell    " turn off visual bellset nobackup        " do not keep a backup fileset number          " show line numbersset ignorecase      " ignore case when searching"set noignorecase   " don't ignore caseset title           " show title in console title barset ttyfast         " smoother changes"set ttyscroll=0        " turn off scrolling, didn't work well with PuTTYset modeline        " last lines in document sets vim modeset modelines=3     " number lines checked for modelinesset shortmess=atI   " Abbreviate messagesset nostartofline   " don't jump to first character when pagingset whichwrap=b,s,h,l,<,>,[,]   " move freely between files"set viminfo='20,<50,s10,h"set autoindent     " always set autoindenting on"set smartindent        " smart indentset cindent            " cindentset noautoindentset nosmartindent"set nocindent"set autowrite      " auto saves changes when quitting and swiching buffer"set expandtab      " tabs are converted to spaces, use only when required"set sm             " show matching braces, somewhat annoying..."set nowrap         " don't wrap linessyntax on           " syntax highlighing"set background=dark        " adapt colors for backgroundcolorscheme evening  " use this color scheme"colorscheme elflordif has("autocmd")    " Restore cursor position    au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif    " Filetypes (au = autocmd)    au FileType helpfile set nonumber      " no line numbers when viewing help    au FileType helpfile nnoremap <buffer><cr> <c-]>   " Enter selects subject    au FileType helpfile nnoremap <buffer><bs> <c-T>   " Backspace to go back    " When using mutt, text width=72    au FileType mail,tex set textwidth=72    au FileType cpp,c,java,sh,pl,php,asp  set autoindent    au FileType cpp,c,java,sh,pl,php,asp  set smartindent    au FileType cpp,c,java,sh,pl,php,asp  set cindent    "au BufRead mutt*[0-9] set tw=72    " Automatically chmod +x Shell and Perl scripts    "au BufWritePost   *.sh             !chmod +x %    "au BufWritePost   *.pl             !chmod +x %    " File formats    au BufNewFile,BufRead  *.pls    set syntax=dosini    au BufNewFile,BufRead  modprobe.conf    set syntax=modconfendif" Keyboard mappingsmap <F1> :previous<CR>  " map F1 to open previous buffermap <F2> :next<CR>      " map F2 to open next buffermap <silent> <C-N> :silent noh<CR> " turn off highlighted searchmap ,v :sp ~/.vimrc<cr> " edit my .vimrc file in a splitmap ,e :e ~/.vimrc<cr>      " edit my .vimrc filemap ,u :source ~/.vimrc<cr> " update the system settings from my vimrc file"----- write out html filemap ,h :source $VIM/vim71/syntax/2html.vim<cr>:w<cr>:clo<cr>

聯繫我們

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