diff options
author | xero <x@xero.nu> | 2015-07-26 20:12:44 -0400 |
---|---|---|
committer | xero <x@xero.nu> | 2015-07-26 20:19:47 -0400 |
commit | 6fec392c46280e23be33817f689a9a82a27d68a7 (patch) | |
tree | 01b61a940e3975ab8c078098a4bf45f0fabcd5ac | |
parent | 9b7ec8a95106dcd86bfb46d16edfc1530897940c (diff) | |
download | dotfiles_ascii-6fec392c46280e23be33817f689a9a82a27d68a7.tar.xz dotfiles_ascii-6fec392c46280e23be33817f689a9a82a27d68a7.zip |
start using the silver searcher's ag command
-rw-r--r-- | vim/.vimrc | 250 | ||||
-rwxr-xr-x | zsh/.zsh/aliases.zsh | 1 |
2 files changed, 130 insertions, 121 deletions
@@ -126,124 +126,132 @@ set cursorcolumn " ╹ ┗━╸┗━┛┗━┛╹╹ ╹ ┗━┛ ╹ ┗━┛╹ ╹ " i struggle with the decision to use plugins or a more vanilla vim. but right now i'm feeling sytanx completion, linting, and visual git diffs. don't judge me. " to install from the shell run: -"& git clone https://github.com/gmarik/Vundle.vim.git ~/dotfiles/vim/.vim/bundle/Vundle.vim && vim +BundleInstall +qall && PYTHON=/usr/bin/python2 ~/dotfiles/vim/.vim/bundle/YouCompleteMe/install.sh --clang-completer - -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -Plugin 'gmarik/Vundle.vim' -Plugin 'Valloric/YouCompleteMe' -Plugin 'scrooloose/syntastic' -Plugin 'airblade/vim-gitgutter' -Plugin 'isa/vim-matchit' -Plugin 'shawncplus/phpcomplete.vim' -Plugin 'mustache/vim-mustache-handlebars' -Plugin 'itchyny/lightline.vim' -Plugin 'tpope/vim-fugitive' -call vundle#end() -filetype plugin indent on - -" syntatic http://git.io/syntastic.vim -" linters: (from aur) nodejs-jshint, nodejs-jsonlint, csslint, checkbashisms -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 -highlight SyntasticErrorSign ctermfg=red ctermbg=237 -highlight SyntasticWarningSign ctermfg=yellow ctermbg=237 -highlight SyntasticStyleErrorSign ctermfg=red ctermbg=237 -highlight SyntasticStyleWarningSign ctermfg=yellow ctermbg=237 - -" git-gutter http://git.io/vimgitgutter -let g:gitgutter_realtime = 1 -let g:gitgutter_eager = 1 -let g:gitgutter_diff_args = '-w' -let g:gitgutter_sign_added = '+' -let g:gitgutter_sign_modified = '~' -let g:gitgutter_sign_removed = '-' -let g:gitgutter_sign_removed_first_line = '^' -let g:gitgutter_sign_modified_removed = ':' -let g:gitgutter_max_signs = 1500 -highlight clear SignColumn -highlight GitGutterAdd ctermfg=green ctermbg=237 -highlight GitGutterChange ctermfg=yellow ctermbg=237 -highlight GitGutterDelete ctermfg=red ctermbg=237 -highlight GitGutterChangeDelete ctermfg=red ctermbg=237 - -" vim mustache http://git.io/vim-stash -let g:mustache_abbreviations = 1 - -" ┏━┓╺┳╸┏━┓╺┳╸╻ ╻┏━┓╻ ╻┏┓╻┏━╸ -" ┗━┓ ┃ ┣━┫ ┃ ┃ ┃┗━┓┃ ┃┃┗┫┣╸ -" ┗━┛ ╹ ╹ ╹ ╹ ┗━┛┗━┛┗━╸╹╹ ╹┗━╸ -" lightline http://git.io/lightline -" █▓▒░ wizard status line -set laststatus=2 -let g:lightline = { - \ 'colorscheme': 'sourcerer', - \ 'active': { - \ 'left': [ [ 'filename' ], - \ [ 'readonly', 'fugitive' ] ], - \ 'right': [ [ 'percent', 'lineinfo' ], - \ [ 'fileencoding', 'filetype' ], - \ [ 'fileformat', 'syntastic' ] ] - \ }, - \ 'component_function': { - \ 'modified': 'WizMod', - \ 'readonly': 'WizRO', - \ 'fugitive': 'WizGit', - \ 'filename': 'WizName', - \ 'filetype': 'WizType', - \ 'fileformat' : 'WizFormat', - \ 'fileencoding': 'WizEncoding', - \ 'mode': 'WizMode', - \ }, - \ 'component_expand': { - \ 'syntastic': 'SyntasticStatuslineFlag', - \ }, - \ 'component_type': { - \ 'syntastic': 'error', - \ }, - \ 'separator': { 'left': '▓▒░', 'right': '░▒▓' }, - \ 'subseparator': { 'left': '▒', 'right': '░' } - \ } - -function! WizMod() - return &ft =~ 'help\|vimfiler' ? '' : &modified ? '»' : &modifiable ? '' : '' -endfunction - -function! WizRO() - return &ft !~? 'help\|vimfiler' && &readonly ? 'x' : '' -endfunction - -function! WizGit() - if &ft !~? 'help\|vimfiler' && exists("*fugitive#head") - return fugitive#head() - endif - return '' -endfunction - -function! WizName() - return ('' != WizMod() ? WizMod() . ' ' : '') . - \ ('' != expand('%:t') ? expand('%:t') : '[none]') -endfunction - -function! WizType() - return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : '') : '' -endfunction - -function! WizFormat() - return '' -endfunction - -function! WizEncoding() - return winwidth(0) > 70 ? (strlen(&fenc) ? &enc : &enc) : '' -endfunction - -augroup AutoSyntastic - autocmd! - autocmd BufWritePost *.c,*.cpp call s:syntastic() -augroup END -function! s:syntastic() - SyntasticCheck - call lightline#update() -endfunction +" git clone https://github.com/gmarik/Vundle.vim.git ~/dotfiles/vim/.vim/bundle/Vundle.vim && vim +BundleInstall +qall && PYTHON=/usr/bin/python2 ~/dotfiles/vim/.vim/bundle/YouCompleteMe/install.sh --clang-completer && pacman -S the_silver_searcher +if 1 " boolean for plugin loading + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + Plugin 'gmarik/Vundle.vim' + Plugin 'Valloric/YouCompleteMe' + Plugin 'scrooloose/syntastic' + Plugin 'airblade/vim-gitgutter' + Plugin 'isa/vim-matchit' + Plugin 'shawncplus/phpcomplete.vim' + Plugin 'mustache/vim-mustache-handlebars' + Plugin 'rking/ag.vim' + Plugin 'itchyny/lightline.vim' + Plugin 'tpope/vim-fugitive' + call vundle#end() + filetype plugin indent on + + " syntatic http://git.io/syntastic.vim + " linters: (from aur) nodejs-jshint, nodejs-jsonlint, csslint, checkbashisms + let g:syntastic_always_populate_loc_list = 1 + let g:syntastic_auto_loc_list = 1 + let g:syntastic_check_on_open = 1 + let g:syntastic_check_on_wq = 0 + highlight SyntasticErrorSign ctermfg=red ctermbg=237 + highlight SyntasticWarningSign ctermfg=yellow ctermbg=237 + highlight SyntasticStyleErrorSign ctermfg=red ctermbg=237 + highlight SyntasticStyleWarningSign ctermfg=yellow ctermbg=237 + + " git-gutter http://git.io/vimgitgutter + let g:gitgutter_realtime = 1 + let g:gitgutter_eager = 1 + let g:gitgutter_diff_args = '-w' + let g:gitgutter_sign_added = '+' + let g:gitgutter_sign_modified = '~' + let g:gitgutter_sign_removed = '-' + let g:gitgutter_sign_removed_first_line = '^' + let g:gitgutter_sign_modified_removed = ':' + let g:gitgutter_max_signs = 1500 + highlight clear SignColumn + highlight GitGutterAdd ctermfg=green ctermbg=237 + highlight GitGutterChange ctermfg=yellow ctermbg=237 + highlight GitGutterDelete ctermfg=red ctermbg=237 + highlight GitGutterChangeDelete ctermfg=red ctermbg=237 + + " vim mustache http://git.io/vim-stash + let g:mustache_abbreviations = 1 + + " ag, the silver searcher http://git.io/AEu3dQ + http://git.io/d9N0MA + let g:agprg="ag -i --vimgrep" + let g:ag_highlight=1 + " map \ to the ag command for quick searching + nnoremap \ :Ag<SPACE> + + " ┏━┓╺┳╸┏━┓╺┳╸╻ ╻┏━┓╻ ╻┏┓╻┏━╸ + " ┗━┓ ┃ ┣━┫ ┃ ┃ ┃┗━┓┃ ┃┃┗┫┣╸ + " ┗━┛ ╹ ╹ ╹ ╹ ┗━┛┗━┛┗━╸╹╹ ╹┗━╸ + " lightline http://git.io/lightline + " █▓▒░ wizard status line + set laststatus=2 + let g:lightline = { + \ 'colorscheme': 'sourcerer', + \ 'active': { + \ 'left': [ [ 'filename' ], + \ [ 'readonly', 'fugitive' ] ], + \ 'right': [ [ 'percent', 'lineinfo' ], + \ [ 'fileencoding', 'filetype' ], + \ [ 'fileformat', 'syntastic' ] ] + \ }, + \ 'component_function': { + \ 'modified': 'WizMod', + \ 'readonly': 'WizRO', + \ 'fugitive': 'WizGit', + \ 'filename': 'WizName', + \ 'filetype': 'WizType', + \ 'fileformat' : 'WizFormat', + \ 'fileencoding': 'WizEncoding', + \ 'mode': 'WizMode', + \ }, + \ 'component_expand': { + \ 'syntastic': 'SyntasticStatuslineFlag', + \ }, + \ 'component_type': { + \ 'syntastic': 'error', + \ }, + \ 'separator': { 'left': '▓▒░', 'right': '░▒▓' }, + \ 'subseparator': { 'left': '▒', 'right': '░' } + \ } + + function! WizMod() + return &ft =~ 'help\|vimfiler' ? '' : &modified ? '»' : &modifiable ? '' : '' + endfunction + + function! WizRO() + return &ft !~? 'help\|vimfiler' && &readonly ? 'x' : '' + endfunction + + function! WizGit() + if &ft !~? 'help\|vimfiler' && exists("*fugitive#head") + return fugitive#head() + endif + return '' + endfunction + + function! WizName() + return ('' != WizMod() ? WizMod() . ' ' : '') . + \ ('' != expand('%:t') ? expand('%:t') : '[none]') + endfunction + + function! WizType() + return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : '') : '' + endfunction + + function! WizFormat() + return '' + endfunction + + function! WizEncoding() + return winwidth(0) > 70 ? (strlen(&fenc) ? &enc : &enc) : '' + endfunction + + augroup AutoSyntastic + autocmd! + autocmd BufWritePost *.c,*.cpp call s:syntastic() + augroup END + function! s:syntastic() + SyntasticCheck + call lightline#update() + endfunction +endif diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh index ae43051..cc852d5 100755 --- a/zsh/.zsh/aliases.zsh +++ b/zsh/.zsh/aliases.zsh @@ -35,6 +35,7 @@ alias gm="git merge" alias gr="git rebase" alias gp="git push" alias gpr="hub pull-request" +alias ag="ag --color --color-line-number '0;35' --color-match '46;30' --color-path '4;36'" alias tree='tree -CAFa -I "CVS|*.*.package|.svn|.git|.hg|node_modules|bower_components" --dirsfirst' alias rock="ncmpcpp" alias mixer="alsamixer" |