Vim compiler Configuration

Source: Internet
Author: User

Vim installation Analysis

Vim Configuration

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

Self-configured vim

Winpos 5 5 set lines = 30 columns = 100 set nuset go = syntax onautocmd insertLeave * se noculautocmd insertEnter * seS culset rulerset show1_set 1_height = 1 set 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" all select + copy ctrl + amap <C-A> ggVGYmap! <C-A> <Esc> ggVGYmap <F12> gg = G "press Ctrl + c to copy vmap <C-c>" + y "to empty line nnoremap <F2>: g/^ \ s * $/d <CR> "Compare file nnoremap <C-F2>: vert diffsplit" new tag map <M-F2>: tabnew <CR> "list the current directory file map <F3>: tabnew. <CR> "Open the tree file directory map <C-F3> \ be" C, C ++ press F5 to compile and run 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 ++ debugging map <F8>: call Rungdb () <CR> func! Rungdb () exec "w" exec "! G ++ %-g-o % <"exec "! Gdb. /% <"endfunc" auto indent set autoindentset cindent "Tab key width set tabstop = 4" highlight matching bracket set showmatch "matching bracket highlighting time (unit: 10 s) set matchtime = 1 "move the cursor to the top and bottom of the buffer to keep three rows away from set scroloff = 3" you can use the mouse anywhere in the buffer (similar to double-click the mouse in the workspace in office) set mouse = aset selection = exclusiveset selectmode = mouse, key

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.