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

找不到fd #2

Closed
jyfzh opened this issue Mar 24, 2023 · 6 comments
Closed

找不到fd #2

jyfzh opened this issue Mar 24, 2023 · 6 comments

Comments

@jyfzh
Copy link

jyfzh commented Mar 24, 2023

OS: windows11
nvim: v0.8.3
fd: 8.7.0

报错:

Failed to source `C:/Users/jyf/AppData/Local/nvim-data/lazy/cppassist.nvim/plugin/cppassist.vim`

.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:438: Vim(echoerr):fd not found, please install it

# stacktrace:
  - ~/scoop/apps/neovim/current/share/nvim/runtime/filetype.lua:23
  - ~/scoop/apps/neovim/current/share/nvim/runtime/filetype.lua:22
  - telescope.nvim\lua\telescope\actions\set.lua:168 _in_ **run_replace_or_original**
  - telescope.nvim\lua\telescope\actions\mt.lua:65 _in_ **run_replace_or_original**
  - telescope.nvim\lua\telescope\actions\mt.lua:65 _in_ **run_replace_or_original**
  - telescope.nvim\lua\telescope\actions\mt.lua:65 _in_ **key_func**
  - telescope.nvim\lua\telescope\mappings.lua:350 _in_ **execute_keymap**

同样依赖fd的telescope.nvim检测到fd了,但是cppassist.nvim检测不到,也许是平台问题?希望提供自定义fd路径的选项

@Kohirus
Copy link
Owner

Kohirus commented Mar 25, 2023

使用 which fd 或者 which fdfind 命令可以找到 fd 吗?

@jyfzh
Copy link
Author

jyfzh commented Mar 25, 2023

可以找到,而且fd正常使用
fd是使用scoop安装的
image

@Kohirus
Copy link
Owner

Kohirus commented Mar 26, 2023

应该是平台的问题,目前只在 Linux 平台测试过,Windows 平台下无法找到 fd 的原因应该是如下代码导致的:

" check fd binary name (needed because it's called fdfdind on ubuntu)
" Then check if it's installed
if system('which fd')[0] ==# '/'
    let g:cppassist_fd_binary_name = 'fd'
elseif system('which fdfind')[0] ==# '/'
    let g:cppassist_fd_binary_name = 'fdfind'
else
    echoerr "fd not found, please install it"
    finish
endif

刚才我去看了 telescope 插件检测 fd 路径的相关代码,它会对 windows 平台做出相应处理,所以 telescope 是可以找到 fd 的。
由于我没有 windows 平台下的 neovim 环境,因此需要你在 neovim 中输入 :echo executable('fd'):echo has('win32') 看看结果是什么。

@jyfzh
Copy link
Author

jyfzh commented Mar 26, 2023

结果是这样的

:echo executable('fd')
1
:echo has('win32')
1

@Kohirus
Copy link
Owner

Kohirus commented Mar 27, 2023

你现在更新一下插件试试

@jyfzh
Copy link
Author

jyfzh commented Mar 27, 2023

ok了😎

@jyfzh jyfzh closed this as completed Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants