From e38dbf3b92415b4bdb03c2c8457f5346f6488ddc Mon Sep 17 00:00:00 2001 From: David Sargeant Date: Fri, 19 May 2017 18:06:40 -0400 Subject: [PATCH] Update script. --- .agignore | 2 ++ .gitconfig | 51 ++++++++++++++++----------------- .gitignore_global | 1 + .zshrc | 10 +++++++ init.vim | 73 +++++++++++++++++++++++++++++++++++++++++------ update | 6 ++++ 6 files changed, 108 insertions(+), 35 deletions(-) create mode 100755 update diff --git a/.agignore b/.agignore index 907a7aa..f6b101b 100644 --- a/.agignore +++ b/.agignore @@ -8,4 +8,6 @@ Thumbs.db .ensime .ensime_cache *.iml +.agignore +.tern-port .git diff --git a/.gitconfig b/.gitconfig index 8c7796f..d361665 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,41 +1,40 @@ [alias] - st = status + c = commit + lg = log -p + st = status co = checkout + tree = log --color --graph --pretty=format:'%C(dim white)%h%Creset -%C(magenta)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset' --abbrev-commit -- [user] - name = - email = + name = David Sargeant + email = david@dsargeant.com [core] - editor = vim - excludesfile = ~/.gitignore_global + editor = nvim + excludesfile = /Users/dsargeant/.gitignore_global autocrlf = input + pager = diff-so-fancy | less --tabs=4 -RFX [push] - default = current + default = current [filter "lfs"] - clean = git lfs clean %f - smudge = git lfs smudge %f - required = true + clean = git lfs clean %f + smudge = git lfs smudge %f + required = true [credential] - helper = store + helper = store [mergetool] - keepBackup = false - prompt = false + keepBackup = false + prompt = false [mergetool "Kaleidoscope"] - cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot - trustexitcode = true + cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot + trustexitcode = true [merge] - tool = Kaleidoscope + tool = Kaleidoscope [difftool "Kaleidoscope"] - cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" + cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" [difftool] - prompt = false + prompt = false [diff] - tool = Kaleidoscope -[difftool "sourcetree"] - cmd = /usr/local/bin/ksdiff -w \"$LOCAL\" \"$REMOTE\" - path = -[mergetool "sourcetree"] - cmd = /usr/local/bin/ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot - trustExitCode = true + tool = Kaleidoscope [branch] - autoSetupMerge = always - + autoSetupMerge = always +[commit] + template = /Users/dsargeant/.stCommitMsg diff --git a/.gitignore_global b/.gitignore_global index 4bc7713..713c372 100644 --- a/.gitignore_global +++ b/.gitignore_global @@ -9,3 +9,4 @@ Thumbs.db .ensime_cache *.iml .agignore +.tern-port diff --git a/.zshrc b/.zshrc index 75cf14b..c9d5fc7 100644 --- a/.zshrc +++ b/.zshrc @@ -26,6 +26,7 @@ alias qa="AWS_PROFILE=qa" alias ports="lsof -iTCP -sTCP:LISTEN -n -P" alias b=bible alias jpp="jq '.'" +alias saml="python $PROJ/BoomTownROI/saml-setup.py" # Paging via Vim export MANPAGER="nvim -c 'set ft=man' -" # export PAGER="nvim -c PAGER -" @@ -36,6 +37,7 @@ export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh export FZF_DEFAULT_COMMAND="ag -f -U --hidden -g ''" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +# export FZF_DEFAULT_OPTS="--reverse" # Private Boomtown commands source ~/Projects/boomtown.sh # z (nice autocompletion of frequently used directories) @@ -66,6 +68,10 @@ proj() { cd $PROJ/$1 } +bt() { + proj BoomTownROI +} + # Change to root directory of current git repo gr() { cd "$(git rev-parse --show-cdup)" @@ -238,3 +244,7 @@ serve() { browser-sync start --server --files "$1" fi } + +mongo() { + docker run -d -p 27017:27017 mongo +} diff --git a/init.vim b/init.vim index ec9a759..cc790a0 100644 --- a/init.vim +++ b/init.vim @@ -14,8 +14,10 @@ Plug 'easymotion/vim-easymotion' Plug 'airblade/vim-gitgutter' " Remove trailing whitespace Plug 'ntpeters/vim-better-whitespace' -" Git/Github integration +" Git integration Plug 'tpope/vim-fugitive' +" Github integration +Plug 'tpope/vim-rhubarb' " Extend . command Plug 'tpope/vim-repeat' " Surround text with delimeters @@ -29,7 +31,7 @@ Plug 'cohama/lexima.vim' " Duplicate lines and visual selection Plug 'timkendrick/vim-duplicate' " Display search count -Plug 'henrik/vim-indexed-search' +" Plug 'henrik/vim-indexed-search' " Motions for function arguments Plug 'b4winckler/vim-angry' " Sort motion @@ -38,8 +40,20 @@ Plug 'christoomey/vim-sort-motion' Plug 'dietsche/vim-lastplace' " Recent files (overrides start screen) Plug 'mhinz/vim-startify' +" File commands +Plug 'tpope/vim-eunuch' +" Ack, find and replace +Plug 'wincent/ferret' +" Scratch +Plug 'mtth/scratch.vim' +" Formatter +Plug 'sbdchd/neoformat' " Auto completion Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" Angular/Typescript +" Plug 'Quramy/vim-js-pretty-template', {'for': 'typescript'} +" Flow +" Plug 'flowtype/vim-flow' " Auto completion for Go Plug 'nsf/gocode', {'for': 'go', 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh'} " Go integration for deoplete @@ -51,7 +65,7 @@ Plug 'matchit.zip', {'for': ['html', 'xml', 'sh', 'vim']} " Rust Plug 'rust-lang/rust.vim', {'for': 'rust'} " Scala -Plug 'ensime/ensime-vim', {'for': 'scala'} +Plug 'ensime/ensime-vim', {'for': 'scala', 'commit': '1b32e85f5c1883af3946cf2bf7a39f60801f47b1'} Plug 'derekwyatt/vim-scala', {'for': ['scala', 'sbt.scala']} " VCL Plug 'smerrill/vcl-vim-plugin', {'for': 'vcl'} @@ -59,15 +73,17 @@ Plug 'smerrill/vcl-vim-plugin', {'for': 'vcl'} Plug 'cespare/vim-toml', {'for': 'toml'} " HTML5 Plug 'othree/html5.vim', {'for': ['html', 'xml']} -Plug 'vim-scripts/closetag.vim', {'for': ['html', 'xml']} +" Keybindings for closing tags +Plug 'tpope/vim-ragtag', {'for': ['javascript', 'html', 'xml']} " Format Javascript -Plug 'maksimr/vim-jsbeautify', {'for': ['html', 'xml', 'javascript', 'css', 'json']} +Plug 'maksimr/vim-jsbeautify', {'for': ['html', 'xml', 'css', 'json']} " Javascript (ES6) Plug 'pangloss/vim-javascript', {'for': 'javascript'} " JSX Plug 'mxw/vim-jsx', {'for': 'javascript'} " Snippets Plug 'SirVer/ultisnips' +Plug 'honza/vim-snippets' " Clojure Plug 'guns/vim-clojure-static', {'for': 'clojure'} " F# @@ -118,6 +134,10 @@ set ignorecase smartcase set nohls " Better? completion on command line set wildmenu +" Don't offer to open certain files/directories +set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png,*.ico +set wildignore+=*.pdf,*.psd +set wildignore+=node_modules/*,bower_components/* " Enable mouse in all modes set mouse=a " Omnicomplete @@ -149,6 +169,14 @@ autocmd BufWinEnter,WinEnter term://* startinsert " vim-airline set laststatus=2 let g:airline_theme='murmur' +let g:airline_left_sep='' +let g:airline_right_sep='' +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif +let g:airline_symbols.readonly='RO' +let g:airline_symbols.linenr = '' +let g:airline_symbols.maxlinenr = '' " Horizontal split nmap _ :sp " Backspace closes buffer @@ -193,7 +221,8 @@ nmap w (easymotion-overwin-w) map W (easymotion-bd-W) " Rainbow let g:rainbow_active=1 -let g:rainbow_conf={'ctermfgs': ['darkgray', 'gray']} +let g:rainbow_conf={'ctermfgs': ['darkgray', 'gray'], 'separately': {'html': {}}} +au FileType sh call rainbow#clear() " FZF nmap f :Files nmap b :Buffers @@ -219,6 +248,7 @@ nmap gf :!git fetch nmap gF :!git pull nmap gp :!git push nmap gup :!git push -u origin $(git rev-parse --abbrev-ref HEAD) +nmap gn :GitGutterNextHunk " Open lines without changing to Insert mode nmap o o nmap O O @@ -237,8 +267,10 @@ au FileType scala nmap x :EnRename " Deoplete let g:deoplete#enable_at_startup=1 let g:deoplete#sources = {} -let g:deoplete#sources.scala = ['buffer', 'tags', 'omni'] +" let g:deoplete#sources.scala = ['buffer', 'tags', 'omni'] +let g:deoplete#sources.scala = ['tags', 'omni'] let g:deoplete#omni#input_patterns = {} +" let g:deoplete#omni#input_patterns.scala = ['[^. *\t0-9]\.\w*',': [A-Z]\w', '[\[\t\( ][A-Za-z]\w*'] " Go au FileType go nmap j (go-def) au FileType go nmap t (go-info) @@ -256,9 +288,7 @@ au FileType xml nmap xc :!xmllint --noout % au BufLeave * let b:winview = winsaveview() au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif " Format -" autocmd FileType javascript noremap :call JsBeautify() autocmd FileType json noremap :call JsonBeautify() -autocmd FileType jsx noremap :call JsxBeautify() autocmd FileType html noremap :call HtmlBeautify() autocmd FileType xml noremap :call HtmlBeautify() autocmd FileType css noremap :call CSSBeautify() @@ -271,3 +301,28 @@ nmap r :Startify let g:startify_list_order = ['dir', 'files', 'bookmarks', 'sessions', 'commands'] let g:startify_change_to_dir = 0 let g:startify_custom_header = [] +" Make directory +command MakeDirectory :silent !mkdir -p %:h +" Snippets +let g:UltiSnipsJumpBackwardTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +" Wrap lines in Quickfix +augroup quickfix + autocmd! + autocmd FileType qf setlocal wrap +augroup END +" Scratch +let g:scratch_no_mappings = 1 +nmap si (scratch-insert-reuse) +xmap si (scratch-selection-reuse) +nmap sp :ScratchPreview +nmap se :Scratch +" Angular +" autocmd FileType typescript JsPreTmpl html +" autocmd FileType typescript syn clear foldBraces +" Javascript +let g:javascript_plugin_jsdoc=1 +autocmd FileType javascript.jsx,javascript setlocal formatprg=prettier\ --stdin\ --print-width\ 100\ --single-quote +autocmd BufWritePre *.js Neoformat +let g:neoformat_javascript_prettier = { + \ 'exe': 'prettier', 'args': ['--stdin', '--single-quote', '--print-width 100'], 'stdin': 1 } diff --git a/update b/update new file mode 100755 index 0000000..74dd54c --- /dev/null +++ b/update @@ -0,0 +1,6 @@ +cp ~/.config/nvim/init.vim . +cp ~/.zshrc . +cp ~/.config/nvim/colors/tir_black.vim colors/tir_black.vim +cp ~/.agignore . +cp ~/.gitignore_global . +cp ~/.gitconfig .