Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:Files and :FZF not working #677

Open
3 of 9 tasks
SalahuddinAsh opened this issue Jul 26, 2018 · 24 comments
Open
3 of 9 tasks

:Files and :FZF not working #677

SalahuddinAsh opened this issue Jul 26, 2018 · 24 comments
Labels

Comments

@SalahuddinAsh
Copy link

SalahuddinAsh commented Jul 26, 2018

  • Category
    • Question
    • Bug
    • Suggestion
  • OS
    • Linux
    • macOS
    • Windows
    • Etc.
  • Vim
    • Vim
    • Neovim

:Files and :FZF doesn't work. It just displays 0/0. Althought, all the rest of the commands work fine.

@janlazo
Copy link
Contributor

janlazo commented Jul 26, 2018

Need more detail on your environment (output of vim --version or :version, minimal vimrc, shell, which Windows OS, Cygwin?, did you upgrade both fzf repos to latest?, etc.)
Is running fzf (no args, no Vim plugin) by itself ok?

@SalahuddinAsh
Copy link
Author

I'm using Windows 7
ConEmu terminal
I've just installed fzf yesterday.
When I run fzf alone in ConEmu, it is not recognized.1

vim --version output:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 23 2017 19:48:19)
MS-Windows 32 Bit Konsolen-Version

What do you mean with minimal vimrc?

@janlazo
Copy link
Contributor

janlazo commented Jul 26, 2018

How did you install fzf? chocolatey? Is fzf in PATH?

Did you set TERM? Which shell do you use with ConEmu? bash?

For vim --version output, I need to know which (extra) patches are included.

minimal vimrc is the minimal config necessary to reproduce the problem. You can pass a custom vimrc to either vim or gvim from the command line with -u. For convenience, you can use vim-plug or Vim 8 packages to manipulate the runtimepath for the required plugins, included fzf and fzf.vim.

@SalahuddinAsh
Copy link
Author

SalahuddinAsh commented Jul 27, 2018

I installed fzf with choco install fzf
It was not in the path, but I added it now and it runs in cmd line. But it also shows 0/0 when run in the cmd
I did read someone talking about TERM but I don't know what is it and how should I set it.
In ConEmu I run cmd::Cmder shell.
The output of vim --version contains the following:

+acl             +ex_extra        -mouseshape      +tag_old_static
+arabic          +extra_search    +multi_byte      -tag_any_white
+autocmd         +farsi           +multi_lang      -tcl
-balloon_eval    +file_in_path    -mzscheme        +termguicolors
-browse          +find_in_path    -netbeans_intg   -tgetent
++builtin_terms  +float           +num64           -termresponse
+byte_offset     +folding         +packages        +textobjects
+channel         -footer          +path_extra      +timers
+cindent         +gettext/dyn     -perl            +title
+clientserver    -hangul_input    +persistent_undo -toolbar
+clipboard       +iconv/dyn       -postscript      +user_commands
+cmdline_compl   +insert_expand   +printer         +vertsplit
+cmdline_hist    +job             +profile         +virtualedit
+cmdline_info    +jumplist        -python          +visual
+comments        +keymap          -python3         +visualextra
+conceal         +lambda          +quickfix        +viminfo
+cryptv          +langmap         +reltime         +vreplace
+cscope          +libcall         +rightleft       +wildignore
+cursorbind      +linebreak       -ruby            +wildmenu
+cursorshape     +lispindent      +scrollbind      +windows
+dialog_con      +listcmds        +signs           +writebackup
+diff            +localmap        +smartindent     -xfontset
+digraphs        -lua             +startuptime     -xim
-dnd             +menu            +statusline      -xpm_w32
-ebcdic          +mksession       -sun_workshop    -xterm_save
+emacs_tags      +modify_fname    +syntax
+eval            +mouse           +tag_binary

I have the following in my vimrc


filetype off                           " required

" Set the runtime path to include Vundle and initialize
set rtp+=$VIM/vimfiles/bundle/Vundle.vim/
call vundle#begin('$VIM/vimfiles/bundle')

Plugin 'gmarik/Vundle.vim'             " Let Vundle manage packages, required
Plugin 'jremmen/vim-ripgrep'           " For crazy fast 'find in project' searching
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'

" All of your Plugins must be added before the following line
call vundle#end()                      " required
filetype plugin indent on              " required - use file type plugins

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

