mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Make the quickfix/locationlist handlers configurable. #51

Closed Soares closed 11 years ago

Soares commented 12 years ago

This allows people to do things like let g:ack_qhandler='CtrlPQuickfix' and have the results handled by CtrlP's quickfix mode.

williscool commented 11 years ago

+1 for this pull request its awesome

My only addition would be to not have the key remaps happen if the person is using an alternate quickfix handler

I just deleted them in the plugin because I don't really know how to check if its not the standard and switch off of that

ie delete

exec "nnoremap <silent> <buffer> q :ccl<CR>"
exec "nnoremap <silent> <buffer> t <C-W><CR><C-W>T"
exec "nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>"
exec "nnoremap <silent> <buffer> o <CR>"
exec "nnoremap <silent> <buffer> go <CR><C-W><C-W>"
exec "nnoremap <silent> <buffer> v <C-W><C-W><C-W>v<C-L><C-W><C-J><CR>"
exec "nnoremap <silent> <buffer> gv <C-W><C-W><C-W>v<C-L><C-W><C-J><CR><C-W><C-J>"
Soares commented 11 years ago

I've updated the pull request to allow users to turn off the custom mappings (and to turn them off by default when the user changes the handler).

However, milesz's ack.vim is looking pretty dead. If you check out my fork I've actually added a number of few features, including:

mileszs commented 11 years ago

Ha. To be fair, I just pulled in several requests a couple weeks ago. So, only half-dead. I will try to make time to test your pull requests today or tomorrow.

On Thu, Nov 15, 2012 at 3:25 AM, Nate notifications@github.com wrote:

I've updated the pull request to allow users to turn off the custom mappings (and to turn them off by default when the user changes the handler).

However, milesz's ack.vim is looking pretty dead. If you check out my forkhttps://github.com/Soares/ack.vimI've actually added a number of few features, including:

  • Speed (using autoload)
  • Simplification
  • Smart search from the word under the cursor
  • Opt-in mappings (namespaced under )

    — Reply to this email directly or view it on GitHubhttps://github.com/mileszs/ack.vim/pull/51#issuecomment-10400646.

Soares commented 11 years ago

My mistake! I missed that when I was glancing over the activity. I didn't mean to offend! :-)

If you have any time, a few big things I'd suggest you implement:

I personally removed AckFromSearch in my fork, because not only is it half-implemented and broken but it's easy to replace. You can already do

:Ack <C-R>/

to ack from search and it's less typing than :AckFromSearch! At the least I'd suggest

:AckWord

which escapes quotes and surrounds the search in "s and \bs. :AckWord <C-R>/ is still less typing than AckFromSearch.

williscool commented 11 years ago

Hey @Soares one more quick question.

What change is it that keeps ack from just blindly jumping to the first?

I've got the quickfix in ctrlp but ack still opens the first

Soares commented 11 years ago

Use :Ack!

In mileszs' version (and with vim :grep) vim will jump unless you provide the bang. In my branch I inverted that because I think it makes more semantic sense to only jump when 'forced'.

mileszs commented 11 years ago

For what it's worth, I agree that the inverse makes more sense semantically. However, for this particular plugin, I'm trying to emulate grep in Vim.

On Thu, Nov 15, 2012 at 1:55 PM, Nate notifications@github.com wrote:

Use :Ack!

In mileszs' version (and with vim :grep) vim will jump unless you provide the bang. In my branch I inverted that because I think it makes more semantic sense to only jump when 'forced'.

— Reply to this email directly or view it on GitHubhttps://github.com/mileszs/ack.vim/pull/51#issuecomment-10420492.

williscool commented 11 years ago

Nice thanks guys

mileszs commented 11 years ago

Merged!