]]>re: VIM for java IDEhttp://www.aygfsteel.com/cuke/archive/2011/11/11/362411.html#363539H.CH.CFri, 11 Nov 2011 08:25:00 GMThttp://www.aygfsteel.com/cuke/archive/2011/11/11/362411.html#363539 taglist闇瑕乧tags鏀寔
灝嗭細wincmd H 淇敼涓簑incmd L錛?br>view sourceprint? 1 " for now assume that the explorer windows always stay on the left. 2 3 " TODO: make this optional later 4 5 " make the explorers window always stay on the right ---by chenyong 6 7 " wincmd H 8 9 wincmd L
view sourceprint? 1 "set auto open Winmanager 2 3 if g:AutoOpenWinManager 4 5 autocmd VimEnter * nested call s:StartWindowsManager()|1wincmd w 6 7 endif
涓冦侀鍑虹紦鍐插尯鏃訛紝鑷姩閫鍑簐im
榪欎釜鍔熻兘鏄弬鑰冧簡taglist鐨勮嚜鍔ㄩ鍑哄姛鑳斤紝鍦╰aglist.vim涓慨鏀圭殑銆?br> 鍑芥暟錛歠unction! s:Tlist_Window_Exit_Only_Window()涓殑winbunr(2)鏀逛負winbunr(3)錛屽嵆鍙墿2涓獥鍙f椂鍏抽棴錛岃冭檻鍒?涓獥鍙h偗瀹氭槸鍚屾椂瀛樺湪錛屾墍浠ヨ繖鏍瘋繕鏄彲琛岀殑錛?br>view sourceprint? 01 function! s:Tlist_Window_Exit_Only_Window() 02 03 " Before quitting Vim, delete the taglist buffer so that 04 05 " the '0 mark is correctly set to the previous buffer. 06 07 if v:version < 700 08 09 if winbufnr(3) == -1 10 11 bdelete 12 13 quit 14 15 endif 16 17 else 18 19 if winbufnr(3) == -1 20 21 if tabpagenr('$') == 1 22 23 " Only one tag page is present 24 25 bdelete 26 27 quit 28 29 else 30 31 " More than one tab page is present. Close only the current 32 33 " tab page 34 35 close 36 37 endif 38 39 endif 40 41 endif 42 43 endfunction
鍚屾椂鍦╲imrc涓渶瑕佽緗細 view sourceprint? 1 let Tlist_Exit_OnlyWindow=1
]]>re: VIM for java IDEhttp://www.aygfsteel.com/cuke/archive/2011/11/09/362411.html#363350H.CH.CWed, 09 Nov 2011 13:52:00 GMThttp://www.aygfsteel.com/cuke/archive/2011/11/09/362411.html#363350" Maintainer: amix the lucky stiff " http://amix.dk - amix@amix.dk " " Version: 3.6 - 25/08/10 14:40:30 " " Blog_post: " http://amix.dk/blog/post/19486#The-ultimate-vim-configuration-vimrc " Syntax_highlighted: " http://amix.dk/vim/vimrc.html " Raw_version: " http://amix.dk/vim/vimrc.txt " " How_to_Install_on_Unix: " $ mkdir ~/.vim_runtime " $ svn co svn://orangoo.com/vim ~/.vim_runtime " $ cat ~/.vim_runtime/install.sh " $ sh ~/.vim_runtime/install.sh <system> " <sytem> can be `mac`, `linux` or `windows` " " How_to_Upgrade: " $ svn update ~/.vim_runtime " " Sections: " -> General " -> VIM user interface " -> Colors and Fonts " -> Files and backups " -> Text, tab and indent related " -> Visual mode related " -> Command mode related " -> Moving around, tabs and buffers " -> Statusline " -> Parenthesis/bracket expanding " -> General Abbrevs " -> Editing mappings " " -> Cope " -> Minibuffer plugin " -> Omni complete functions " -> Python section " -> JavaScript section " " " Plugins_Included: " > minibufexpl.vim - http://www.vim.org/scripts/script.php?script_id=159 " Makes it easy to get an overview of buffers: " info -> :e ~/.vim_runtime/plugin/minibufexpl.vim " " > bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 " Makes it easy to switch between buffers: " info -> :help bufExplorer " " > yankring.vim - http://www.vim.org/scripts/script.php?script_id=1234 " Emacs's killring, useful when using the clipboard: " info -> :help yankring " " > surround.vim - http://www.vim.org/scripts/script.php?script_id=1697 " Makes it easy to work with surrounding text: " info -> :help surround " " > snipMate.vim - http://www.vim.org/scripts/script.php?script_id=2540 " Snippets for many languages (similar to TextMate's): " info -> :help snipMate " " > mru.vim - http://www.vim.org/scripts/script.php?script_id=521 " Plugin to manage Most Recently Used (MRU) files: " info -> :e ~/.vim_runtime/plugin/mru.vim " " > Command-T - http://www.vim.org/scripts/script.php?script_id=3025 " Command-T plug-in provides an extremely fast, intuitive mechanism for opening filesa: " info -> :help CommandT " screencast and web-help -> http://amix.dk/blog/post/19501 " " " Revisions: " > 3.6: Added lots of stuff (colors, Command-T, Vim 7.3 persistent undo etc.) " > 3.5: Paste mode is now shown in status line if you are in paste mode " > 3.4: Added mru.vim " > 3.3: Added syntax highlighting for Mako mako.vim " > 3.2: Turned on python_highlight_all for better syntax " highlighting for Python " > 3.1: Added revisions ;) and bufexplorer.vim " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Sets how many lines of history VIM has to remember set history=700
" Enable filetype plugin filetype plugin on filetype indent on
" Set to auto read when a file is changed from the outside set autoread
" With a map leader it's possible to do extra key combinations " like <leader>w saves the current file let mapleader = "," let g:mapleader = ","
" Fast saving nmap <leader>w :w!<cr>
" Fast editing of the .vimrc map <leader>e :e! ~/.vim_runtime/vimrc<cr>
" When vimrc is edited, reload it autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM user interface """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Set 7 lines to the curors - when moving vertical.. set so=7
set wildmenu "Turn on WiLd menu
set ruler "Always show current position
set cmdheight=2 "The commandbar height
set hid "Change buffer - without saving
" Set backspace config set backspace=eol,start,indent set whichwrap+=<,>,h,l
set ignorecase "Ignore case when searching set smartcase
set hlsearch "Highlight search things
set incsearch "Make search act like search in modern browsers set nolazyredraw "Don't redraw while executing macros
set magic "Set magic on, for regular expressions
set showmatch "Show matching bracets when text indicator is over them set mat=2 "How many tenths of a second to blink
" No sound on errors set noerrorbells set novisualbell set t_vb= set tm=500
" Set font according to system if MySys() == "mac" set gfn=Menlo:h14 set shell=/bin/bash elseif MySys() == "windows" set gfn=Bitstream\ Vera\ Sans\ Mono:h10 elseif MySys() == "linux" set gfn=Monospace\ 10 set shell=/bin/bash endif
if has("gui_running") set guioptions-=T set t_Co=256 set background=dark colorscheme peaksea set nonu else colorscheme zellner set background=dark
set nonu endif
set encoding=utf8 try lang en_US catch endtry
set ffs=unix,dos,mac "Default file types
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files, backups and undo """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git anyway... set nobackup set nowb set noswapfile
"Persistent undo try if MySys() == "windows" set undodir=C:\Windows\Temp else set undodir=~/.vim_runtime/undodir endif
set undofile catch endtry
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set expandtab set shiftwidth=4 set tabstop=4 set smarttab
set lbr set tw=500
set ai "Auto indent set si "Smart indet set wrap "Wrap lines
"""""""""""""""""""""""""""""" " => Visual mode related """""""""""""""""""""""""""""" " Really useful! " In visual mode when you press * or # to search for the current selection vnoremap <silent> * :call VisualSearch('f')<CR> vnoremap <silent> # :call VisualSearch('b')<CR>
" When you press gv you vimgrep after the selected text vnoremap <silent> gv :call VisualSearch('gv')<CR> map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>
let @/ = l:pattern let @" = l:saved_reg endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Command mode related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Smart mappings on the command line cno $h e ~/ cno $d e ~/Desktop/ cno $j e ./ cno $c e <C-\>eCurrentFileDir("e")<cr>
" $q is super useful when browsing on the command line cno $q <C-\>eDeleteTillSlash()<cr>
" Bash like keys for the command line cnoremap <C-A> <Home> cnoremap <C-E> <End> cnoremap <C-K> <C-U>
cnoremap <C-P> <Up> cnoremap <C-N> <Down>
" Useful on some European keyboards map ½ $ imap ½ $ vmap ½ $ cmap ½ $
"Move a line of text using ALT+[jk] or Comamnd+[jk] on mac nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Cope """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Do :help cope if you are unsure what cope is. It's super useful! map <leader>cc :botright cope<cr> map <leader>n :cn<cr> map <leader>p :cp<cr>
"""""""""""""""""""""""""""""" " => bufExplorer plugin """""""""""""""""""""""""""""" let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 map <leader>o :BufExplorer<cr>
"""""""""""""""""""""""""""""" " => Minibuffer plugin """""""""""""""""""""""""""""" let g:miniBufExplModSelTarget = 1 let g:miniBufExplorerMoreThanOne = 2 let g:miniBufExplModSelTarget = 0 let g:miniBufExplUseSingleClick = 1 let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplVSplit = 25 let g:miniBufExplSplitBelow=1
let g:bufExplorerSortBy = "name"
autocmd BufRead,BufNew :call UMiniBufExplorer
map <leader>u :TMiniBufExplorer<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Omni complete functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" autocmd FileType css set omnifunc=csscomplete#CompleteCSS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Spell checking """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Pressing ,ss will toggle and untoggle spell checking map <leader>ss :setlocal spell!<cr>
"""""""""""""""""""""""""""""" " => Command-T """""""""""""""""""""""""""""" let g:CommandTMaxHeight = 15 set wildignore+=*.o,*.obj,.git,*.pyc noremap <leader>j :CommandT<cr> noremap <leader>y :CommandTFlush<cr>
"""""""""""""""""""""""""""""" " => Vim grep """""""""""""""""""""""""""""" let Grep_Skip_Dirs = 'RCS CVS SCCS .svn generated' set grepprg=/bin/grep\ -nH
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => MISC """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Remove the Windows ^M - when the encodings gets messed up noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
"Quickly open a buffer for scripbble map <leader>q :e ~/buffer<cr> au BufRead,BufNewFile ~/buffer iab <buffer> xh1 ===========================================