diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add index cf28f5e..40dbf2e 100644 --- a/vim/spell/en.utf-8.add +++ b/vim/spell/en.utf-8.add @@ -83,3 +83,6 @@ youtube HD playlists refactor +rebasing +Workflow +wiki diff --git a/vim/spell/en.utf-8.add.spl b/vim/spell/en.utf-8.add.spl index f5ae89b..cbd1c0c 100644 Binary files a/vim/spell/en.utf-8.add.spl and b/vim/spell/en.utf-8.add.spl differ diff --git a/vimrc b/vimrc index d034efa..1284d99 100644 --- a/vimrc +++ b/vimrc @@ -19,6 +19,7 @@ Plug 'tpope/vim-classpath' " Plug 'Valloric/YouCompleteMe' Plug 'rking/ag.vim' Plug 'scrooloose/syntastic' +Plug 'nelstrom/vim-qargs' " Colors Plug 'reedes/vim-colors-pencil' @@ -128,11 +129,9 @@ imap " Notes and other helpers map bb :!bundle install -map gs :Gstatus -map gw :!git add . && git commit -m 'WIP' map pn :sp ~/.personal-files/brain/writing/stack.txt map sn :sp ~/.personal-files/documents/software-notes/clojure.md -map rn :sp ~/.personal-files/work/dive-networks/files/notes/refactoring-notes.md +map rn :sp ~/.work-files/dive-networks/files/notes/refactoring-notes.md """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -196,6 +195,51 @@ augroup END """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" :set statusline=%<%f\ (%{&ft})\ %-4(%m%)%=%-19(%3l,%02c%03V%) +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" GIT +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +map gb :Gblame + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" SEARCHING +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +map gs :let @/ = "" + +" Replace the selected text in all files within the repo +function! GlobalReplaceIt(confirm_replacement) + if exists(':Ggrep') + " let term = @/ + " if empty(term) + call inputsave() + let term = input('Enter search term: ') + call inputrestore() + " else + " echo '\nReplacing '.term + " endif + call inputsave() + let replacement = input('Enter replacement: ') + call inputrestore() + if a:confirm_replacement + let confirm_opt = 'c' + else + let confirm_opt = 'e' + endif + execute 'Ggrep '.term + execute 'Qargs | argdo %s/'.term.'/'.replacement.'/g'.confirm_opt.' | update' + else + echo "Unable to search since you're not in a git repo" + endif +endfunction +map gg :call GlobalReplaceIt(0) +map gr :call GlobalReplaceIt(1) + +function! Search() + let term = input('Grep search term: ') + if term != '' + exec 'Ag "' . term . '"' + endif +endfunction +map s :call Search() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " MISC KEY MAPS @@ -264,9 +308,6 @@ map map m :vsplit map mm :split -map gg :topleft 100 :split Gemfile -map gr :topleft 100 :split config/routes.rb - " Map paste and nonumber map p :set paste! paste? map o :set number! number? @@ -318,19 +359,6 @@ function! RenameFile() endfunction map n :call RenameFile() - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" GREP SEARCH -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -function! Search() - let term = input('Grep search term: ') - if term != '' - exec 'Ag "' . term . '"' - endif -endfunction -map s :call Search() - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " PROMOTE VARIABLE TO RSPEC LET """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""