My VIM configuration scheme

Source: Internet
Author: User
My VIM configuration solution a few days ago, a modest Senior asked me to paste my vim configuration here. 001 setnocp & quot; set compatible 002 setexpandtab & quot; set tab003www. 2cto. comsetshiftwidth4 & quot; set the tab interval 004settabs...
My VIM configuration scheme a few days ago, a modest Senior asked me to paste my vim configuration here, 001 set nocp "set compatible 002 set expandtab" set tab003 www.2cto.com set shiftwidth = 4 "set the tab interval 004 set tabstop = 4" four spaces represent a tab005set sts = 4006 set showmatch "in the time mark in the brackets will temporarily jump to the matching brackets 007 set autoindent "set automatic indent 008" set smartindent "set smart indent 009 set nowrap" set automatic line feed 010 set tw = 500011 set lbr012set number "set whether to display row 013 set guifont = Monospace \ 11" set font size 014 set encoding = utf-8 "set encoding to utf-8015set fileencoding = utf-8016set fileencodings = ucs-bom, UTF-8, GB18030, cp936, big5, euc-jp, euc-kr, latin1017 www.2cto.com set helplang = cn "help Chinese support 018 colorscheme tango" set subject color 019 "set mouse = v" set paste and copy 020 021 "auto complete configuration 022 autocmd FileType python set omnifunc = pythoncomplete # export FileType javascript set omnifunc = bytes # export FileType html set omnifunc = htmlcomplete # export FileType css set omnifunc = csscomplete # export FileType xml set omnifunc = xmlcomplete # export FileType php set omnifunc = phpcomplete # CompletePHP028autocmd FileType c set omnifunc = ccomplete # Complete029 030 "================== ======= set the Taglist ==================================== 031map : TlistToggle 032 www.2cto.com "map : Silent! Tlist "Press F3 to call out 033" let Tlist_Ctags_Cmd = '/usr/bin/ctags' "because we put it in the environment variable, therefore, you can directly execute 034let Tlist_Use_Right_Window = 1 "to display the window on the right, 0 is displayed on the left 035 "let Tlist_Show_One_File = 1", allowing the taglist to display the function list 036 "let Tlist_File_Fold_Auto_Close = 1" for multiple files at the same time, function list hide 037 "let Tlist_Exit_OnlyWindow = 1" when taglist is the last split window, vim038 "let Tlist_Process_File_Always = 0" always process tags.1: Process; 0: do not process 039 "let Tlist_Inc_Winwidth = 0" instead of updating tags in real time, because it is not necessary to perform Taglist settings ============================== 041 042 043 044 045 "#### ######################## keyboard ing setting region ############ ################## 046map : NERDTreeToggle 047 www.2cto.com map T: NERDTreeMirror 048 049 050 "corresponding to function configuration 051 set guitablabel =%{ ShortTabLabel ()} 052 function ShortTabLabel () 053 let bufnrlist = tabpagebuflist (v: lnum) 054 let label = bufname (bufnrlist [tabpagewinnr (v: lnum)-1]) 055 let filename = fnamemodify (label, ': t ') 056 www.2cto.com return filename057endfunction058 059 set tabline = %! MyTabLine () 060 function MyTabLine () 061 let s = ''062 for I in range (tabpagenr ('$ ')) 063 "highlight 064 if I + 1 = tabpagenr () 065 let s. = '% # TabLineSel #' 066 www.2cto.com else067 let s. = '% # TabLine #'068 endif069 "sets the tag page number (for mouse clicking) 070 let s. = '% '. (I + 1 ). 't'071 "MyTabLabel () provides the complete path label MyShortTabLabel and provides the file name label 072 let s. = '% {MyShortTabLabel ('. (I + 1 ). ')} '073 endfor074 "fill in and repeat the last tab with TabLineFill Tag page number 075 let s. = '% # TabLineFill # % t' 076 "the right alignment is used to close the label 077 if tabpagenr (' $ ')> 1078 www.2cto.com let s. = '% =%# TabLine # % 999Xclose' 079 endif080 return s081endfunction082 "file name tag 083 function MyShortTabLabel (n) 084 let buflist = tabpagebuflist (a: n) 085 let label = bufname (buflist [tabpagewinnr (a: n)-1]) 086 let filename = fnamemodify (label, ': t ') 087 return filename088endfunction089 "complete path label 090 function M YTabLabel (n) 091 let buflist = tabpagebuflist (a: n) 092 www.2cto.com let winnr = tabpagewinnr (a: n) 093 return bufname (buflist [winnr-1]) when "vim label style 096" TabLineFill tab pages line, where there are no labels097hi TabLineFill term = none098hi TabLineFill ctermfg = paitablinefill guifg = #777777100 "TabLineSel tab pages line, active tab page label101hi TabLineSel term = inverse102hi Ta BLineSel cterm = none ctermfg = yellow ctermbg = Black103hi TabLineSel gui = none guifg = yellow guibg = Black104 105 "Develop editing into FileType vim setl 1_filetype vim setl limit = 2108 w.au FileType vim setl tabstop = 2109 110 "Display status bar (default value: 1, unable to display status bar) 111 set laststatus = 2112 "Format the statusline113set statusline = \ % F % m % r % h \ % w \ CWD: \ % r % {CurDir ()} e5 % h \ Line: \ % l/% L: % C114 115 function! CurDir () 116 let curdir = substitute (getcwd (), '/Users/amir /',"~ /"," G ") 117 www.2cto.com return curdir118endfunction119 120 "####################### set PHP function automatic reminders ###### ################## Start121 "set the dictionary to automatically complete 122 set complete + = k123" set dictionary 124 set dictionary = ~ /. Vim/doc/php_funclist.txt125 "automatically uses the TAB key 126 function! InsertTabWrapper () 127 let col = col ('.')-1128 www.2cto.com if! Col | getline ('.') [col-1]! ~ '\ K' 129 return "\ "130 else131 return "\ "132 endif133endfunction134" ing InsertTabWrapper to TAB 135 inoremap = InsertTabWrapper () 136 "####################### set automatic notification for PHP functions ########## ############## end1_138 139 "####### automatically complete 140 www.2cto.com with parentheses: inoremap (() I141: inoremap) = ClosePair (')') 142: inoremap {{} I143: inoremap} = ClosePair ('}') 144: inoremap [[] I145: inoremap] = ClosePair (']') 146: inoremap <> I147 www.2cto.com: inoremap> = ClosePair ('> ') 148 149 function ClosePair (char) 150 if getline ('.') [col ('.')-1] = a: char151 return "\ "152 www.2cto.com else153 return a: char154 endif155endfunction156" ####### brackets and braces automatically complete the corresponding configuration files, all on the gvim website
 
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.