I expect the full output of vim --version to be similar to the following:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by [email protected]
Compiled by [email protected]
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +tag_binary
+arabic          +file_in_path    +mouse_sgr       +tag_old_static
+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
+balloon_eval    +float           +mouse_urxvt     +tcl
+browse          +folding         +mouse_xterm     +terminfo
++builtin_terms  -footer          +multi_byte      +termresponse
+byte_offset     +fork()          +multi_lang      +textobjects
+channel         +gettext         -mzscheme        +timers
+cindent         -hangul_input    +netbeans_intg   +title
+clientserver    +iconv           +packages        +toolbar
+clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             +perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua             +rightleft       +writebackup
+diff            +menu            +ruby            +X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     +xsmp_interact
+emacs_tags      +mouseshape      +startuptime     +xterm_clipboard
+eval            +mouse_dec       +statusline      -xterm_save
+ex_extra        +mouse_gpm       -sun_workshop    +xpm
+extra_search    -mouse_jsbterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -Wdate-time  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -lperl -ldl -lm -lpthread -lcrypt  -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm     

@SalahuddinAsh
Copy link
Author

SalahuddinAsh commented Jul 27, 2018

Sorry. I thought this was what you are interested in. Hete it is complete: (it is a German OS :) )

λ vim --version                                                                                                                                                                                                    
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 23 2017 19:48:19)                                                                                                                                                 
MS-Windows 32 Bit Konsolen-Version                                                                                                                                                                                 
Inklusive der Korrekturen: 1-586                                                                                                                                                                                   
�bersetzt von mool@tororo                                                                                                                                                                                          
Riesige Version ohne GUI. Ein- (+) oder ausschlie�lich (-) der Eigenschaften:                                                                                                                                      
+acl             +ex_extra        -mouseshape      +tag_old_static                                                                                                                                                 
+arabic          +extra_search    +multi_byte      -tag_any_white                                                                                                                                                  
+autocmd         +farsi           +multi_lang      -tcl                                                                                                                                                            
-balloon_eval    +file_in_path    -mzscheme        +termguicolors                                                                                                                                                  
-browse          +find_in_path    -netbeans_intg   -tgetent                                                                                                                                                        
++builtin_terms  +float           +num64           -termresponse                                                                                                                                                   
+byte_offset     +folding         +packages        +textobjects                                                                                                                                                    
+channel         -footer          +path_extra      +timers                                                                                                                                                         
+cindent         +gettext/dyn     -perl            +title                                                                                                                                                          
+clientserver    -hangul_input    +persistent_undo -toolbar                                                                                                                                                        
+clipboard       +iconv/dyn       -postscript      +user_commands                                                                                                                                                  
+cmdline_compl   +insert_expand   +printer         +vertsplit                                                                                                                                                      
+cmdline_hist    +job             +profile         +virtualedit                                                                                                                                                    
+cmdline_info    +jumplist        -python          +visual                                                                                                                                                         
+comments        +keymap          -python3         +visualextra                                                                                                                                                    
+conceal         +lambda          +quickfix        +viminfo                                                                                                                                                        
+cryptv          +langmap         +reltime         +vreplace                                                                                                                                                       
+cscope          +libcall         +rightleft       +wildignore                                                                                                                                                     
+cursorbind      +linebreak       -ruby            +wildmenu                                                                                                                                                       
+cursorshape     +lispindent      +scrollbind      +windows                                                                                                                                                        
+dialog_con      +listcmds        +signs           +writebackup                                                                                                                                                    
+diff            +localmap        +smartindent     -xfontset                                                                                                                                                       
+digraphs        -lua             +startuptime     -xim                                                                                                                                                            
-dnd             +menu            +statusline      -xpm_w32                                                                                                                                                        
-ebcdic          +mksession       -sun_workshop    -xterm_save                                                                                                                                                     
+emacs_tags      +modify_fname    +syntax                                                                                                                                                                          
+eval            +mouse           +tag_binary                                                                                                                                                                      
          System-vimrc-Datei: "$VIM\vimrc"                                                                                                                                                                         
        Benutzer-vimrc-Datei: "$HOME\_vimrc"                                                                                                                                                                       
 zweite Benutzer-vimrc-Datei: "$HOME\vimfiles\vimrc"                                                                                                                                                               
 dritte Benutzer-vimrc-Datei: "$VIM\_vimrc"                                                                                                                                                                        
         Benutzer-exrc-Datei: "$HOME\_exrc"                                                                                                                                                                        
 zweite Benutzer-exrc-Datei: "$VIM\_exrc"                                                                                                                                                                          
       defaults file: "$VIMRUNTIME\defaults.vim"                                                                                                                                                                   
