我的vim設定

來源:互聯網
上載者:User

  今天晚上寫python指令碼時需要再配置一下vim,既然配置好了,就分享一下吧,也算是在這裡做個備份。

  過去好像也有寫關於vim配置的文章,不過那個不是自己用的,這個才是。

"description:    自己的vim設定檔"last change:    2013-01-13"author     :    tiandsp    "E-mail     :    dsptian@gmail.com"version    :    1.2set nocompatible     "關閉vi的相容模式syntax on            "自動文法高亮set nobackup        set noswapfile        "禁止產生臨時檔案filetype plugin indent onset completeopt=longest,menulet g:winManagerWindowLayout='FileExplorer|TagList'nmap wm :WMToggle<cr>colorscheme molokaiset t_Co=256if &cp | set nocp | endiflet s:cpo_save=&cposet cpo&vimmap! <S-Insert> <MiddleMouse>nmap gx <Plug>NetrwBrowseXnnoremap <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cWORD>"),0)map <S-Insert> <MiddleMouse>let &cpo=s:cpo_saveunlet s:cpo_saveset autoindentset backspace=indent,eol,startset cindentset fileencodings=ucs-bom,utf-8,default,latin2set helplang=cnset history=500set nomodelineset mouse=aset printoptions=paper:letterset rulerlet $VIMRUNTIME="/usr/share/vim/vim73"  set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/afterset showmatchset suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.tocset tabstop=4set termencoding=utf-8" vim: set ft=vim :if has("autocmd")   autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number   autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->   autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o/*<ESC>'>o*/   autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100   autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim   autocmd BufReadPost *      \ if line("'\"") > 0 && line("'\"") <= line("$") |      \   exe "normal g`\"" |      \ endifendif " has("autocmd") " F5編譯和運行C程式,F6編譯和運行C++程式" F7運行bash指令碼程式,F8運行python指令碼" 請注意,下述代碼在windows下使用會報錯" 需要去掉./這兩個字元" C的編譯和運行map <F5> :call CompileRunGcc()<CR>func! CompileRunGcc()exec "w"exec "!gcc % -g -o %<"exec "! ./%<"endfunc" C++的編譯和運行map <F6> :call CompileRunGpp()<CR>func! CompileRunGpp()exec "w"exec "!g++ % -g -o %<"exec "! ./%<"endfunc" bash指令碼運行map <F7> :call RunBash()<CR>func! RunBash()exec "w"exec "! ./%"endfunc" Python指令碼運行"map <F8> :call RunPython()<CR>func! RunPython()exec "w"exec "!python %"endfunc

 

相關文章

聯繫我們

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