我的gvim配置

来源:互联网 发布:如何兼职软件开发 编辑:程序博客网 时间:2024/05/01 23:53

我的gvim  适合自己的才是最好的 哈哈  

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" General"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""source $VIMRUNTIME/mswin.vimbehave mswinset nocompatible " get out of horrible vi-compatible modefiletype on " detect the type of fileset history=1000 " How many lines of history to rememberset cf " enable error files and error jumpingset clipboard+=unnamed " turns out I do like is sharing windows clipboardset ffs=dos,unix,mac " support all three, in this orderfiletype plugin on " load filetype pluginsset viminfo+=! " make sure it can save viminfoset isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not beset helplang=Cnwinpos 225 100 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Theme/Colors"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set background="/dark" " we are using a dark backgroundsyntax on " syntax highlighting oncolorscheme desert " my theme"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Files/Backups""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Vim UI"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set lsp=0 " space it out a little more (easier to read)set wildmenu " turn on wild menuset ruler " Always show current positions along the bottom set cmdheight=2 " the command bar is 2 highset number " turn on line numbersset lz " do not redraw while running macros (much faster) (LazyRedraw)set hid " you can change buffer without savingset backspace=2 " make backspace work normalset whichwrap+=<,>,h,l " backspace and cursor keys wrap toset mouse=a " use mouse everywhereset shortmess=atI " shortens messages to avoid 'press a key' prompt set report=0 " tell us when anything is changed via :...set noerrorbells " don't make noise" make the splitters between windows be blankset fillchars=vert:\ ,stl:\ ,stlnc:\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Visual Cues"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set showmatch " show matching bracketsset mat=0 " how many tenths of a second to blink matching brackets forset nohlsearch " do not highlight searched for phrasesset incsearch " BUT do highlight as you type you search phraseset listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show when I hit :set listset lines=40 " 60 lines tallset columns=100 " 60 cols wideset so=10 " Keep 10 lines (top/bottom) for scopeset novisualbell " don't blinkset noerrorbells " no noisesset statusline=[Felicia]\ %F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]set laststatus=2 " always show the status line"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Text Formatting/Layout"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set fo=tcrqn " See Help (complex)set ai " autoindentset si " smartindent set cindent " do c-style indentingset tabstop=4 " tab spacing (settings below are just to unify it)set softtabstop=4 " unifyset shiftwidth=4 " unify set expandtab " real tabs please!set nowrap " do not wrap lines set smarttab " use tabs at the start of a line, spaces elsewhere"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Folding"    Enable folding, but by default make it act like folding is off, because folding is annoying in anything but a few rare cases"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set foldenable " Turn on foldingset foldmethod=indent " Make folding indent sensitiveset foldlevel=100 " Don't autofold anything (but I can still fold manually)set foldopen-=search " don't open folds when you search into themset foldopen-=undo " don't open folds when you undo stuff"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" File Explorer"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let g:explVertical=1 " should I split verticiallylet g:explWinSize=35 " width of 35 pixels"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Win Manager"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let g:winManagerWidth=35 " How wide should it be( pixels)let g:winManagerWindowLayout = 'FileExplorer,TagsExplorer|BufExplorer' " What windows should it"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" CTags"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let Tlist_Ctags_Cmd = $VIM.'\ctags.exe' " Location of ctagslet Tlist_Sort_Type = "name" " order by let Tlist_Use_Right_Window = 1 " split to the right side of the screenlet Tlist_Compart_Format = 1 " show small menylet Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourselflet Tlist_File_Fold_Auto_Close = 0 " Do not close tags for other fileslet Tlist_Enable_Fold_Column = 0 " Do not show folding tree"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Minibuf"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let g:miniBufExplTabWrap = 1 " make tabs show complete (no broken on two lines)let g:miniBufExplModSelTarget = 1"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Matchit"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let b:match_ignorecase = 1"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Perl"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""let perl_extended_vars=1 " highlight advanced perl vars inside strings"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Custom Functions"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Select range, then hit :SuperRetab($width) - by p0g and FallingCowfunction! SuperRetab(width) rangesilent! exe a:firstline . ',' . a:lastline . 's/\v%(^ *)@<= {'. a:width .'}/\t/g'endfunction"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Mappings"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" map <right> <ESC>:MBEbn<RETURN> " right arrow (normal mode) switches buffers (excluding minibuf)" map <left> <ESC>:MBEbp<RETURN> " left arrow (normal mode) switches buffers (excluding minibuf) " map <up> <ESC>:Sex<RETURN><ESC><C-W><C-W> " up arrow (normal mode) brings up a file list" map <down> <ESC>:Tlist<RETURN> " down arrow (normal mode) brings up the tag list" map <A-i> i <ESC>r " alt-i (normal mode) inserts a single char, and then switches back to normal" map <F2> <ESC>ggVG:call SuperRetab()<left>" map <F12> ggVGg? " encypt the file (toggle)" use F2 to savemap <F2> :w<CR>" use F3 to save and exitmap <F3> :wq<CR>" use a F10 to do save and make to .exe, then run itmap <F9> :w<CR>:!g++ -o %< %<CR>!%<<CR>" use a F11 to run the .exemap <F10> :!%<<CR>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Autocommands"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)au BufNewFile,BufRead *.asp :set ft=aspjscript " all my .asp files ARE jscriptau BufNewFile,BufRead *.tpl :set ft=html " all my .tpl files ARE htmlau BufNewFile,BufRead *.hta :set ft=html " all my .tpl files ARE html"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Useful abbrevs"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""iab xasp <>iab xdate <c-r>=strftime("%d/%m/%y %H:%M:%S")<cr>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Directories"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set wrap                set linebreak"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vim7.1在windows下的编码设置。By Anders"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""vim7.1在windows下的编码设置。""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set encoding=utf-8set fileencodings=utf-8,chinese,latin-1if has("win32") set fileencoding=chineseelse set fileencoding=utf-8endif"解决菜单乱码source $VIMRUNTIME/delmenu.vimsource $VIMRUNTIME/menu.vim"解决consle输出乱码language messages zh_CN.utf-8



原创粉丝点击