Skip to content

Commit

Permalink
Support <Down> and <Up> arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Oct 8, 2019
1 parent 5e7dbc2 commit 1331c24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The option naming convention for provider is `g:clap_provider_{provider_id}_{opt

### Movement

- Use <kbd>Ctrl-j</kbd> or <kbd>Ctrl-k</kbd> to navigate the result list up and down.
- Use <kbd>Ctrl-j</kbd>/<kbd>Down</kbd> or <kbd>Ctrl-k</kbd>/<kbd>Up</kbd> to navigate the result list up and down.
- Use <kbd>Ctrl-a</kbd> to go to the start of the input.
- Use <kbd>Ctrl-e</kbd> to go to the end of the input.
- Use <kbd>Ctrl-c</kbd>, <kbd>Ctrl-[</kbd> or <kbd>Esc</kbd> to exit.
Expand Down
2 changes: 2 additions & 0 deletions autoload/clap/popup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ function! s:move_manager.bs(_winid) abort
endfunction

let s:move_manager["\<C-J>"] = { winid -> win_execute(winid, 'call clap#handler#navigate_result("down")') }
let s:move_manager["\<Down>"] = s:move_manager["\<C-J>"]
let s:move_manager["\<C-K>"] = { winid -> win_execute(winid, 'call clap#handler#navigate_result("up")') }
let s:move_manager["\<Up>"] = s:move_manager["\<C-K>"]
let s:move_manager["\<Tab>"] = { winid -> win_execute(winid, 'call clap#handler#select_toggle()') }
let s:move_manager["\<CR>"] = { _winid -> clap#handler#sink() }
let s:move_manager["\<Esc>"] = { _winid -> clap#handler#exit() }
Expand Down
3 changes: 3 additions & 0 deletions ftplugin/clap_input.vim
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ inoremap <silent> <buffer> <Esc> <Esc>:call clap#handler#exit()<CR>
inoremap <silent> <buffer> <C-j> <C-R>=clap#handler#navigate_result('down')<CR>
inoremap <silent> <buffer> <C-k> <C-R>=clap#handler#navigate_result('up')<CR>
inoremap <silent> <buffer> <Down> <C-R>=clap#handler#navigate_result('down')<CR>
inoremap <silent> <buffer> <Up> <C-R>=clap#handler#navigate_result('up')<CR>
inoremap <silent> <buffer> <Tab> <C-R>=clap#handler#select_toggle()<CR>
inoremap <silent> <buffer> <C-t> <Esc>:call <SID>action('ctrl-t')<CR>
Expand Down

0 comments on commit 1331c24

Please sign in to comment.