vim 編譯器的配置

來源:互聯網
上載者:User

vim 安裝解析

vim 配置

http://linux-wiki.cn/wiki/zh-hans/%E7%94%A8Vim%E7%BC%96%E7%A8%8B%E2%80%94%E2%80%94%E9%85%8D%E7%BD%AE%E4%B8%8E%E6%8A%80%E5%B7%A7

自己的配置的vim

winpos 5 5set lines=30 columns=100set nuset go=syntax onautocmd insertLeave *se noculautocmd insertEnter *seS culset rulerset showcmdset cmdheight=1set novisualbellset nocompatibleautocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"  func SetTitle()     if &filetype == 'sh'         call setline(1,"\#########################################################################")         call append(line("."), "\# File Name: ".expand("%"))         call append(line(".")+1, "\# Author: yangshuo")         call append(line(".")+2, "\# mail: 1115332213@qq.com")         call append(line(".")+3, "\# Created Time: ".strftime("%c"))         call append(line(".")+4, "\#########################################################################")         call append(line(".")+5, "\#!/bin/bash")         call append(line(".")+6, "")     else         call setline(1, "/*************************************************************************")         call append(line("."), "    > File Name: ".expand("%"))         call append(line(".")+1, "    > Author: yangshuo")         call append(line(".")+2, "    > Mail: 1115332213@qq.com ")         call append(line(".")+3, "    > Created Time: ".strftime("%c"))         call append(line(".")+4, " ************************************************************************/")         call append(line(".")+5, "")    endif    if &filetype == 'cpp'        call append(line(".")+6, "#include<iostream>")        call append(line(".")+7, "#include<stdio.h>")call append(line(".")+8, "#include<cmath>")        call append(line(".")+9, "#include<algorithm>")call append(line(".")+10,"#include<string.h>")call append(line(".")+11, "using namespace std;")        call append(line(".")+12, "int main()")call append(line(".")+13, "{")        call append(line(".")+14, "")call append(line(".")+15, "    return 0;")call append(line(".")+16, "}")    endif    if &filetype == 'c'        call append(line(".")+6, "#include<stdio.h>")        call append(line(".")+7, "")    endif    autocmd BufNewFile * normal Gendfunc  " 映射全選+複製 ctrl+amap <C-A> ggVGYmap! <C-A> <Esc>ggVGYmap <F12> gg=G" 選中狀態下 Ctrl+c 複製vmap <C-c> "+y"去空行  nnoremap <F2> :g/^\s*$/d<CR> "比較檔案  nnoremap <C-F2> :vert diffsplit "建立標籤  map <M-F2> :tabnew<CR>  "列出目前的目錄檔案  map <F3> :tabnew .<CR>  "開啟樹狀檔案目錄  map <C-F3> \be  "C,C++ 按F5編譯運行map <F5> :call CompileRunGcc()<CR>func! CompileRunGcc()    exec "w"    if &filetype == 'c'        exec "!g++ % -o %<"        exec "! ./%<"    elseif &filetype == 'cpp'        exec "!g++ % -o %<"        exec "! ./%<"    elseif &filetype == 'java'         exec "!javac %"         exec "!java %<"    elseif &filetype == 'sh'        :!./%    endifendfunc"C,C++的調試map <F8> :call Rungdb()<CR>func! Rungdb()    exec "w"    exec "!g++ % -g -o %<"    exec "!gdb ./%<"endfunc" 自動縮排set autoindentset cindent" Tab鍵的寬度set tabstop=4" 高亮顯示匹配的括弧set showmatch" 匹配括弧高亮的時間(單位是十分之一秒)set matchtime=1" 游標移動到buffer的頂部和底部時保持3行距離set scrolloff=3" 可以在buffer的任何地方使用滑鼠(類似office中在工作區雙擊滑鼠定位)set mouse=aset selection=exclusiveset selectmode=mouse,key

相關文章

聯繫我們

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