Skip to content

Commit

Permalink
Outlined all proposed <Plug> mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
amerlyq committed Nov 30, 2015
1 parent ac36552 commit ebf90d1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugin/ag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@ command! -bang -nargs=* -complete=help LAgHelp call ag#AgHelp('lgrep<bang>',<q-a
nnoremap <silent> <Plug>(ag-group) :call ag#AgGroup(v:count, 0, '', '')<CR>
xnoremap <silent> <Plug>(ag-group) :<C-u>call ag#AgGroup(v:count, 1, '', '')<CR>
nnoremap <silent> <Plug>(ag-group-last) :call ag#AgGroupLast(v:count)<CR>
" TODO: add <Plug> mappings for Ag* and LAg*


if !(exists("g:ag_no_default_mappings") && g:ag_no_default_mappings)
let s:ag_mappings = [
\ ['nx', '<Leader>af', '<Plug>(ag-qf)'],
\ ['nx', '<Leader>aa', '<Plug>(ag-qf-add)'],
\ ['nx', '<Leader>ab', '<Plug>(ag-qf-buffer)'],
\ ['nx', '<Leader>as', '<Plug>(ag-qf-searched)'],
\ ['nx', '<Leader>aF', '<Plug>(ag-qf-file)'],
\ ['nx', '<Leader>aH', '<Plug>(ag-qf-help)'],
\
\ ['nx', '<Leader>Af', '<Plug>(ag-loc)'],
\ ['nx', '<Leader>Aa', '<Plug>(ag-loc-add)'],
\ ['nx', '<Leader>Ab', '<Plug>(ag-loc-buffer)'],
\ ['nx', '<Leader>AF', '<Plug>(ag-loc-file)'],
\ ['nx', '<Leader>AH', '<Plug>(ag-loc-help)'],
\
\ ['nx', '<Leader>ag', '<Plug>(ag-group)'],
\ ['n', '<Leader>ra', '<Plug>(ag-group-last)'],
\]
Expand Down

6 comments on commit ebf90d1

@albfan
Copy link
Owner

@albfan albfan commented on ebf90d1 Nov 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really handy. Remember to add default mappings on doc.

@amerlyq
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Them aren't working yet -- until ag#GetArgs will be expanded for default functions.

@amerlyq
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, propose some replacement instead of <Leader>ra for the sake of consistency in shipped default mappings. Individual remappings must be in individual vimrc.
Because in my vimrc it will be remapped anyways -- separating by usage frequency.
I will add considerably nice example in the doc for such tinkering. Then we can discuss defaults again.

@albfan
Copy link
Owner

@albfan albfan commented on ebf90d1 Nov 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Leader>ra stands for "Repeat last Ag search" but feel free to suggest any other.

@amerlyq
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, maybe it has sense to rename through whole codebase *Last as *Repeat to eliminate ambiguity? It will allow to introduce and add conformed functions for default functional.

@albfan
Copy link
Owner

@albfan albfan commented on ebf90d1 Nov 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm agree with that

Please sign in to comment.