set rtp+=~/.vim/bundle/vundle call vundle#rc() set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin set diffexpr=MyDiff() function! MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\ ' . arg3 . eq endfunction Bundle 'gmarik/vundle' " Bundle 'vim-scripts/autosession.vim' " Bundle 'maelstrom/linters.vim' Bundle 'scrooloose/syntastic' " comment Bundle 'kana/vim-flymake' " comment Bundle 'Twinside/vim-haskellFold' Bundle 'scrooloose/nerdtree' Bundle 'kien/ctrlp.vim' " Bundle 'endel/vim-github-colorscheme' " Bundle 'jpo/vim-railscasts-theme' Bundle 'altercation/vim-colors-solarized' Bundle 'tomasr/molokai' " Bundle 'fholgado/minibufexpl.vim' Bundle 'scrooloose/nerdcommenter' Bundle 'thisivan/vim-bufexplorer' Bundle 'majutsushi/tagbar' Bundle 'Lokaltog/vim-powerline' Bundle 'vim-scripts/L9' Bundle 'othree/vim-autocomplpop' Bundle 'Raimondi/delimitMate' Bundle 'vim-scripts/Rainbow-Parentheses-Improved-and2' Bundle 'vim-scripts/Vim-JDE' " Bundle 'vim-scripts/javacomplete' Bundle 'mileszs/ack.vim' filetype plugin indent on set guifont=Consolas\ for\ Powerline\ FixedD:h11:cDEFAULT set guioptions-=m set guioptions-=T set nu set hidden set nocompatible " Disable vi-compatibility set laststatus=2 " Always show the statusline set encoding=utf-8 " Necessary to show Unicode glyphs set noshowmode set columns=156 set lines=30 set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab let g:Powerline_symbols = 'fancy' " let b:delimitMate_expand_cr = 1 let delimitMate_expand_cr = 1 let g:rainbow_active = 1 let g:rainbow_operators = 1 let g:rainbow_guifgs = ['red3', 'DarkOrange3', 'yellow2', 'SeaGreen3', 'RoyalBlue3', 'MediumPurple3'] let NERDTreeIgnore = ['\.class$'] colorscheme solarized let mapleader="," nnoremap gj ]mzz5 nnoremap gk [mzz5 nnoremap , :b# nnoremap so :source $MYVIMRC nnoremap v :e $MYVIMRC nnoremap bi :BundleInstall nnoremap bc :BundleClean nnoremap n :noh nnoremap t :TagbarTogglew:vertical resize 32w nnoremap d :NERDTree % nnoremap ex :execute "silent !starthidden explorer " . expand("%:h") nnoremap cd :execute "silent cd " . expand("%:h") nnoremap bj ddp nnoremap bk ddkP nnoremap o :set pastem`o``:set nopaste nnoremap O :set pastem`O``:set nopaste nnoremap zz function! CreateScratch(scratchName) let winnr = bufwinnr('^' . a:scratchName . '$') if ( winnr >= 0 ) execute winnr . 'wincmd w' execute 'normal ggdG' else execute "new " . a:scratchName setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap endif return winnr endfunction function! HighlightWarningLines() highlight WarningMsg term=standout guifg=Black guibg=Orange let filename = expand('%:p') let winnr = CreateScratch('Lines') execute "r ! warninglines '" . filename . "'" execute "normal \w" let linenr = 1 while linenr < line("$") let linenr += 1 let line = get(getbufline(bufnr("$"), linenr), 0, 0) call matchadd('WarningMsg', '\%' . line . "l") endwhile execute "normal \w:q!\" endfunction function! DisplayLintForLine() let line = line(".") let filename = expand('%:p') call CreateScratch('Lint') execute "r ! messageforline '" . filename . "' " . line execute "normal :resize " . line("$") . "\" execute "normal gg\w" endfunction function! WriteFileList() execute "normal :e FileList\ggdG" let winnr = bufnr('%') let names = [] silent bufdo call add(names, expand('%:p')) execute 'b' . winnr for name in names call append(line('$'), name) endfor execute "normal :w\" execute "normal :bdelete\" endfunction function! ReadFileList() execute "silent normal :e FileList\" let filebufnr = bufnr('%') let linenr = 1 while linenr < line("$") let linenr += 1 let line = getline(linenr) execute "silent normal :e " . line . "\" execute "silent b" . filebufnr endwhile execute "silent normal :bdelete\" execute "silent normal :bnext\" endfunction function! MoveToTag() let currentWord = expand("") execute "normal \w" execute "normal /" . currentWord . "\" execute "normal \" endfunction nnoremap f :call MoveToTag() function! JavaConstructorComplete() execute "normal A{\\k" let functionHeader = getline(line(".")) let matches = matchlist(functionHeader, "\\v\\((.*)\\)") let argsraw = matches[1] let argslist = split(argsraw, ",") let linenr = line(".") for variable in argslist let matches = matchlist(variable, "\\v\\s*\\S+\\s*(\\S+)") let variablename = matches[1] let toappend = "this." . variablename . " = " . variablename . ";" call append(linenr, toappend) let linenr += 1 endfor execute "normal V}=" endfunction nnoremap jc :call JavaConstructorComplete() function! JavaMeets(text) if match(a:text, "\\V.") != -1 return 1 endif return 0 endfunction function! AddACPJava() echom "Hello World" if !exists("g:acp_behavior['java']") let g:acp_behavior["java"] = [{ "command": "\\", "completefunc": "VjdeCompletionFun0", "meets": "JavaMeets" }] endif endfunction set completeopt=longest,menuone inoremap pumvisible() ? "\" : "\u\" inoremap pumvisible() ? '' : \ '=pumvisible() ? "\Down>" : ""' inoremap pumvisible() ? '' : \ '=pumvisible() ? "\Down>" : ""' "au Filetype java :call AddACPJava() au VimEnter * nested :silent call ReadFileList() au VimLeave * :call WriteFileList() "au Filetype java setlocal omnifunc=javacomplete#Complete "au Filetype java setlocal completefunc=javacomplete#CompleteParamsInfo "au BufWrite *.cpp,*.h,*.java :execute "silent ! cd /D " . expand('%:p:h') . " && ctags -R ."