�bersetzt: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE  -DFEAT_JOB_CHANNEL      -DWINVER=0x0501 -D_WIN32_WINNT=0x0501  /Fo.\ObjCi386/ /Ox /GL -DNDEBUG  /Zl /MT -DDYNAMIC_ICONV -DDYNAMIC_
GETTEXT -DFEAT_HUGE /Fd.\ObjCi386/ /Zi                                                                                                                                                                             
Linken: link /RELEASE /nologo /subsystem:console /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib uuid.lib /machine:i386  /nodefaultlib libcmt.lib  user32.lib    
      WSock32.lib  /PDB:vim.pdb -debug                                                                                                                                                                             

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

Is the Cmder task running cmd.exe or bash? I use ConEmu only, not the entire Cmder package.

@SalahuddinAsh
Copy link
Author

SalahuddinAsh commented Jul 27, 2018

It is running cmd.exe. But even when I switched it to run bash, fzf displayed 0/0.

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

In junegunn/fzf@7f0caf0#diff-4425af3239f24c731114661daef5a811R62, fzf uses cmd.exe builtins for searching files so the command should work with the default PATH. Can you try it without fzf on a plain cmd.exe prompt? Copy/paste the command between the backticks into the prompt and run it.

@SalahuddinAsh
Copy link
Author

Yes it works fine in the normal cmd line. Why doesn't it work in ConEmu?

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

@SalahuddinAsh Can you try with just ConEmu, not Cmder? Pick a task to run cmd.exe and run the same command.

@SalahuddinAsh
Copy link
Author

When I did that, it worked :)
Is there a way to get it work with Cmder::cmd?
I noticed it runs init.bat when I open a new Cmder::cmd

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

cmderdev/cmder@56613b9 has set TERM=cygwin in init.bat so fzf assumes that it is running on bash and POSIX utils (ex. find, grep, diff, vim) are in PATH. It runs a different command, junegunn/fzf@bf0cb4b#diff-4425af3239f24c731114661daef5a811R57. fzf outputs 0/0 because sh.exe is not in PATH or the command executed by sh.exe failed

Question is why Cmder does this when sh or bash set TERM already if it is unset.

@SalahuddinAsh
Copy link
Author

SalahuddinAsh commented Jul 27, 2018

Commenting the line that sets TERM in init.bat made the ConEmu started in cmd.exe and fzf runs well. But this is not what I hope to have.

@janlazo
Copy link
Contributor

janlazo commented Jul 27, 2018

Instead of changing init.bat, can you override the Cmder task? Is TERM=cygwin necessary for Cmder to work?

@SalahuddinAsh
Copy link
Author

TERM=cygwin makes Cmder looks nicer. When I removed it, Cmder looks like the default Windows shell

@janlazo
Copy link
Contributor

janlazo commented Jul 28, 2018

@SalahuddinAsh How does TERM=cygwin make Cmder look nicer? Does it use bash with a terminfo database?

@SalahuddinAsh
Copy link
Author

@janlazo I'm sorry but I don't know much about these details.
But what I mean is, with TERM=cygwin, the text in the terminal is colorful and pretty. While when I removed it it was only white as in the default Windows cmd

@janlazo
Copy link
Contributor

janlazo commented Jul 30, 2018

@SalahuddinAsh When using the Cmder task with TERM=cygwin, how do you check the value of TERM? echo %TERM% or echo $TERM?

@SalahuddinAsh
Copy link
Author

@janlazo sorry for the late reply
echo $TERM prints $TERM
echo %TERM% prints cygwin

@janlazo
Copy link
Contributor

janlazo commented Aug 3, 2018

@SalahuddinAsh I assume that Cmder task uses cmd.exe with no nested shells (ie. cmd.exe is only shell launched by Cmder through ConEmu). Can you give me a screenshot of Cmder with TERM=cygwin to get an idea of which package requires TERM to be set? bash and powershell do not support %VAR% syntax for environment variables and, IIRC, ConEmu does not depend on value of TERM.

ConEmu may modify PROMPT environment variable to add color to cmd.exe prompt. If the issue is the prompt, then I don't know how to solve it. I personally override it on ConEmu for a consistent prompt on Vim/Neovim's :terminal because Windows API supports up to 16 colors only prior to Windows 10.

@SalahuddinAsh
Copy link
Author

I decided to move to nvim-qt and there :Files is working fine.

@janlazo Thanks for your concern

@vamolessa
Copy link

this is also an issue when trying to use neovim and fzf with alacritty on windows
neovim needs TERM set to display nice colors
fzf needs it to not be set for it to work

@jdehorty
Copy link

jdehorty commented Feb 17, 2021

Spent several hours trying to get this to work without losing the nice formatting associated with set TERM=cygwin. The quick-fix for Cmder is to add the line set TERM= to the user_profile.cmd file (rather than the init.bat file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants