Closed tracyone closed 5 years ago
There are 2 issue in fact. one of them is I can't input after denite window is popup when execute :Denite file/rec in both vim and neovim
Why does not read the documentation?
https://github.com/Shougo/denite.nvim/blob/master/README.md
Note: Denite.nvim does not define any of default mappings. You need to define them.
set runtimepath+=~/work/denite.nvim/
set runtimepath+=~/work/nvim-yarp/
set runtimepath+=~/work/vim-hug-neovim-rpc/
filetype plugin indent on
syntax enable
colorscheme desert
filetype plugin indent on
" call denite#custom#option('default', {'start_filter' : 1})
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> <Space>
\ denite#do_map('toggle_select').'j'
endfunction
It works for me both Vim and neovim.
Ok I think denite.nvim has been changed a lot since 2.0
,it's not working without any config
Yes.
@Shougo I have quiction about mapping in insert mode? how can I open a file without enter twice?
autocmd FileType denite-filter call s:denite_filter_my_settings()
function! s:denite_filter_my_settings() abort
inoremap <silent><buffer><expr> <CR> denite#do_map('do_action')
endfunction
Thanks a lot. I post my denite config here, If some one need.
scriptencoding utf-8
autocmd FileType denite call s:denite_my_settings()
function! s:denite_my_settings() abort
nnoremap <silent><buffer><expr> <CR>
\ denite#do_map('do_action')
nnoremap <silent><buffer><expr> d
\ denite#do_map('do_action', 'delete')
nnoremap <silent><buffer><expr> <c-t>
\ denite#do_map('do_action', 'tabopen')
nnoremap <silent><buffer><expr> <c-v>
\ denite#do_map('do_action', 'vsplit')
nnoremap <silent><buffer><expr> <c-x>
\ denite#do_map('do_action', 'split')
nnoremap <silent><buffer><expr> p
\ denite#do_map('do_action', 'preview')
nnoremap <silent><buffer><expr> q
\ denite#do_map('quit')
nnoremap <silent><buffer><expr> i
\ denite#do_map('open_filter_buffer')
nnoremap <silent><buffer><expr> V
\ denite#do_map('toggle_select').'j'
endfunction
autocmd FileType denite-filter call s:denite_filter_my_settings()
function! s:denite_filter_my_settings() abort
imap <silent><buffer> <tab> <Plug>(denite_filter_quit)
inoremap <silent><buffer><expr> <CR> denite#do_map('do_action')
inoremap <silent><buffer><expr> <c-t>
\ denite#do_map('do_action', 'tabopen')
inoremap <silent><buffer><expr> <c-v>
\ denite#do_map('do_action', 'vsplit')
inoremap <silent><buffer><expr> <c-x>
\ denite#do_map('do_action', 'split')
inoremap <silent><buffer><expr> <esc>
\ denite#do_map('quit')
inoremap <silent><buffer> <C-j>
\ <Esc><C-w>p:call cursor(line('.')+1,0)<CR><C-w>pA
inoremap <silent><buffer> <C-k>
\ <Esc><C-w>p:call cursor(line('.')-1,0)<CR><C-w>pA
endfunction
" Change matchers.
call denite#custom#source(
\ 'file_mru', 'matchers', ['matcher/fuzzy', 'matcher/project_files'])
call denite#custom#source('tag', 'matchers', ['matcher/substring'])
call denite#custom#source('file/old', 'converters',
\ ['converter/relative_word'])
" Change sorters.
call denite#custom#source(
\ 'file/rec', 'sorters', ['sorter/sublime'])
" Ag command on grep source
if executable('ag')
call denite#custom#var('grep', 'command', ['ag'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--vimgrep'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', [])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
call denite#custom#var('file/rec', 'command',
\ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
endif
if executable('ack')
" Ack command on grep source
call denite#custom#var('grep', 'command', ['ack'])
call denite#custom#var('grep', 'default_opts',
\ ['--ackrc', $HOME.'/.ackrc', '-H', '-i',
\ '--nopager', '--nocolor', '--nogroup', '--column'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', ['--match'])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
endif
if executable('rg')
" Ripgrep command on grep source
call denite#custom#var('grep', 'command', ['rg'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--vimgrep', '--no-heading'])
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', [])
" For ripgrep
" Note: It is slower than ag
call denite#custom#var('file/rec', 'command',
\ ['rg', '--files', '--glob', '!.git'])
endif
if executable('pt')
" Pt command on grep source
call denite#custom#var('grep', 'command', ['pt'])
call denite#custom#var('grep', 'default_opts',
\ ['-i', '--nogroup', '--nocolor', '--smart-case'])
call denite#custom#var('grep', 'recursive_opts', [])
call denite#custom#var('grep', 'pattern_opt', [])
call denite#custom#var('grep', 'separator', ['--'])
call denite#custom#var('grep', 'final_opts', [])
" For Pt(the platinum searcher)
" NOTE: It also supports windows.
call denite#custom#var('file/rec', 'command',
\ ['pt', '--follow', '--nocolor', '--nogroup',
\ (has('win32') ? '-g:' : '-g='), ''])
endif
" Define alias
call denite#custom#alias('source', 'file/rec/git', 'file/rec')
call denite#custom#var('file/rec/git', 'command',
\ ['git', 'ls-files', '-co', '--exclude-standard'])
call denite#custom#alias('source', 'file/rec/py', 'file/rec')
call denite#custom#var('file/rec/py', 'command',['scantree.py'])
" Change ignore_globs
call denite#custom#filter('matcher/ignore_globs', 'ignore_globs',
\ [ '.git/', '.ropeproject/', '__pycache__/',
\ 'venv/', 'images/', '*.min.*', 'img/', 'fonts/'])
let s:denite_options = {
\ 'prompt' : '>',
\ 'split': 'floating',
\ 'start_filter': 1,
\ 'auto_resize': 1,
\ 'source_names': 'short',
\ 'direction': 'botright',
\ 'highlight_filter_background': 'CursorLine',
\ 'highlight_matched_char': 'Type',
\ }
call denite#custom#option('default', s:denite_options)
Problems summary
There are 2 issue in fact. one of them is I can't input after denite window is popup when execute
:Denite file/rec
in both vim and neovimand one is "nothing happen" with minimal vimrc in vim8 only, and I can't figure it out~
But I am sure all of them are denite.nvim's issue, because when I checkout
2.0
verison of denite.nvim, all of issue are goneEnvironment Information (Required!)
denite version (SHA1):bfc010bfeed56681929b67e70662f8bb11977da7
OS:macOS 10.14.5
Vim/neovim version:
Provide a minimal init.vim with less than 50 lines (Required!)
How to reproduce problems from neovim startup (Required!)