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

Support C-n and C-p for up/down by default #104

Closed
milisims opened this issue Oct 30, 2019 · 6 comments
Closed

Support C-n and C-p for up/down by default #104

milisims opened this issue Oct 30, 2019 · 6 comments

Comments

@milisims
Copy link

milisims commented Oct 30, 2019

While it's very easy to add:

inoremap <silent> <buffer> <C-n> <C-R>=clap#handler#navigate_result('down')<CR>
inoremap <silent> <buffer> <C-p> <C-R>=clap#handler#navigate_result('up')<CR>

to, for example, after/ftplugin/clap_input.vim, it seems like this should be the default to match vim's default. There is no documentation for mappings, either, so I had to root around in the code to find out how you mapped it, which is a bit much for restoring vimlike default behavior.

@liuchengxu
Copy link
Owner

This has been discussed before, please see #52 .

@milisims
Copy link
Author

I can definitely respect your original design decision, <C-n/p> makes sense for input history as well as the result navigation. Do you think it would be worth having some <Plug> mappings so that users could change to their liking more easily? At least, documenting it would be nice.

Aside, I really love the plugin! Great work!

@liuchengxu
Copy link
Owner

liuchengxu commented Oct 31, 2019

Yes, I thought <Plug> mappings are convenient, but I just saw this issue vim/vim#5147. Plus the popup of vim is unable to be focused, changing the default key bindings means more works. Hence I'm reluctant to add these <Plug> mappings at the moment, it's not hard though.

@sdemura
Copy link

sdemura commented Dec 19, 2019

I'd like to see Ctrl-P/N be the default as well. Not just in Vim, but in many other places Ctrl N/P is the defacto keyboard shortcut for up/down, and I'd expect the same here.

@liuchengxu
Copy link
Owner

Checkout #52, Ctrl-N/P has been reserved for navigating the input history.

@RobertAudi
Copy link

While it's very easy to add:

inoremap <silent> <buffer> <C-n> <C-R>=clap#handler#navigate_result('down')<CR>
inoremap <silent> <buffer> <C-p> <C-R>=clap#handler#navigate_result('up')<CR>

to, for example, after/ftplugin/clap_input.vim

Just a note for anybody stumbling into this issue: The API changed so the code to use is as follows:

inoremap <silent> <buffer> <C-n> <C-R>=clap#navigation#linewise('down')<CR>
inoremap <silent> <buffer> <C-p> <C-R>=clap#navigation#linewise('up')<CR>

liuchengxu pushed a commit that referenced this issue Aug 17, 2021
add quadratic funding pallet milestone-1
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

4 participants