Shougo / denite.nvim

:dragon: Dark powered asynchronous unite all interfaces for Neovim/Vim8
Other
2.06k stars 215 forks source link

Not working anymore in vim8/neovim #652

Closed tracyone closed 5 years ago

tracyone commented 5 years ago

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 neovim

and 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 gone

cd dente.nvim
git checkout 29bfd4c53271c7a150def2388e059746ae4c1713

Environment Information (Required!)


VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun  6 2019 21:35:11)
macOS version
Included patches: 1-1481
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +cmdline_info      -farsi             +libcall           -mouse_sysmouse    +python3           +termguicolors     +vreplace
+arabic            +comments          +file_in_path      +linebreak         +mouse_urxvt       +quickfix          +terminal          +wildignore
+autocmd           +conceal           +find_in_path      +lispindent        +mouse_xterm       +reltime           +terminfo          +wildmenu
+autochdir         +cryptv            +float             +listcmds          +multi_byte        +rightleft         +termresponse      +windows
-autoservername    +cscope            +folding           +localmap          +multi_lang        +ruby              +textobjects       +writebackup
-balloon_eval      +cursorbind        -footer            +lua               -mzscheme          +scrollbind        +textprop          -X11
+balloon_eval_term +cursorshape       +fork()            +menu              +netbeans_intg     +signs             +timers            -xfontset
-browse            +dialog_con        +gettext           +mksession         +num64             +smartindent       +title             -xim
++builtin_terms    +diff              -hangul_input      +modify_fname      +packages          +startuptime       -toolbar           -xpm
+byte_offset       +digraphs          +iconv             +mouse             +path_extra        +statusline        +user_commands     -xsmp
+channel           -dnd               +insert_expand     -mouseshape        +perl              -sun_workshop      +vartabs           -xterm_clipboard
+cindent           -ebcdic            +job               +mouse_dec         +persistent_undo   +syntax            +vertsplit         -xterm_save
-clientserver      +emacs_tags        +jumplist          -mouse_gpm         +postscript        +tag_binary        +virtualedit       
+clipboard         +eval              +keymap            -mouse_jsbterm     +printer           -tag_old_static    +visual            
+cmdline_compl     +ex_extra          +lambda            +mouse_netterm     +profile           -tag_any_white     +visualextra       
+cmdline_hist      +extra_search      +langmap           +mouse_sgr         -python            -tcl               +viminfo           
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.5.0 -lobjc    

Provide a minimal init.vim with less than 50 lines (Required!)

set nocompatible
let &rtp=&rtp.','.$HOME.'/.vim/bundle/denite.nvim'
let &rtp.=','.$HOME.'/.vim/bundle/nvim-yarp'
let &rtp.=','.$HOME.'/.vim/bundle/vim-hug-neovim-rpc'
let g:mapleader="\<Space>"
let g:maplocalleader=','
nnoremap <Leader><Leader> :Denite file/rec<cr>
filetype plugin indent on
syntax on

How to reproduce problems from neovim startup (Required!)

:Denite file/rec
Shougo commented 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.

https://github.com/Shougo/denite.nvim#examples

Shougo commented 5 years ago
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.

tracyone commented 5 years ago

Ok I think denite.nvim has been changed a lot since 2.0,it's not working without any config

Shougo commented 5 years ago

Yes.

tracyone commented 5 years ago

@Shougo I have quiction about mapping in insert mode? how can I open a file without enter twice?

Shougo commented 5 years ago
    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
tracyone commented 5 years ago

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)