Extracted vim-git-grep-rails-partial plugin
This commit is contained in:
11
vimrc
11
vimrc
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user