. VIMRC

Source: Internet
Author: User
Tags cve

The Configurationfile  forVimset Modelines=0        "cve-2007-2438"normally we use vim-extensions. If you want true vi-compatibility"Remove Change the following statementsSet nocompatible"Use Vim defaults instead of 100% VI compatibilitySet backspace=2        "More powerful backspacing"Don ' t write backup file if Vim is being called by"Crontab-e"Au bufwrite/private/tmp/crontab.*Set Nowritebackup nobackup"Don ' t write backup file if Vim is being called by"Chpass"Au bufwrite/private/etc/pw.*Set Nowritebackup nobackup"onfiguration file for vimSet modelines=0"cve-2007-2438"normally we use vim-extensions. If you want true vi-compatibility"Remove Change the following statementsSet nocompatible"Use Vim defaults instead of 100% VI compatibilitySet backspace=2"More powerful backspacingSyntax on"Syntax HighlightingAutocmd Insertleave*se noculautocmd insertenter*se cul"highlight current line with lightSet Smartindent"Smart AlignmentSet Autoindent"Auto AlignSet Confirm"when working with unsaved or read-only files, pop-up confirmationSet TabStop=4"the width of the TAB keySet Softtabstop=4Set Shiftwidth=4"Unified Indentation is 4Set number"Show Line NumbersSet History= -"number of historical recordsSet Hlsearchset incsearch"Search for verbatim FugauliangSet Gdefault"in-line substitutionSet Encoding=utf-8Set Fileencodings=utf-8, Ucs-bom,Shift-jis,gb18030,gbk,gb2312,cp936,utf- -, big5,euc-jp,latin1"Encoding SettingsColorScheme torte"Set Color Theme"Set Guifont=menlo:h16:cansi"Set FontSet Langmenu=zn_cn. utf-8Set Helplang=cn"Language SettingsSet Cmdheight=2"the height of the command line (in the status line), which defaults to 1, here is 2Set Ruler"In the edit process, the status line of the cursor position is displayed in the lower-right cornerSet Laststatus=2"Always show status linesSet ShowCmd"displays the currently executed command in the status line, and the unfinished instruction fragment is displayed.Set Scrolloff=3"Keep 3 lines distance when cursor moves to top and bottom of bufferSet Showmatch"highlight the corresponding parenthesesSet Matchtime=5"the time (in seconds) that corresponds to the highlight of the parenthesesSet Autowrite"automatically save the current file when switching bufferSet Wildmenu"command-line auto-complete operations in enhanced modeSet Linespace=2"number of pixel lines inserted by word puttingSet Whichwrap=b,s,<,>,[,]"turn on normal or visual mode backspace key, SPACEBAR, LEFT ARROW key, RIGHT ARROW key, insert or Replace mode left ARROW key, RIGHT ARROW key skip function. filetype plugin indent on"There are three parts of the command: file on, file plugin on, and file indent on. respectively, the file type is automatically recognized, and the document type script is used to define the file with indentation. "================== A custom key mapping ======================Vnoremap $1<esc> ' >a ' <esc> ' <i (<esc>Vnoremap $2<esc> ' >a]<esc> ' <i[<esc>Vnoremap $3<esc> ' >a}<esc> ' <i{<esc>Vnoremap $$<esc> ' >a"<esc> ' <i"<esc>Vnoremap $q<esc> ' >a'<esc> ' <i'<esc>Vnoremap $e<esc> ' >a"<esc> ' <i"<esc>"parentheses are generated automaticallyMap<F7>:ifExists"syntax_on") <BAR>\ Syntax off<BAR><CR>\  Else<BAR>\syntax Enable<BAR>\ endif"Single -Touch <F7> control syntax on/off. The reason is that sometimes too much color can hinder reading. Map<F5>: Call COMPILERUNGCC () <CR>func!COMPILERUNGCC () exec"W"exec"!GCC%-O%<"exec"! ./%<"Endfunc"<F5> compiling and running C programsMap<F6>: Call compilerungpp<cr>func!compilerungpp () exec"W"exec"!g++%-O%<"exec"! ./<"Endfunc"<F6> Compiling and running C + + programs"Don ' t write backup file if Vim is being called by"Crontab-e"Au bufwrite/private/tmp/crontab.*Set Nowritebackup"Don ' t write backup file if Vim is being called by"Chpass"Au bufwrite/private/etc/pw.*Set Nowritebackup"cscope SettingsifHas ("Cscope") Set CSPRG=/usr/bin/Cscope"Set cscopequickfix=s-,c-,d-,i-,t-,e-Set csto=0set CST Set Nocsverb"Add any database in current directory  ifFilereadable ("Cscope.out") CS Add cscope.out"Else Add database pointed to by environmentElseIf $CSCOPE _db! =""CS Add $CSCOPE _db endif set Csverbendifnmap<c-\>s:csFindS <c-r>=expand ("<cword>") <CR><CR>"search for this c symbolNmap <c-\>g:csFindG <c-r>=expand ("<cword>") <CR><CR>Nmap<c-\>c:csFindC <c-r>=expand ("<cword>") <CR><CR>Nmap<c-\>t:csFindT <c-r>=expand ("<cword>") <CR><CR>"Search for this stringNmap <c-\>e:csFindE <c-r>=expand ("<cword>") <CR><CR>Nmap<c-\>f:csFindF <c-r>=expand ("<cfile>") <CR><CR>Nmap<c-\>i:csFindI ^<c-r>=expand ("<cfile>") <CR>$<CR>Nmap<c-\>d:csFindD <c-r>=expand ("<cword>") <CR><CR>

. VIMRC

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.