Complete vim configurations

Source: Internet
Author: User
Complete vim configuration map & lt; F9 & gt;: callSaveInputData () & lt; CR & gt; func! SaveInputData () exec & quot; tabnew & quot; exec & amp; #39; normal & quot; + gP & amp; #39; exec & quot; w! /Tmp/input_data & complete vim configuration map : Call SaveInputData () Func! SaveInputData () exec "tabnew" exec 'normal "+ gP 'exec" w! /Tmp/input_data "endfunc" colorscheme torte "colorscheme murphy" colorscheme desert "colorscheme desert" colorscheme elflordcolorscheme ron "set fencs = UTF-8, ucs-bom, shift-jis, gb18030, gbk, gb2312, cp936 "set termencoding = utf-8" set encoding = utf-8 "set fileencodings = ucs-bom, UTF-8, cp936 "set fileencoding = utf-8 """""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "show related """" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "Set shortmess = atI" when started, the prompt "winpos 5 5 5" set window location "set lines = 40 columns = 155" is not displayed" set go = "do not graph button" color asmanian2 "set background topic" set guifont = Courier_New: h10: cANSI "set font" syntax on "syntax highlight autocmd InsertLeave * se nocul" highlight current line autocmd InsertEnter * se cul "highlight current line with light color" set Rter "display ruler set showcmd" The entered Command shows the height of the "set height = 1" command line (in the status line), set to 1 "set whichwrap + = <,>, h, l "allow backspace and cursor keys to span row boundaries (not recommended) "set scroloff = 3" move the cursor to the top and bottom of the buffer to keep three rows away from set novisualbell "do not flash (do not understand) set statusline = % F % m % r % h % w \ [FORMAT = % {& ff}] \ [TYPE = % Y] \ [POS = % l, % v] [% p %] \%{ strftime (\ "% d/% m/% y \-\ % H: % M \")} "set laststatus = 1" show status line (1), always show status line (2) set foldenable "allow folding set foldmethod = manual" manual folding "set bac Kground = dark "background uses black set nocompatible" to remove annoying vi consistency modes, avoid bugs and limitations in earlier versions "show Chinese help if version> = 603 set helplang = cn set encoding = utf-8endif" set color scheme "colorscheme murphy" font "if (has (" gui_running ")) "set guifont = Bitstream \ Vera \ Sans \ Mono \ 10" endif """"""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "New file title """""""""""""""""""""""""""""""""""""""" """"""""" """""""""""""""""""""""""""""""""""""""" "New. c ,. h ,. sh ,. java file, automatically insert the file header autocmd BufNewFile *. cpp ,*. [ch], *. sh ,*. java exec ": call SetTitle ()" defines the function SetTitle, which automatically inserts the file header func SetTitle () "If the file type is. sh file if & filetype = 'sh' call setline (1, "\###################################### ###################################") call append (line (". ")," \ # File Name :". expand ("%") call append (line (". ") + 1," # Author: Ma6174 ") call append (line (". ") + 2," \ # mail: ma6174@163.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: ma6174 ") call append (line (".) + 2, "> Mail: ma6174@163.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 ") Call append (line (". ") + 7," using namespace std; ") call append (line (". ") + 8," ") endif if & filetype = 'C' call append (line (". ") + 6," # include ") Call append (line (". ") + 7," ") endif" if & filetype = 'java' "call append (line (". ") + 6," public class ". expand ("%") "call append (line (". ") + 7," ")" endif "after creating a file, autocmd BufNewFile * normal Gendfunc """""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """"" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "nmap W: w! Nmap F: find "Select all ing + copy ctrl + amap GgVGYmap! GgVGYmap Gg = G "press Ctrl + c to copy vmap "+ Y" to empty line nnoremap : G/^ \ s * $/d "Compare File nnoremap : Vert diffsplit "new tag map : Tabnew "List the current directory file map : Tabnew. "Open the tree File Directory map \ Be "C, C ++ press F5 to compile and run map : Call CompileRunGcc () 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 ':!. /% Elseif & filetype = 'py' exec "! Python % "exec "! Debug map of python % <"endifendfunc" C, C ++ : Call Rungdb () Func! Rungdb () exec "w" exec "! G ++ %-g-o % <"exec "! Gdb. /% <"endfunc """"""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" """"""""" """""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "sets to automatically load set autoread when a file is changed." quickfix mode: autocmd FileType c, cpp map : W : Make "Code completion set completeopt = preview, menu" allow plug-in filetype plugin on "share clipboard set clipboard + = unnamed" never back up set nobackup "make run: set makeprg = g ++ \-Wall \ % "automatically save set autowriteset rloud" open the status bar ruler set cursorline "highlight the current row set magic" set magic set guioptions-= T" hide toolbar set guioptions-= m "hide menu bar" set statusline =\% <% F [% 1 * % M % * % n % R % H] %=\% y \ % 0 (% {& fileformat} \%{ & encoding} \ % c: % l/% L %) \ "sets the information displayed in the status line set foldcolumn = 0 set foldmetho D = indent set foldlevel = 3 set foldenable "start foldenable" do not use the vi keyboard mode, but vim's set nocompatible "syntax highlighting set syntax = on" removes the input error prompt sound set noeb "when processing unsaved or read-only files, pop-up confirmation set confirm "automatic indent set autoindentset cindent" Tab key width set tabstop = 4 "unified indent to 4 set softtabstop = 4 set shiftwidth = 4" do not use spaces to replace the Tab set noexpandtab "use the TAB set smarttab at the beginning of the row and segment" display the row number set number "number of historical records set history = 1000" do not generate a temporary file set nobackupset noswapfile "search for case-insensitive set ignorecase" Search for character-by-character highlighted set hlsearchset incsearch "intra-row replace set gdefault" encoding settings set enc = utf-8set fencs = UTF-8, ucs-bom, shift-jis, gb18030, gbk, gb2312, cp936 "language settings set langmenu = zh_CN.UTF-8set helplang = cn" my status line shows the content (including file type and decoding) "set statusline = % F % m % r % h % w \ [FORMAT = % {& ff}] \ [TYPE = % Y] \ [POS = % l, % v] [% p %] \%{ strftime (\ "% d/% m/% y \-\ % H: % M \")} "set statusline = [% F] % y % r % m % * % = [Line: % l/% L, Column: % c] [% p %] "always displays the height of the status line set laststatus = 2" command line (under the status line) The default value is 1, here is 2 set Upload height = 2 "detect file type filetype on" Load file type plug-in filetype plugin on "load the relevant indent file filetype indent on for a specific file type" save the global variable set viminfo + =! "Do not use line breaks to separate words with the following symbols: set iskeyword + =_, $, @, % ,#, -"number of pixel lines inserted between characters" set linespace = 0 "command lines in enhancement mode automatically complete operation set wildmenu" enable backspace to process indent, eol, set backspace = 2, such as start, "allow backspace and the optical mark key to span the row boundary set whichwrap + = <,>, h, l "set mouse = aset selection = exclusiveset selectmode = mouse, key" can be used anywhere in the buffer (similar to double-clicking the mouse in the workspace in the office) by using the commands command, tell us which row of the file has been changed. set report = 0 "blank is displayed in the split window. it is easy to read set fillchars = vert: \, stl: \, stlnc: \ "set showmatch matching parentheses highlighted by highlight" (unit: 10 s) set matchtime = 1 "when the cursor moves to the top and bottom of the buffer, keep three lines away from set scroloff = 3" provides automatic indentation for the C program set smartindent "to highlight common txt files (txt is required. vim script) au BufRead, BufNewFile * setfiletype txt "auto-completion: inoremap (() I: inoremap) = ClosePair (')') ": Inoremap {{ } O ": inoremap} = ClosePair ('}') : Inoremap [[] I: inoremap] = ClosePair (']') : Inoremap """ I: inoremap ''' Ifunction! ClosePair (char) if getline ('.') [col ('.')-1] = a: char return "\ "Else return a: char endifendfunctionfiletype plugin indent on" open the file type check. you can use this sentence to intelligently complete set completeopt = longest, menu """"""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""" "NERDtee: set let NERDChristmasTree = 1let NERDTreeAutoCenter = 1let NERDTreeBookmarksFile = $ VIM. '\ Data \ NerdBookmarks.txt' let NERDTreeMouseMode = 2let program = 1let NERDTreeShowFiles = 1let program = 1let program = 1let NERDTreeWinPos = 'left' let NERDTreeWinSize = 31 nnoremap f: bytes : NERDTree
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.