" plug: curl -fLo $HOME/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim " plug: curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim " mkdir -p $HOME/.vim/swapfiles/ " neovim location: ~/.config/nvim/init.vim " yarn global add js-beautify prettier " mkdir -p $HOME/go/src/github.com/tobstarr " git clone https://github.com/tobstarr/UltiSnips $HOME/go/src/github.com/tobstarr/UltiSnips " ln -nfs ~/src/github.com/tobstarr/UltiSnips ~/.vim/UltiSnips " ln -nfs ~/src/github.com/tobstarr/UltiSnips ~/.config/nvim/UltiSnips filetype plugin off call plug#begin('~/.vim/plugged') Plug 'hashivim/vim-terraform' Plug 'mileszs/ack.vim' Plug 'SirVer/ultisnips' " Plug 'airblade/vim-gitgutter' Plug 'benmills/vimux' " Plug 'vim-airline/vim-airline' " Plug 'vim-airline/vim-airline-themes' Plug 'elzr/vim-json' Plug 'fatih/vim-go' " { 'tag': 'v1.21', 'do': ':GoUpdateBinaries' } Plug 'honza/dockerfile.vim' Plug 'honza/vim-snippets' Plug 'jamessan/vim-gnupg' Plug 'kien/ctrlp.vim' " Plug 'majutsushi/tagbar' " Plug 'morhetz/gruvbox' Plug 'mtth/scratch.vim' Plug 'scrooloose/nerdtree' Plug 'scrooloose/syntastic' Plug 'slim-template/vim-slim' Plug 'thinca/vim-localrc' Plug 'toyamarinyon/vim-swift' Plug 'tpope/vim-abolish' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' Plug 'tpope/vim-markdown' Plug 'tpope/vim-rake' Plug 'tpope/vim-rails' Plug 'iurifq/ctrlp-rails.vim' Plug 'janko-m/vim-test' Plug 'rust-lang/rust.vim' Plug 'Quramy/tsuquyomi' Plug 'leafgarland/typescript-vim' Plug 'Shougo/vimproc.vim' Plug 'uarun/vim-protobuf' Plug 'warbear0129/vim-qtpl' Plug 'davidhalter/jedi-vim' Plug 'racer-rust/vim-racer' " Plug 'Valloric/YouCompleteMe' " Plug 'Shougo/neocomplete' Plug 'mattn/emmet-vim' Plug 'Shougo/unite.vim' " Plug 'powerman/vim-plugin-autosess' Plug 'posva/vim-vue' Plug 'jparise/vim-graphql' Plug 'godlygeek/tabular' Plug 'slashmili/alchemist.vim' Plug 'elixir-editors/vim-elixir' " Plug 'neoclide/coc.nvim' call plug#end() filetype plugin indent on :nmap ; : " terraform let g:terraform_align=1 " let g:terraform_fmt_on_save=1 " rust set hidden let g:racer_experimental_completer = 1 au FileType rust nmap gd (rust-def) au FileType rust map gd au FileType rust nmap K (rust-doc) let g:deoplete#enable_at_startup = 1 "call neocomplete#util#set_default_dictionary( " \ 'g:neocomplete#sources#omni#input_patterns', " \ 'elm', " \ '\.') set directory=$HOME/.vim/swapfiles/ " let g:tsuquyomi_disable_quickfix = 1 let g:syntastic_typescript_checkers = ['tsuquyomi'] let g:typescript_indent_disable = 1 " let g:ycm_semantic_triggers = { " \ 'elm' : ['.'], " \} if has('nvim') :tnoremap let g:terminal_scrollback_buffer_size=100000 endif let s:hidden_all = 0 function! ToggleHiddenAll() if s:hidden_all == 0 let s:hidden_all = 1 set noshowmode set noruler set laststatus=0 set noshowcmd else let s:hidden_all = 0 set showmode set ruler set laststatus=2 set showcmd endif endfunction nnoremap :call ToggleHiddenAll() " colorscheme gruvbox set background=dark let g:vim_json_syntax_conceal = 0 let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" hi CursorLine cterm=NONE ctermbg=lightgrey ctermfg=black guibg=darkred guifg=white hi CursorColumn cterm=NONE ctermbg=lightgrey ctermfg=black guibg=darkred guifg=white set t_Co=256 let g:syntastic_go_go_build_args = "-o /dev/null" " elm let g:elm_format_autosave = 1 let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:elm_syntastic_show_warnings = 1 let g:elm_make_show_warnings = 1 " " let g:js_fmt_autosave = 1 " let g:js_fmt_command = "jsfmt" " set list set relativenumber set number " seems to work only in vim >= 7.4 set nolinebreak set showmatch set showcmd set ruler set incsearch set backspace=indent,eol,start set wildmenu set wildignore+=tmp/*,*.o,*.obj,.git set nocompatible set nofoldenable " set dir=/tmp let $BASH_ENV = "~/.bash_aliases" set shell=/bin/bash\ -l set grepprg=ag let g:ackprg = "ag" let g:ctrlp_custom_ignore = '\v[\/]Godeps\/_workspace' let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""' command! -nargs=1 Silent execute ':silent !'. | execute ':redraw!' let mapleader="," set guifont=Courier\ 11\ Pitch\ 8 au BufRead,BufNewFile *.md setlocal textwidth=80 autocmd BufNewFile,BufRead *.ego set ft=html autocmd BufNewFile,BufRead *.elm set ft=elm autocmd BufNewFile,BufRead *.elm set shiftwidth=4 softtabstop=4 autoindent autocmd BufNewFile,BufRead *.tsx set ft=typescript formatprg=prettier autocmd BufNewFile,BufRead *.ts set ft=typescript autocmd BufNewFile,BufRead *.qtpl set ft=html autocmd BufNewFile,BufRead Dockerfile.* set ft=dockerfile autocmd BufNewFile,BufRead Jenkinsfile set ft=groovy autocmd BufNewFile,BufRead *.go set ft=go autocmd BufNewFile,BufRead *.json set ft=json nolist tabstop=2 shiftwidth=2 expandtab autoindent autocmd BufNewFile,BufRead *.swift set ft=swift autocmd BufNewFile,BufRead *.md set ft=markdown noexpandtab autocmd FileType go nnoremap K :GoDoc " autocmd FileType go map ,, :call TouchWipGo() autocmd FileType go nmap ,i (go-info) autocmd FileType go setlocal nolist autocmd FileType go set makeprg=make autocmd FileType go nmap ,e (go-iferr) autocmd FileType go set tabstop=4 shiftwidth=4 autocmd FileType go map gd autocmd FileType go map ,rn :GoRename autocmd FileType go map ,d :GoDeclsDir autocmd FileType go nnoremap gd :GoDef autocmd FileType go map gt :wall:GoTestCompile autocmd FileType go map gT :w:GoTest autocmd FileType go map ga :w:GoAlternate autocmd FileType go map gb :w:GoBuild autocmd FileType go map gv :w:GoVet autocmd FileType elixir map ,e :IEx autocmd FileType elixir map ,f :wall:Mix format autocmd FileType elixir map gt :wall:Mix compile autocmd FileType html set expandtab tabstop=4 shiftwidth=4 autoindent autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType ruby map ,d :CtrlPTag autocmd FileType ruby map ,rm :CtrlPModel autocmd FileType ruby map ,rc :CtrlPControllers autocmd FileType ruby map ,rs :CtrlPSpecs autocmd FileType ruby map ,f :!ctags -R --languages=ruby --exclude=.git --exclude=log autocmd FileType ruby set expandtab autocmd FileType ruby set shiftwidth=2 autocmd FileType ruby set tabstop=2 autocmd FileType javascript set expandtab autocmd FileType javascript set shiftwidth=2 autocmd FileType javascript set tabstop=2 autocmd FileType vue set expandtab autocmd FileType vue set shiftwidth=2 autocmd FileType vue set tabstop=2 autocmd FileType make set noexpandtab nolist shiftwidth=4 tabstop=4 softtabstop=4 " autocmd FileType typescript set makeprg=make autocmd FileType typescript map ,rn :TsuRenameSymbol autocmd FileType javascript.jsx,javascript setlocal formatprg=prettier\ --stdin\ --trailing-comma=all\ --no-semi autocmd FileType html setlocal formatprg=html-beautify autocmd FileType json setlocal formatprg=jq\ . autocmd FileType elm map ,b :ElmMake % autocmd FileType elm map K :ElmShowDocs autocmd FileType elm map ,d :CtrlPTag let g:elm_format_autosave = 1 let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:elm_syntastic_show_warnings = 1 function! GenerateCtags() :!ctags -R --languages=ruby --exclude=.git --exclude=log . endfunction command! GenerateCtags call GenerateCtags() " expand to current directory cnoremap %% =expand('%:h').'/' nnoremap map tf :TestFile map tl :TestLast map tn :TestNearest map tv :TestVisit filetype plugin on set ignorecase set smartcase set hidden set laststatus=2 set tw=0 syntax on set history=10000 set expandtab set tabstop=2 set shiftwidth=2 set softtabstop=2 set smartindent set vb set backupdir=/tmp set gfn=Monaco:h16 map map map map scriptencoding utf-8 set encoding=utf-8 " from https://github.com/garybernhardt/dotfiles/blob/master/.vimrc#L182 function! RenameFile() let old_name = expand('%') let new_name = input('New file name: ', expand('%'), 'file') if new_name != '' && new_name != old_name exec ':saveas ' . new_name exec ':silent !rm ' . old_name redraw! endif endfunction let g:initwd = getcwd() function! TouchWipGo() exec ':w' " exec ':GoTestCompile' exec ':Silent touch ' . g:initwd . '/.wip.run' endfunction function! TouchWip() exec ':w' exec ':Silent touch ' . g:initwd . '/.wip.run' endfunction map ,. :w:VimuxRunLastCommand map ,, :call TouchWip() map ,m :make " map ,. :w:Silent touch wip.run map ,/ :VimuxRunLastCommand map ,, :call TouchWip() map ,c :set relativenumber!:set number! map ,ff :CtrlPClearCache map ,g :normal gg=G map ,l :File map ,n :call RenameFile() map ,p :set paste! map ,q :q map ,t :CtrlP . map ,v :VimuxPromptCommand map ,w :w map ,x :x map ,i :normal gggqG command! -nargs=* Make make | cwindow 3 command! -nargs=* Todoist :!td create autocmd QuickFixCmdPost [^l]* nested cwindow autocmd QuickFixCmdPost l* nested lwindow " go let g:godef_split=0 let g:go_auto_sameids=1 let g:go_autodetect_gopath = 0 let g:go_def_mode='gopls' let g:go_fmt_command='goimports' let g:go_info_mode = 'gopls' let g:go_rename_command = "gopls" " set spell spelllang=en_us map ,s :setlocal spell! set nohlsearch command! File normal :echo expand('%:p') command! ReformatJson normal :%!jq . % command! -range AddJsonTags ,normal ^vEyA `json:""crsA,omitempty"`^j command! -range AddSQLTags ,normal ^vEyA `sql:""crsA"`^j command! -range AddXmlTags ,normal ^vEyA `xml:""guawA,attr"`^j command! -range JsonToStruct ,normal ^wvi"yI" string `json:f:s` //^crmj^ command! -range StructToMap ,normal vEyI"": m.Ea, CI"lcrsj^ command! -range XmlToStruct ,normal ^xvt>yI" string `xml:"f>s"` //^crmj command! -range InlineErr ,normal ^wi:Iif A; err != nil {jdd call ToggleHiddenAll()