Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ferret make <cword> not working. #64

Closed
lsaint opened this issue Jun 22, 2019 · 4 comments
Closed

ferret make <cword> not working. #64

lsaint opened this issue Jun 22, 2019 · 4 comments

Comments

@lsaint
Copy link

lsaint commented Jun 22, 2019

my vimrc:

map <F4> :Ack! -w <cword><cr/>

after i installed ferret, <cword> not working, it can't expand to the word under cursor.

@wincent
Copy link
Owner

wincent commented Jun 22, 2019

See this section in the docs. Let me know if that doesn't help.

@wincent wincent closed this as completed Jun 22, 2019
@lsaint
Copy link
Author

lsaint commented Jun 24, 2019

it works, thanks.

@lsaint
Copy link
Author

lsaint commented Jun 26, 2019

@wincent <Plug>(FerretAckWord) works well, but i would like to match whole word only, like the -w arg in Ack, how should i do ?

@wincent
Copy link
Owner

wincent commented Jun 26, 2019

If you look at the definition of <Plug>(FerretAckWord) you'll see it just maps to:

:Ack <C-r><C-w><CR>

And if you look at the Vim help (:h c_CTRL-R_CTRL-W) for <C-r><C-w> you'll see:

CTRL-R CTRL-F				*c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>*
CTRL-R CTRL-P				*c_CTRL-R_CTRL-P* *c_<C-R>_<C-P>*
CTRL-R CTRL-W				*c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
CTRL-R CTRL-A				*c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
CTRL-R CTRL-L				*c_CTRL-R_CTRL-L* *c_<C-R>_<C-L>*
		Insert the object under the cursor:
			CTRL-F	the Filename under the cursor
			CTRL-P	the Filename under the cursor, expanded with
				'path' as in |gf|
			CTRL-W	the Word under the cursor
			CTRL-A	the WORD under the cursor; see |WORD|
			CTRL-L	the line under the cursor

so it is expanding the "word" under the cursor. You could make a similar mapping to instead find the "WORD". If neither of those gives you what you want, then you'd need to cook something else up, but for most intents and purposes, "word" should be pretty close to what -w does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants