Add grep search

This commit is contained in:
Michael Campagnaro 2012-11-13 12:05:37 -05:00
parent 043ec0e07b
commit 07456e7b02
2 changed files with 21 additions and 12 deletions

30
.vimrc
View File

@ -7,20 +7,20 @@ call pathogen#helptags()
" ctrlp.vim Config
set runtimepath^=~/.vim/bundle/ctrlp.vim
map <leader>gR :call ShowRoutes()<cr>
map <leader>gv :CtrlP app/views<cr>
" Command-T Config
map <leader>gv :CommandTFlush<cr>\|:CommandT app/views<cr>
map <leader>gc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
map <leader>gm :CommandTFlush<cr>\|:CommandT app/models<cr>
map <leader>gh :CommandTFlush<cr>\|:CommandT app/helpers<cr>
map <leader>gl :CommandTFlush<cr>\|:CommandT lib<cr>
map <leader>gp :CommandTFlush<cr>\|:CommandT public<cr>
map <leader>gs :CommandTFlush<cr>\|:CommandT public/stylesheets/sass<cr>
map <leader>gf :CommandTFlush<cr>\|:CommandT features<cr>
map <leader>gv :CtrlP app/views<cr>
map <leader>gc :CtrlP app/controllers<cr>
map <leader>gm :CtrlP app/models<cr>
map <leader>gh :CtrlP app/helpers<cr>
map <leader>gl :CtrlP<cr> lib<cr>
map <leader>gp :CtrlP public<cr>
map <leader>gs :CtrlP public/stylesheets/sass<cr>
map <leader>gf :CtrlP features<cr>
map <leader>gg :topleft 100 :split Gemfile<cr>
map <leader>gt :CommandTFlush<cr>\|:CommandTTag<cr>
map <leader>f :CommandTFlush<cr>\|:CommandT<cr>
map <leader>F :CommandTFlush<cr>\|:CommandT %%<cr>
map <leader>f :CtrlP<cr>
map <leader>F :CtrlP %%<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" BASIC EDITING CONFIGURATION
@ -150,6 +150,14 @@ function! RenameFile()
endfunction
map <leader>n :call RenameFile()<cr>
function! Search()
let term = input('Grep search term: ')
if term != ''
exec '!grep ' . term . ' .'
endif
endfunction
map <leader>s :call Search()<cr>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PROMOTE VARIABLE TO RSPEC LET
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

3
.zshrc
View File

@ -31,7 +31,7 @@ alias ls='ls -G'
alias ll='ls -lG'
alias l='ls -laG'
alias duh='du -csh'
export GREP_OPTIONS="-n --color"
export GREP_OPTIONS="-nr --color"
# Unbreak history
export HISTSIZE=10000
@ -41,6 +41,7 @@ export SAVEHIST=$HISTSIZE
# Alias
alias r=rails
alias g=git
alias gco='git co'
alias gst='git st'
alias gci='git ci'
alias gp='git push'