"source /home/stonewareslord/.vim/autoload/plug.vim if has('conceal') set conceallevel=2 concealcursor=i endif let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"' let g:formatters_cpp = ['my_custom_cpp'] let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"' let g:formatters_java = ['my_custom_java'] let g:UltiSnipsUsePythonVersion=3 command! WW %!sudo tee > /dev/null % "TODO: Fix this "let g:rbpt_loadcmd_toggle = 1 let g:indent_guides_auto_colors = 0 autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey filetype plugin on set grepprg=grep\ -nH\ $* let g:tex_flavor='latex' "match Error /\s\+$/ " Basic, very important mappings { " Movement { "Vertical nnoremap gj j nnoremap gk k nnoremap j gj nnoremap k gk vnoremap gj j vnoremap gk k vnoremap j gj vnoremap k gk "Horizontal nnoremap Y y$ nnoremap H ^ nnoremap L $ vnoremap L $h vnoremap H ^ "Move to end of line inoremap jk inoremap kj "Move to last character of last line nnoremap G G$ vnoremap G G$ " } " Buffers { "Control-key movement nnoremap h nnoremap j nnoremap k nnoremap l "Arrow keys nnoremap w nnoremap W nnoremap :bp nnoremap :bn "Vertical and horizontal split nnoremap \| vl nnoremap - sj "Close buffer nnoremap q "Fullscreen buffer nnoremap z _\| "Go to last buffer nnoremap " } " Misc { vnoremap * :call VisualSelection('f') vnoremap # :call VisualSelection('b') vnoremap ; : nnoremap ! :! vnoremap < >gv "Disable F1 nnoremap inoremap vnoremap "F2 toggle paste nnoremap :set invpaste "Better searching nnoremap / /\v vnoremap / /\v "Addition and subtraction nnoremap + nnoremap - "Backspace remove highlights nnoremap :nohlsearchgzo "Better save nnoremap :up:silent! call sy#start() "Unmap Q nnoremap Q " } " } " Plugin mappings { "Easymotion map , (easymotion-prefix) "Ctrl-p nnoremap :CtrlPFunky "Gundo nnoremap :GundoToggle "Easytags nnoremap :CtrlPTag "Tagbar "nnoremap :Tagbar "Add a bundle from clipboard nnoremap bun G?Plug yyjp$hdi'"+gPo " \| "+gp:nohlsearch:up:PlugInstall "Automatic if/else/for/while wrappers nnoremap if m"Oif(){jo}`"v>k^wa nnoremap else m"kAelse{jo}`"v> nnoremap for m"Ofor(){jo}`"v>k^wa nnoremap while m"Owhile(){jo}`"v>k^wa nnoremap rm m"kddjddkv<`" vnoremap if ``>o}gv>`else ``>o}gv> vnoremap for ``>o}gv>`while ``>o}gv>`rm `<kdd`>jddgv< " } " Trial mappings { nnoremap o m`o`` nnoremap O m`O`` " } " Gui options { set gfn=Monospace\ 8 set guioptions= set guicursor+=n-v-c:blinkon0 set mouse-=a " } " Annoyance fixes { "Annoying escape timeouts set ttimeout set ttimeoutlen=0 set notimeout " } " Misc { set tabstop=2 shiftwidth=2 expandtab set tags=./tags;/ set wildmode=longest,list,full set formatoptions-=r set formatoptions-=o set diffopt+=iwhite set noesckeys set shiftwidth=2 set tabstop=2 set modeline set softtabstop=2 set expandtab set history=1000 set hidden set cursorline set incsearch set showmatch set hlsearch set scrolloff=3 set scrolljump=5 set autoindent set backup set backupdir=~/.vim/backup set directory=~/.vim/tmp set undolevels=1000 set history=500 set ttyfast set fileformat=unix set encoding=utf-8 set laststatus=2 set foldmethod=indent set foldnestmax=10 set foldlevel=2 set relativenumber set number set background=dark set t_Co=256 set gdefault set nocompatible set ignorecase set textwidth=0 syntax on " } "Signify let g:signify_vcs_list = [ 'git', 'svn' ] let g:signify_difftool = 'diff' "CtrlP let g:ctrlp_root_markers = ['.cproot'] let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$', \ 'file': '\v\.(exe|so|dll|class)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } let g:ctrlp_extensions=['funky'] "Airline let g:airline_left_sep='▶' let g:airline_right_sep='◀' let g:airline#extensions#syntastic#enabled=0 let g:ycm_show_diagnostics_ui=0 let g:syntastic_cpp_compiler = 'clang++' let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' let g:airline#extensions#whitespace#enabled=0 let g:airline#extensions#whitespace#show_message=0 let g:airline#extensions#tmuxline#enabled=1 "Autoformat let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatter_cpp = ['formatdef_my_custom_cpp'] let g:formatter_php = ['formatdef_my_custom_php'] "let g:formatprg_cpp="astyle" "let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j" " These flags don't work for some reason " -xn -xc -xl -S "Syntastic let g:syntastic_java_javac_classpath = "/home/stonewareslord/applications/java/junit-4.12.jar:/home/stonewareslord/applications/java/hamcrest-core-1.3.jar:/home/stonewareslord/git/school/reqkeeper/Project2/src:/home/stonewareslord/git/school/reqkeeper/Project2/test:/home/stonewareslord/git/school/reqkeeper/Project2/lib/RequirementsTrackerXML.jar" "IndentGuides let g:indent_guides_start_level=1 let g:indent_guides_guide_size=1 let g:indent_guides_enable_on_vim_startup=1 let g:php_refactor_command='php /usr/local/bin/refactor.phar' function! g:UltiSnips_Complete() call UltiSnips#ExpandSnippet() if g:ulti_expand_res == 0 if pumvisible() return "\" else call UltiSnips#JumpForwards() if g:ulti_jump_forwards_res == 0 return "\" endif endif endif return "" endfunction "inoremap pumvisible() ? "\" : "\" "inoremap pumvisible() ? "\" : "\" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsExpandTrigger="" let g:UltiSnipsListSnippets="" let g:UltiSnipsEditSplit="vertical" let g:ycm_key_list_select_completion = [] inoremap pumvisible() ? "\" : "\u\" let loaded_matchit=1 filetype off if has("win32") call plug#begin('~/vimfiles/plugged') else call plug#begin('~/.vim/plugged') endif " Code writing { Plug 'Chiel92/vim-autoformat' "Adds autoformat command | https://github.com/Chiel92/vim-autoformat Plug 'tpope/vim-surround' "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround Plug 'scrooloose/syntastic' "Syntax checker | https://github.com/scrooloose/syntastic Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } "File browser | https://github.com/scrooloose/nerdtree Plug 'Lokaltog/vim-easymotion' "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' } "Visual undo | https://github.com/sjl/gundo.vim Plug 'tommcdo/vim-exchange' "Exchange two selections of text | https://github.com/tommcdo/vim-exchange Plug 'tpope/vim-repeat' "Repeat last tpope command with . | https://github.com/tpope/vim-repeat Plug 'tpope/vim-fugitive' "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive Plug 'kien/ctrlp.vim' "Fuzzy file search | https://github.com/kien/ctrlp.vim Plug 'godlygeek/tabular' "Quickly make tables in vim | https://github.com/godlygeek/tabular Plug 'sirver/UltiSnips' " "Adds snippets | https://github.com/sirver/UltiSnips Plug 'honza/vim-snippets' "More snippets | https://github.com/honza/vim-snippets Plug 'othree/eregex.vim' "Real regexes in vim | https://github.com/othree/eregex.vim Plug 'vim-scripts/DoxygenToolkit.vim' "Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim Plug 'mhinz/vim-signify' "Git information inline | https://github.com/mhinz/vim-signify Plug 'https://github.com/jiangmiao/auto-pairs' "Automatic pairs | https://github.com/jiangmiao/auto-pairs Plug 'https://github.com/Valloric/YouCompleteMe' " "Autocompletion | https://github.com/Valloric/YouCompleteMe Plug 'https://github.com/xolox/vim-easytags' "Vim tags | https://github.com/xolox/vim-easytags Plug 'https://github.com/xolox/vim-misc' "Misc (required for easytags) | https://github.com/xolox/vim-misc Plug 'https://austenwares.com/gogs/vim/vim-java-getset.git' "Java getters and setters| gogs@austenwares.com:stonewareslord/vim-java-getset.git " } " Style { Plug 'nathanaelkane/vim-indent-guides' "Indentation guides | https://github.com/nathanaelkane/vim-indent-guides Plug 'bling/vim-airline' "Bottom status bar | https://github.com/bling/vim-airline Plug 'stonewareslord/vim-colors' "Theme pack | https://github.com/spf13/vim-colors Plug 'godlygeek/csapprox' "256 color vim in terminal | https://github.com/godlygeek/csapprox " } " Syntax { Plug 'elzr/vim-json' "JSON highlighting | https://github.com/elzr/vim-json Plug 'groenewege/vim-less' "LESS highlighting | https://github.com/groenewege/vim-less Plug 'pangloss/vim-javascript' "JS syntax and indentation | https://github.com/pangloss/vim-javascript Plug 'superbrothers/vim-vimperator' "Vimperator for vim | https://github.com/superbrothers/vim-vimperator Plug 'PotatoesMaster/i3-vim-syntax' "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax Plug 'https://github.com/fatih/vim-go' "go syntax | https://github.com/fatih/vim-go Plug 'https://github.com/evidens/vim-twig' "Twig highlighting | https://github.com/evidens/vim-twig " } " Misc { Plug 'mattn/flappyvird-vim' "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim Plug 'jamessan/vim-gnupg' "GPG support | https://github.com/jamessan/vim-gnupg " } " Unused { "Plug 'vim-scripts/DirDiff.vim' "Directory diff | https://github.com/vim-scripts/DirDiff.vim "Plug 'https://github.com/kien/rainbow_parentheses.vim' " "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim "Plug 'vim-scripts/SyntaxRange' "Range of syntaxes | https://github.com/vim-scripts/SyntaxRange "Plug 'https://github.com/majutsushi/tagbar' " " | https://github.com/majutsushi/tagbar "Plug 'Rykka/colorv.vim' " "Color selection in vim | https://github.com/Rykka/colorv.vim "Plug 'https://github.com/joonty/vdebug' " "Php debugging | https://github.com/joonty/vdebug "Plug 'https://github.com/zenbro/mirror.vim' " "Edit files remotely | https://github.com/zenbro/mirror.vim " } call plug#end() filetype plugin indent on if exists("+undofile") if isdirectory($HOME . '/.vim/undo')==0 :silent !mkdir -p ~/.vim/undo > /dev/null 2>&1 endif set undodir=./.vim-undo// set undodir+=~/.vim/undo// set undofile endif augroup autosave au! au BufWritePost .vimrc,vimrc source % au BufWritePost .Xresources,Xresources silent! !xrdb % augroup END augroup vimrcEx au! " When editing a file, always jump to the last known cursor position. autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <=line("$") | \ exe "normal g`\"" | \ endif augroup END if has('gui_running') set guioptions-=T else if &term=='xterm' || &term=='screen' set t_Co=256 endif "colorscheme torte endif silent! colorscheme fruity function! Initialize() if has("win32") if empty(glob("~/_vim/autoload/plug.vim")) cd ~ silent !mkdir vimfiles cd vimfiles silent !mkdir autoload silent !mkdir plugin silent !mkdir backup silent !mkdir undo silent !mkdir tmp cd autoload silent !powershell -command "& { iwr https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -OutFile plug.vim }" silent! so ~/_vimrc silent! PlugInstall q endif else if empty(glob("~/.vim/autoload/plug.vim")) silent !mkdir -p ~/.vim/autoload silent !mkdir -p ~/.vim/plugin silent !mkdir -p ~/.vim/backup silent !mkdir -p ~/.vim/undo silent !mkdir -p ~/.vim/tmp silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim silent! so ~/.vimrc silent! PlugInstall q endif endif endfunction if !exists('g:ycm_semantic_triggers') let g:ycm_semantic_triggers = {} endif let g:ycm_semantic_triggers.tex = [ \ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*' \ ] set guifont=Fixed\ Medium\ Semi-Condensed\ 10 inoremap =g:UltiSnips_Complete() map b JavagetsetInsertBothGetterSetter map a O:Autoformat:%S/\n\n+/\r/