Shougo / denite.nvim

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

[Question] Tell me minimal vimrc to work on Vim8 #687

Closed delphinus closed 5 years ago

delphinus commented 5 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

minimal on Vim8 does not make Denite work.

Expected

Tell me valid minimal vimrc.

Environment Information (Required!)

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

set runtimepath+=~/test/vim-hug-neovim-rpc
set runtimepath+=~/test/nvim-yarp
set runtimepath+=~/test/denite.nvim
autocmd FileType denite call <SID>denite_my_setting()
function! s:denite_my_setting() abort
  nnoremap <silent><buffer><expr> i       denite#do_map('open_filter_buffer')
  nnoremap <silent><buffer><expr> q       denite#do_map('quit')
  nnoremap <silent><buffer><expr> o       denite#do_map('do_action', 'test')
endfunction
filetype plugin indent on
syntax enable

How to reproduce problems from neovim startup (Required!)

  1. LANG=C vim -N -u ~/test/vimrc -U NONE -i NONE
  2. :Denite file
  3. It does nothing. :cry:

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screenshot (if possible)

Upload the log file

Shougo commented 5 years ago

You should map <CR> in denite buffer.

autocmd FileType denite call <SID>denite_my_setting()
function! s:denite_my_setting() abort
  nnoremap <silent><buffer><expr> i       denite#do_map('open_filter_buffer')
  nnoremap <silent><buffer><expr> q       denite#do_map('quit')
  nnoremap <silent><buffer><expr> o       denite#do_map('do_action', 'test')
  nnoremap <silent><buffer><expr> <CR> denite#do_map('do_action')
endfunction

It works for me.

delphinus commented 5 years ago

It did not fix this. :Denite file does NOTHING. It does not show even the Denite window.


But I tried without LANG=C, it goes good. strange...

27S2AUS7Pp

Shougo commented 5 years ago

Reproduced.

You need to set encoding=utf-8 in vimrc.

set encoding=utf-8
set runtimepath+=~/test/vim-hug-neovim-rpc
set runtimepath+=~/test/nvim-yarp
set runtimepath+=~/test/denite.nvim
autocmd FileType denite call <SID>denite_my_setting()
function! s:denite_my_setting() abort
  nnoremap <silent><buffer><expr> i       denite#do_map('open_filter_buffer')
  nnoremap <silent><buffer><expr> q       denite#do_map('quit')
  nnoremap <silent><buffer><expr> o       denite#do_map('do_action', 'test')
endfunction
filetype plugin indent on
syntax enable

Reason: vim-hug-neovim-rpc requires set encoding=utf-8. If you use LANG=C, set encoding=latin1 is set automatically.

Note: The problem is only Vim8.

Shougo commented 5 years ago

It does not show even the Denite window.

This is bug. So I have fixed it.