From 24507c4de3f157ff540e006019e24592f6af86c0 Mon Sep 17 00:00:00 2001 From: yan Date: Thu, 8 Dec 2011 23:40:18 -0800 Subject: [PATCH] Extracted vim-git-grep-rails-partial plugin --- .gitmodules | 3 +++ README.md | 8 ++++++++ vim/bundle/skwp-vim-git-grep-rails-partial | 1 + vimrc | 11 +---------- 4 files changed, 13 insertions(+), 10 deletions(-) create mode 160000 vim/bundle/skwp-vim-git-grep-rails-partial diff --git a/.gitmodules b/.gitmodules index d806c06..8562680 100644 --- a/.gitmodules +++ b/.gitmodules @@ -112,3 +112,6 @@ [submodule "vim/bundle/wincent-Command-T"] path = vim/bundle/wincent-Command-T url = https://github.com/wincent/Command-T +[submodule "vim/bundle/skwp-vim-git-grep-rails-partial"] + path = vim/bundle/skwp-vim-git-grep-rails-partial + url = https://github.com/skwp/vim-git-grep-rails-partial diff --git a/README.md b/README.md index a05e3fb..067d43c 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,14 @@ To use the gitconfig (some of the git bash aliases rely on my git aliases) ln -s ~/.dotfiles/gitconfig ~/.gitconfig +Since the gitconfig doesn't contain the user info, I recommend using env variables. +Put the following in your ~/.secrets file which is automatically referenced by the provided zshrc: + + export GIT_AUTHOR_NAME=yourname + export GIT_AUTHOR_EMAIL=you@domain.com + export GIT_COMITTER_NAME=yourname + export GIT_COMITTER_EMAIL=you@domain.com + Some of the customizations provided include: * git l - a much more usable git log diff --git a/vim/bundle/skwp-vim-git-grep-rails-partial b/vim/bundle/skwp-vim-git-grep-rails-partial new file mode 160000 index 0000000..68b9d4a --- /dev/null +++ b/vim/bundle/skwp-vim-git-grep-rails-partial @@ -0,0 +1 @@ +Subproject commit 68b9d4a8e64172ee168bf9329bc86138a80982a6 diff --git a/vimrc b/vimrc index 2ff4adc..412f91e 100644 --- a/vimrc +++ b/vimrc @@ -230,6 +230,7 @@ nnoremap K :GitGrep "open up a git grep line, with a quote started for the search "mnemonic: the letter O looks like a magnifying glass or goggles (search) nnoremap O :GitGrep " +nnoremap P :GitGrepCurrentPartial " create <%= foo %> erb tags using Ctrl-k in edit mode imap <%= %>3hi @@ -273,16 +274,6 @@ set so=8 " p to paste it, C-c to return to command mode, and CR to execute nmap Cc yy:p -" Find references to the currently opened partial (file) -" by pressing P in command mode -function GitGrepCurrentPartial() - " :call GitGrep(substitute(substitute(expand('%<'),'.*\/_','','g'),'.html','','g')) - :call GitGrep(substitute(substitute(substitute(expand('%<'),'.*\/','','g'), '$_','','g'),'.html','','g')) -endfunction -command! GitGrepCurrentPartial call GitGrepCurrentPartial() -nnoremap P :GitGrepCurrentPartial - - " Remember cursor position and etc when you leave windows " au BufWinLeave * silent! mkview "make vim save view (state) (folds, cursor, etc) " au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursorrsor, etc)