Yohannfra / Vim-Goto-Header

A Vim plugin to quickly jump to a c/c++ header file
MIT License
16 stars 3 forks source link

Windows fd issue #5

Open HrMitrev opened 6 months ago

HrMitrev commented 6 months ago

Hi! I like the plugin very much, but when using it under Windows, I got error because fd is not registered correctly.

system('which.fd')[0] returns C

Yohannfra commented 6 months ago

Hi,

As far as I know the which command is only available on GNU/linux os so I can understand why it doesn't work on Windows.

I don't have any windows laptop available to try but I'll accept any patch for this issue if you can fix it.

HrMitrev commented 6 months ago

Hi,

As far as I know the which command is only available on GNU/linux os so I can understand why it doesn't work on Windows.

I don't have any windows laptop available to try but I'll accept any patch for this issue if you can fix it.

You are right, but if you setup scoop you can install packages which add which.exe to $PATH. I am not experienced with vim syntax, but I can try to do a PR. One question about the code - how could you add OR statement. Will it be something like:

let fdpath = system('which fd')[0]
if (fdpath ==# '/' || fdpath ==#'C')
Yohannfra commented 6 months ago

Yes this is the correct syntax. You can find a very helpful cheatsheet for vimscript here https://devhints.io/vimscript