Skip to content

Commit 5ec7483

Browse files
committed
Follow up change of denite api
refs: github.com/Shougo/denite.nvim/pull/624
1 parent 8d639ac commit 5ec7483

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.vimrc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,16 @@ nnoremap <silent> [unite]gp :<C-u>Denite<Space>grep<Return>
236236
nnoremap <silent> [unite]l :<C-u>Denite<Space>line<Return>
237237
nnoremap <silent> [unite]u :<C-u>Denite<Space>-resume<Return>
238238
239-
call denite#custom#map('insert', '<C-j>', '<denite:move_to_next_line>', 'noremap')
240-
call denite#custom#map('insert', '<C-k>', '<denite:move_to_previous_line>', 'noremap')
241-
call denite#custom#map('insert', '<C-d>', '<denite:scroll_page_forwards>', 'noremap')
242-
call denite#custom#map('insert', '<C-u>', '<denite:scroll_page_backwards>', 'noremap')
243-
call denite#custom#map('insert', '<C-x>', '<denite:input_command_line>', 'noremap')
239+
" Define mappings
240+
autocmd FileType denite call s:denite_my_settings()
241+
function! s:denite_my_settings() abort
242+
nnoremap <silent><buffer><expr> <CR> denite#do_map('do_action')
243+
nnoremap <silent><buffer><expr> d denite#do_map('do_action', 'delete')
244+
nnoremap <silent><buffer><expr> p denite#do_map('do_action', 'preview')
245+
nnoremap <silent><buffer><expr> q denite#do_map('quit')
246+
nnoremap <silent><buffer><expr> i denite#do_map('open_filter_buffer')
247+
nnoremap <silent><buffer><expr> <Space> denite#do_map('toggle_select')
248+
endfunction
244249

245250
" Use 'rg' instead of 'grep' if available
246251
if executable('rg')

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ Denite.nvim is to unite all interfaces for NeoVim/Vim.
160160
A few things at least you have to know about Denite are:
161161

162162
- It requires Neovim or Vim 8.0+ with if_python3
163-
- `<C-j>` : to move to next line
164-
- `<C-k>` : to move to previous line
163+
- `j` : to move to next line
164+
- `k` : to move to previous line
165+
- `q` : to close "denite" window
166+
- `i` : to move to filter buffer
165167
- `<Leader>ur` : to "denite" recently opened files
166168
- `<Leader>ub` : to "denite" buffers
167169
- `<Leader>ufp` : to "denite" find files in the project (e.g. for files in git repository)

0 commit comments

Comments
 (0)