yuki-yano / fzf-preview.vim

The plugin that powerfully integrates fzf and (Neo)vim. It is also possible to integrate with coc.nvim.
MIT License
910 stars 37 forks source link

BufferLines is broken #161

Closed phongvcao closed 4 years ago

phongvcao commented 4 years ago

Running :CocCommand fzf-preview.BufferLines gave me the following error:

[coc.nvim] Command error: ENOENT: no such file or directory, open 'vimrc'
Screenshot at Jul 28 13-06-14

I don't set any settings for fzf-preview.vim (meaning everything is default). The error happens regardless of whether bat is installed or not.

Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf', {
            \ 'do': { -> fzf#install() } }
Plug 'yuki-ycino/fzf-preview.vim', { 
            \ 'branch': 'release' }
Plug 'neoclide/coc.nvim', {
            \ 'branch' : 'release' }

let g:coc_global_extensions = [
            \ 'coc-json', 'coc-html', 'coc-css', 'coc-ember', 'coc-java',
            \ 'coc-python', 'coc-highlight', 'coc-angular', 'coc-vimlsp',
            \ 'coc-markdownlint', 'coc-calc', 'coc-tsserver', 'coc-yaml',
            \ 'coc-snippets', 'coc-fzf-preview' ]

Here is my vim version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul 27 2020 01:26:07)
macOS version
Included patches: 1-1300
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               +ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   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-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/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.15 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -lpython3.8 -framework CoreFoundation  -lruby.2.7

Please let me know if you need more info. Thanks for the great plugin.

yuki-yano commented 4 years ago

Thanks for the report.

I created a minimal configuration with neovim and bat installed with Docker, but I couldn't reproduce it. Is it possible to create a reproducible configuration using this Dockerfile?

Create a Dockerfile and run the following command.

$ docker build ./ -t neovim
$ docker run --rm -it neovim
FROM ubuntu:bionic

# Neovim
RUN apt-get update && apt install -y ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip git

WORKDIR /usr/local/src
RUN git clone https://github.com/neovim/neovim.git

WORKDIR /usr/local/src/neovim
RUN make && make install

# Node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt install -y nodejs

# bat
RUN curl -sL https://github.com/sharkdp/bat/releases/download/v0.15.4/bat_0.15.4_amd64.deb -o bat_0.15.4_amd64.deb
RUN dpkg -i bat_0.15.4_amd64.deb

# vim plugin
RUN sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
RUN mkdir -p /root/.config/nvim
RUN echo "call plug#begin('~/.vim/plugged') \n\
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} \n\
Plug 'neoclide/coc.nvim', {'branch': 'release'} \n\
call plug#end() \n\
\n\
let g:coc_global_extensions = ['coc-fzf-preview'] \n" >> /root/.config/nvim/init.vim

RUN nvim +PlugInstall +qa!

ENTRYPOINT ["nvim"]

スクリーンショット 2020-07-29 18 39 30

Also, using Remote Plugin and coc extensions at the same time might cause a bug. Try to use only one of them.

phongvcao commented 4 years ago

Hi @yuki-ycino can you try this plugin on Vim? The error I quoted above was from Vim 8.2 not neovim.

yuki-yano commented 4 years ago

Sorry, I wasn't able to verify the version. It works on vim8 on the Mac.

:version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul 27 2020 01:26:07)
macOS version
Included patches: 1-1300

スクリーンショット 2020-07-29 19 21 47

phongvcao commented 4 years ago

Ok I think I figured out the problem. It was a conflict in my .vimrc with a plugin called symlink.vim:

Plug 'aymericbeaumet/symlink.vim'

Thanks @yuki-ycino for your help and the great plugin.