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

Option to use keys other than CTRL-A/CTRL-D for select/deselect with Ag? #54

Closed
chaoren opened this Issue Dec 14, 2015 · 14 comments

Comments

Projects
None yet
4 participants
@chaoren

chaoren commented Dec 14, 2015

I use CTRL-D to exit prompts by habit.

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 14, 2015

Yeah, in my case I was constantly annoyed by CTRL-A not moving my cursor to the front, which I do frequently to prepend ' to the query. The keys are not currently configurable, but I'm just going to change them to ALT-A and ALT-D.

@chaoren

This comment has been minimized.

chaoren commented Dec 14, 2015

Cool, thanks!

@rainerborene

This comment has been minimized.

rainerborene commented Dec 14, 2015

ALT-A and ALT-D generates áã characters respectively. Any ideas?

@chaoren

This comment has been minimized.

chaoren commented Dec 14, 2015

Do alt keys work in your terminal at all (e.g., ALT-C)? Check your
terminal settings, there should be a setting for sending meta keys.
On Dec 14, 2015 08:01, "Rainer Borene" notifications@github.com wrote:

ALT-A and ALT-D generates áã characters respectively. Any ideas?


Reply to this email directly or view it on GitHub
#54 (comment).

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 14, 2015

neovim/neovim#2440

It's a known issue of neovim and it doesn't look like it's going to be fixed soon-ish. Hmm, maybe I should make the keys configurable for nvim users.

@rainerborene

This comment has been minimized.

rainerborene commented Dec 14, 2015

Yes, that is a neovim issue indeed. Most options on fzf#vim functions are hardcoded, even for ag and fzf itself. How can we make those options configurable?

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 14, 2015

Excerpt from README:

This repository is a bundle of fzf-based commands and mappings extracted from my .vimrc to address such needs. They are not designed to be flexible or configurable, and there's no guarantee of backward-compatibility.

:)

This repository simply provides too many features and trying to make every aspect of it configurable will inevitably make it a big mess. I currently encourage the users to fork it and bend it to their needs. But I do know that many users are not familiar with Vimscript, and I'll think about the options. (and that's the reason I left this issue open.)

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 14, 2015

By the way, you can already override the default options as each function will append the extra options provided to the default set of options:

call fzf#vim#ag('query', {'options': '--bind ctrl-a:select-all,ctrl-d:deselect-all'})
@rainerborene

This comment has been minimized.

rainerborene commented Dec 14, 2015

I agree with you. But at least explain users how they should override current behavior i.e.

command! Search call fzf#vim#ag(<-qargs>, {
  \ 'ag_command': 'ag --hidden %s',
  \ 'fzf_command': 'fzf -m'
  \ })

Better defaults and more flexible overriding instead of a bunch of options.

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 14, 2015

fzf#vim#ag in particular takes a variable number of arguments, and ag options can be also given as follows:

call fzf#vim#ag('query', '--hidden', {'options': '--bind ctrl-a:select-all,ctrl-d:deselect-all'})

Note that overriding some default options can break the feature as they may affect the sink implementation.

@rainerborene

This comment has been minimized.

rainerborene commented Dec 14, 2015

I see. Only problem of fzf#vim#ag function is that escapes the <q-args> by default. If there were an option to disable that it would solve issue #27

@rainerborene

This comment has been minimized.

rainerborene commented Dec 14, 2015

Nevermind. I'll use your :Grep command ;)

@wwwdata

This comment has been minimized.

wwwdata commented Jul 26, 2016

If anybody else still has this problem and is using iTerm2 and neovim. You can also configure iTerm2 to send an escape sequence, then alt+a and alt+d will also work, see my screenshot! That's how I did it 😄

screen shot 2016-07-26 at 16 14 17

@junegunn junegunn referenced this issue Dec 9, 2017

Closed

Can't select all on macOS #545

3 of 9 tasks complete

@junegunn junegunn closed this Dec 9, 2017

@junegunn

This comment has been minimized.

Owner

junegunn commented Dec 9, 2017

screen shot 2017-12-09 at 11 25 34 am

  • Esc+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment