From ba510e401c78a58a8772e48e1f9c17f7eb086a77 Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 5 Feb 2012 12:50:35 -0800 Subject: [PATCH] ,gd alias for git-grepping a ruby function definition --- README.md | 1 + vim/plugin/settings/git-grep.vim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index ef474b0..04f84db 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke * `Cmd-*` - highlight all occurrences of current word (similar to regular `*` except doesn't move) * `,hl` - toggle search highlight on and off * `,gg` - GitGrep command line with a quote pretyped (close the quote yourself) + * `,gd` - GitGrep def (greps for 'def [function name]') when cursor is over the function name * `,gcp` - GitGrep Current Partial to find references to the current view partial * `//` - clear the search * `,q/` - quickfix window with last search (stolen from Steve Losh) diff --git a/vim/plugin/settings/git-grep.vim b/vim/plugin/settings/git-grep.vim index 386ba16..3359e28 100644 --- a/vim/plugin/settings/git-grep.vim +++ b/vim/plugin/settings/git-grep.vim @@ -18,3 +18,6 @@ vnoremap K :execute GitGrep(GetVisual()) "git grep current word up to the next exclamation point using ,K nnoremap ,K viwf!:execute GitGrep(GetVisual()) +"grep for 'def foo' +nnoremap ,gd :GitGrep 'def ' +