"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 -s2 -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 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 noremap H ^ nnoremap L $ vnoremap L $h nnoremap Y y$ "Move to end of line inoremap jk inoremap kj "Move to last character of last line noremap G G$ noremap G G$ " } " Buffers { "Control-key movement noremap h noremap j noremap k noremap l "Arrow keys noremap w noremap W noremap :bp noremap :bn "Vertical and horizontal split noremap \| vl noremap - sj "Close buffer "noremap q "Fullscreen buffer noremap z _\| "Go to last buffer noremap " } " Misc { vnoremap * :call VisualSelection('f') vnoremap # :call VisualSelection('b') vnoremap ; : vnoremap < >gv noremap ! :! "Disable F1 noremap noremap! "F2 toggle paste noremap :set invpaste "Better searching noremap / /\v "Addition and subtraction "nnoremap + "nnoremap - "Backspace remove highlights noremap :nohlsearchg "Better save nnoremap :up "Unmap Q noremap Q " } " } " Plugin mappings { "Easymotion map , (easymotion-prefix) "Ctrl-p "nnoremap :CtrlPFunky "Gundo "nnoremap :GundoToggle "Easytags "nnoremap :CtrlPTag "Replacing easytags with ctrl p buffer "nnoremap :CtrlPBuffer "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 guicursor+=a:blinkon0 set mouse-=a " } " Annoyance fixes { "Annoying escape timeouts set ttimeout set ttimeoutlen=0 set notimeout set conceallevel=0 " } " Misc { set tabstop=2 softtabstop=2 shiftwidth=2 expandtab set tags=./tags;/ set wildmode=longest,list,full set formatoptions-=rot set diffopt+=iwhite set noesckeys set modeline set expandtab set history=2048 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=2048 set ttyfast set fileformat=unix set encoding=utf-8 set laststatus=2 set foldmethod=indent set foldnestmax=10 set foldlevel=2 set number set background=dark set t_Co=256 set gdefault set nocompatible set ignorecase set textwidth=0 set path+=** syntax on " } "Polyglot conflicts with another latex editor let g:polyglot_disabled = ['latex'] "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', " \ } "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:ycm_path_to_python_interpreter='/usr/bin/python2.7' "let g:syntastic_cpp_compiler = 'clang++' "let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' "let g:syntastic_cpp_compiler_options = ' -std=c++11' "let g:airline#extensions#whitespace#enabled=0 "let g:airline#extensions#whitespace#show_message=0 "let g:airline#extensions#tmuxline#enabled=1 "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 "inoremap pumvisible() ? "\" : "\" "inoremap pumvisible() ? "\" : "\" "let g:UltiSnipsJumpForwardTrigger="" "let g:UltiSnipsExpandTrigger="" "let g:UltiSnipsListSnippets="" "let g:UltiSnipsEditSplit="vertical" inoremap pumvisible() ? "\" : "\u\" filetype off if has("win32") call plug#begin('~/vimfiles/plugged') else call plug#begin('~/.vim/plugged') endif " Code writing { "Plug 'https://gitea.austenwares.com/vim/vim-autoformat', { 'on': 'Autoformat'} "Adds autoformat command | https://github.com/Chiel92/vim-autoformat Plug 'https://gitea.austenwares.com/vim/vim-surround' "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround "Plug 'https://gitea.austenwares.com/vim/syntastic' "Syntax checker | https://github.com/scrooloose/syntastic "Plug 'https://gitea.austenwares.com/vim/nerdtree', { 'on': 'NERDTreeToggle' } "File browser | https://github.com/scrooloose/nerdtree Plug 'https://gitea.austenwares.com/vim/vim-easymotion' "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion "Plug 'https://gitea.austenwares.com/vim/gundo.vim', { 'on': 'GundoToggle' } "Visual undo | https://github.com/sjl/gundo.vim "Plug 'https://gitea.austenwares.com/vim/vim-exchange' "Exchange two selections of text | https://github.com/tommcdo/vim-exchange "Plug 'https://gitea.austenwares.com/vim/vim-repeat' "Repeat last tpope command with . | https://github.com/tpope/vim-repeat "Plug 'https://gitea.austenwares.com/vim/vim-fugitive' "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive Plug 'https://gitea.austenwares.com/vim/ctrlp.vim' "Fuzzy file search | https://github.com/kien/ctrlp.vim Plug 'https://gitea.austenwares.com/vim/tabular', { 'on': 'Tab' } "Quickly make tables in vim | https://github.com/godlygeek/tabular "Plug 'https://gitea.austenwares.com/vim/UltiSnips' "Adds snippet support | https://github.com/sirver/UltiSnips "Plug 'https://gitea.austenwares.com/vim/vim-snippets' "Add snippets | https://github.com/honza/vim-snippets Plug 'https://gitea.austenwares.com/vim/eregex.vim' "Real regexes in vim | https://github.com/othree/eregex.vim Plug 'https://gitea.austenwares.com/vim/vim-signify' "Git information inline | https://github.com/mhinz/vim-signify Plug 'https://gitea.austenwares.com/vim/auto-pairs' "Automatic pairs | https://github.com/jiangmiao/auto-pairs "Plug 'https://gitea.austenwares.com/vim/YouCompleteMe' "Autocompletion | https://github.com/Valloric/YouCompleteMe "Plug 'https://gitea.austenwares.com/vim/vim-java-getset.git' "Java getters and setters| https://gitea.austenwares.com/vim/vim-java-getset.git "Plug 'https://gitea.austenwares.com/vim/double-tap.git' "Double tap for comments " } " Style { "Plug 'https://gitea.austenwares.com/vim/vim-indent-guides' "Indentation guides | https://github.com/nathanaelkane/vim-indent-guides "Plug 'https://gitea.austenwares.com/vim/vim-airline' "Bottom status bar | https://github.com/bling/vim-airline Plug 'https://gitea.austenwares.com/vim/vim-colors' "Theme pack | https://github.com/spf13/vim-colors Plug 'https://gitea.austenwares.com/vim/csapprox' "256 color vim in terminal | https://github.com/godlygeek/csapprox " } " Syntax { "Plug 'https://gitea.austenwares.com/vim/vimtex' "Latex | https://github.com/lervag/vimtex Plug 'https://gitea.austenwares.com/vim/vim-polyglot' "Many languages | https://github.com/sheerun/vim-polyglot "Plug 'https://gitea.austenwares.com/vim/vim-vimperator' "Vimperator for vim | https://github.com/superbrothers/vim-vimperator "Plug 'https://gitea.austenwares.com/vim/i3-vim-syntax' "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax " } " Misc { "Plug 'https://gitea.austenwares.com/vim/flappyvird-vim', { 'on': [] } "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim "Plug 'https://gitea.austenwares.com/vim/vim-gnupg' "GPG support | https://github.com/jamessan/vim-gnupg Plug 'https://gitea.austenwares.com/vim/vim-bracketed-paste' "Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste "Plug 'https://gitea.austenwares.com/vim/HiCursorWords' "Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306 "Plug 'https://github.com/chrisbra/NrrwRgn' "Narrow region | https://github.com/chrisbra/NrrwRgn " } " Unused { "Plug 'https://gitea.austenwares.com/vim/mirror.vim' " "Edit files remotely | https://github.com/zenbro/mirror.vim " } " Staging { "Plug 'https://gitea.austenwares.com/vim/vim-symfony' "Plug 'dracula/vim' "Plug 'idanarye/vim-vebugger' "Debugger | https://github.com/idanarye/vim-vebugger " } 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 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 " set t_Co=256 "endif silent! colorscheme fruity function! Initialize() if has("win32") 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 else silent !mkdir -p ~/.vim/autoload ~/.vim/plugin ~/.vim/backup ~/.vim/undo ~/.vim/tmp silent !curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim silent! so ~/.vimrc endif !vim +"PlugClean" +"PlugInstall" +"PlugUpdate" +"qa" q endfunction set guifont=Gohu\ GohuFont "inoremap =g:UltiSnips_Complete() "map b JavagetsetInsertBothGetterSetter "map a O:Autoformat:v/\S/d:nohlsearch "inoremap getline(".") =~ '^\s*\([#"]\)\s*$' ? "\" : "\"