I finally have Denite set up the way I want, and it’s great. I pasted my denite config from .vimrc
below. RipGrep is installed.
" Denite ideas from https://github.com/sodiumjoe/dotfiles/blob/master/vimrc#L242 and elsewhere.
" reset 50% winheight on window resize
augroup deniteresize
autocmd!
autocmd VimResized,VimEnter * call denite#custom#option('default',
\'winheight', winheight(0) / 2)
augroup end
call denite#custom#option('default', {
\ 'prompt': '❯'
\ })
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',
\ ['--hidden', '--vimgrep', '--no-heading', '-S'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', ['--regexp'])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
call denite#custom#map('insert', '<Esc>', '<denite:enter_mode:normal>',
\'noremap')
call denite#custom#map('normal', '<Esc>', '<NOP>',
\'noremap')
" ctrl-v and ctrl-h to open files in vertical and horizontal splits
call denite#custom#map('insert', '<C-v>', '<denite:do_action:vsplit>',
\'noremap')
call denite#custom#map('normal', '<C-v>', '<denite:do_action:vsplit>',
\'noremap')
call denite#custom#map('insert', '<C-h>', '<denite:do_action:split>',
\'noremap')
call denite#custom#map('normal', '<C-h>', '<denite:do_action:split>',
\'noremap')
call denite#custom#map('normal', 'dw', '<denite:delete_word_after_caret>',
\'noremap')
" ctrl-n and ctrl-p to move down and up the denite menus
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')
" ctrl-p to find files
nnoremap <C-p> :<C-u>Denite file_rec<CR>
" leader-s to find buffers
nnoremap <leader>s :<C-u>Denite buffer<CR>
nnoremap <leader><leader>s :<C-u>DeniteBufferDir buffer<CR>
" leader-8 to grep for current word
nnoremap <leader>8 :<C-u>DeniteCursorWord grep:. -mode=normal<CR>
" leader-/ to grep
nnoremap <leader>/ :<C-u>Denite grep:. -mode=normal<CR>
nnoremap <leader><leader>/ :<C-u>DeniteBufferDir grep:. -mode=normal<CR>
nnoremap <leader>d :<C-u>DeniteBufferDir file_rec<CR>
nnoremap <leader><leader>r :<C-u>Denite -resume -cursor-pos=+1<CR>
" leader-o to load custom menu
nnoremap <leader>o :<C-u>Denite menu<CR>
hi link deniteMatchedChar Special
" Add custom menus
let s:menus = {}
let s:menus.config_files = {
\ 'description': 'Edit config files'
\ }
" quick access to config files
let s:menus.config_files.file_candidates = [
\ ['.aliases', '~/.aliases'],
\ ['.zshenv', '~/.zshenv'],
\ ['.zshrc', '~/.zshrc'],
\ ['.vimrc', '~/.vimrc'],
\ ['.i3conf', '~/.config/i3/config'],
\ ['.i3status.conf', '~/.i3status.conf'],
\ ['.ctags', '~/.ctags'],
\ ['global .gitconfig', '~/.gitconfig'],
\ ['global .gitignore', '~/.gitignore'],
\ ['.muttrc', '~/.muttrc'],
\ ['.npmrc', '~/.npmrc'],
\ ['.mongojsrc.js', '~/.mongojsrc.js'],
\ ['.psqlrc', '~/.psqlrc'],
\ ['.pgpass', '~/.pgpass'],
\ ['.pythonrc', '~/.pythonrc'],
\ ['.tmux.conf', '~/.tmux.conf'],
\ ['.tern-config', '~/.tern-config'],
\ ['.vuerc', '~/.vuerc'],
\ ['.xinitrc', '~/.xinitrc'],
\ ['.Xmodmap', '~/.Xmodmap'],
\ ['.taskbook.json', '~/.taskbook.json'],
\ ]
" let s:menus.vim = {
" \ 'description': 'Edit Vim config files'
" \ }
" let s:menus.vim.file_candidates = [
" \ ]
" let s:menus.vim.command_candidates = [
" \ ['Split the window', 'vnew'],
" \ ['Open zsh menu', 'Denite menu:zsh'],
" \ ]
call denite#custom#var('menu', 'menus', s:menus)