~gpanders/dotfiles

ref: 885174d3dacde7705891f7dc7934650f50697c87 dotfiles/vim/.vim/after/plugin/denite.vim -rw-r--r-- 1.7 KiB
885174d3Greg Anders Update fzf configuration 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
if !get(g:, 'loaded_denite', 0)
  finish
endif

if executable('rg')
  call denite#custom#var('file/rec', 'command',
        \ ['rg', '--files', '--glob', '!.git'])
  call denite#custom#var('grep', 'command', ['rg'])
  call denite#custom#var('grep', 'default_opts',
        \ ['-S', '--vimgrep', '--no-heading'])
  call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
  call denite#custom#var('grep', 'recursive_opts', [])
  call denite#custom#var('grep', 'separator', ['--'])
  call denite#custom#var('grep', 'final_opts', [])
elseif executable('ag')
  call denite#custom#var('file/rec', 'command',
        \ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
  call denite#custom#var('grep', 'command', ['rg'])
  call denite#custom#var('grep', 'default_opts',
        \ ['-S', '--vimgrep'])
  call denite#custom#var('grep', 'pattern_opt', [])
  call denite#custom#var('grep', 'recursive_opts', [])
  call denite#custom#var('grep', 'separator', ['--'])
  call denite#custom#var('grep', 'final_opts', [])
endif

call denite#custom#map(
      \ 'insert',
      \ '<C-n>',
      \ '<denite:move_to_next_line>',
      \ 'noremap'
      \)
call denite#custom#map(
      \ 'insert',
      \ '<C-p>',
      \ '<denite:move_to_previous_line>',
      \ 'noremap'
      \)

call denite#custom#map('insert', '<C-b>', '<denite:move_caret_to_left>', 'noremap')
call denite#custom#map('insert', '<C-f>', '<denite:move_caret_to_right>', 'noremap')
call denite#custom#map('insert', '<C-d>', '<denite:delete_char_under_caret>', 'noremap')

" Mappings
nnoremap <leader>d :Denite <C-D><C-Z>
nnoremap <silent> <C-P> :Denite file/rec<CR>
nnoremap <leader>T :Denite tag<CR>
nnoremap <leader>B :Denite buffer<CR>
nnoremap <leader>y :Denite register<CR>
nnoremap <leader>k :Denite mark<CR>