From 861176bcb7ac4686a1786ef33977942584d2fe3a Mon Sep 17 00:00:00 2001 From: xero Date: Sun, 26 Jul 2015 20:12:44 -0400 Subject: start using the silver searcher's Usage: ag [FILE-TYPE] [OPTIONS] PATTERN [PATH] Recursively search for PATTERN in PATH. Like grep or ack, but faster. Example: ag -i foo /bar/ Output Options: --ackmate Print results in AckMate-parseable format -A --after [LINES] Print lines after match (Default: 2) -B --before [LINES] Print lines before match (Default: 2) --[no]break Print newlines between matches in different files (Enabled by default) -c --count Only print the number of matches in each file. (This often differs from the number of matching lines) --[no]color Print color codes in results (Enabled by default) --color-line-number Color codes for line numbers (Default: 1;33) --color-match Color codes for result match numbers (Default: 30;43) --color-path Color codes for path names (Default: 1;32) --column Print column numbers in results --[no]filename Print file names (Enabled unless searching a single file) -H --[no]heading Print file names before each file's matches (Enabled by default) -C --context [LINES] Print lines before and after matches (Default: 2) --[no]group Same as --[no]break --[no]heading -g PATTERN Print filenames matching PATTERN -l --files-with-matches Only print filenames that contain matches (don't print the matching lines) -L --files-without-matches Only print filenames that don't contain matches --[no]numbers Print line numbers. Default is to omit line numbers when searching streams -o --only-matching Prints only the matching part of the lines --print-long-lines Print matches on very long lines (Default: >2k characters) --passthrough When searching a stream, print all lines even if they don't match --silent Suppress all log messages, including errors --stats Print stats (files scanned, time taken, etc.) --vimgrep Print results like vim's :vimgrep /pattern/g would (it reports every match on the line) -0 --null --print0 Separate filenames with null (for 'xargs -0') Search Options: -a --all-types Search all files (doesn't include hidden files or patterns from ignore files) -D --debug Ridiculous debugging (probably not useful) --depth NUM Search up to NUM directories deep (Default: 25) -f --follow Follow symlinks -F --fixed-strings Alias for --literal for compatibility with grep -G --file-search-regex PATTERN Limit search to filenames matching PATTERN --hidden Search hidden files (obeys .*ignore files) -i --ignore-case Match case insensitively --ignore PATTERN Ignore files/directories matching PATTERN (literal file/directory names also allowed) --ignore-dir NAME Alias for --ignore for compatibility with ack. -m --max-count NUM Skip the rest of a file after NUM matches (Default: 10,000) --one-device Don't follow links to other devices. -p --path-to-agignore STRING Use .agignore file at STRING -Q --literal Don't parse PATTERN as a regular expression -s --case-sensitive Match case sensitively -S --smart-case Match case insensitively unless PATTERN contains uppercase characters (Enabled by default) --search-binary Search binary files for matches -t --all-text Search all text files (doesn't include hidden files) -u --unrestricted Search all files (ignore .agignore, .gitignore, etc.; searches binary and hidden files as well) -U --skip-vcs-ignores Ignore VCS ignore files (.gitignore, .hgignore, .svnignore; still obey .agignore) -v --invert-match -w --word-regexp Only match whole words -z --search-zip Search contents of compressed (e.g., gzip) files File Types: The search can be restricted to certain types of files. Example: ag --html needle - Searches for 'needle' in files with suffix .htm, .html, .shtml or .xhtml. For a list of supported file types run: ag --list-file-types command --- vim/.vimrc | 250 ++++++++++++++++++++++++++------------------------- zsh/.zsh/aliases.zsh | 1 + 2 files changed, 130 insertions(+), 121 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 06570ec..50155b0 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -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 + + " ┏━┓╺┳╸┏━┓╺┳╸╻ ╻┏━┓╻ ╻┏┓╻┏━╸ + " ┗━┓ ┃ ┣━┫ ┃ ┃ ┃┗━┓┃ ┃┃┗┫┣╸ + " ┗━┛ ╹ ╹ ╹ ╹ ┗━┛┗━┛┗━╸╹╹ ╹┗━╸ + " 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" -- cgit v1.2.1