mileszs / ack.vim

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

How to search word under cursor? #33

Closed regedarek closed 12 years ago

regedarek commented 12 years ago

Is posible to search words by Ack like this?

Ad.with_*some_scope(:params[:scope]) and press something like <leader>vv to search :Ack with_some_scope

lukaszkorecki commented 12 years ago

You can do this with this mapping:

    noremap <Leader>a :Ack <cword><cr>
mostlyobvious commented 12 years ago

it works for me just by marking word under cursor with * and hitting :Ack<CR>

ubermajestix commented 12 years ago

Looks to me like you can just hit :Ack<CR> and it will search for the word under the cursor, no * needed.

jondkinney commented 11 years ago

None of these suggestions seem to be working for me. Can anyone else verify they are still able to do this?

proc commented 11 years ago

Yup, works

jondkinney commented 11 years ago

Yea, works for me too. I think I was trying to use it incorrectly previously. Additionally I found that you can do :Ack then ctrl-rw and it'll populate the word under the cursor into the command. This works generically too, regardless of what you're doing in command mode.

liuyang1 commented 10 years ago

Thanks for @lukaszkorecki It works! and so useful!

tiborsimon commented 8 years ago

Yep, it works for me too. @lukaszkorecki very useful shortcut ;)

ssaid commented 7 years ago

@lukaszkorecki great tip, thank you very much!