Extracted vim-git-grep-rails-partial plugin

This commit is contained in:
yan 2011-12-08 23:40:18 -08:00 committed by Yan Pritzker
parent 77a6f1fb1c
commit 24507c4de3
4 changed files with 13 additions and 10 deletions

3
.gitmodules vendored
View File

@ -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

View File

@ -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

@ -0,0 +1 @@
Subproject commit 68b9d4a8e64172ee168bf9329bc86138a80982a6

11
vimrc
View File

@ -230,6 +230,7 @@ nnoremap <silent> K :GitGrep <cword><CR>
"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 <silent> P :GitGrepCurrentPartial<CR>
" create <%= foo %> erb tags using Ctrl-k in edit mode
imap <silent> <C-K> <%= %><Esc>3hi
@ -273,16 +274,6 @@ set so=8
" p to paste it, C-c to return to command mode, and CR to execute
nmap <silent> Cc yy:<C-f>p<C-c><CR>
" 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 <silent> P :GitGrepCurrentPartial<CR>
" 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)