voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.5k stars 80 forks source link

rg can't open a floaterm #306

Closed zombo closed 2 years ago

zombo commented 3 years ago

Before reporting

Environment

If you are using vim(not neovim), fill in the following blanks

If you are using neovim, just run :checkhealth floaterm and post the content

below.

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

command! Broot FloatermNew --width=0.8 --height=0.8 Broot
command! Rg FloatermNew --width=0.8 --height=0.8 rg

Describe your question, feature request, or bug.

the rg.exe and bat.exe have been placed into the system path.

:Rg or :FloatermNew rg

no term showed

Broot is OK

Steps to reproduce

Using the minimal vimrc

set nocompatible
set hidden
set termguicolors
set runtimepath^=/path/to/vim-floaterm
filetype plugin indent on
syntax on

Steps to reproduce the behavior:

Actual behaviour

Expected behaviour

Screenshots(Optional, GIF is better)

voldikss commented 2 years ago

Can you try :term rg?

ChanthMiao commented 2 years ago

Well, here is the reason: https://github.com/voldikss/vim-floaterm/blob/399cb86a15b7f3ef32ba40edda0ee00f2bdb842b/autoload/floaterm/wrapper/rg.vim#L36

The fzf add this option support in https://github.com/junegunn/fzf/commit/0f9cb5590ec0a397143a7a4caf003a54885f4375

If you install fzf from system package manger, it may be too old (< 0.22.0). If you are a windows user, just download the latest ripgrep and fzf from their release page.