Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuild for fzf.vim
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Jimmy2027
n00b
n00b


Joined: 12 May 2020
Posts: 47

PostPosted: Thu Aug 22, 2024 2:50 pm    Post subject: ebuild for fzf.vim Reply with quote

I would like to write an ebuild for fzf-vim: https://github.com/junegunn/fzf.vim
The issue is that it depends on fzf: https://github.com/junegunn/fzf, which itself is adding a fzf.vim file to `/usr/share/vim/vimfiles/plugin/fzf.vim` such that the fzf.vim from vim-fzf results in a conflict.
Is there any way to solve this? A simple ebuild could look like this: https://bpa.st/U7WA
Doing the following:

Code:
insinto /usr/share/vim/vimfiles/pack/plugins/start/
doins -r "${S}/autoload" "${S}/doc" "${S}/plugin"


worked for a while, but I recently updated the package and now vim does not find the fzf-vim commands anymore.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Thu Aug 22, 2024 5:40 pm    Post subject: Re: ebuild for fzf.vim Reply with quote

Jimmy2027 wrote:
I would like to write an ebuild for fzf-vim: https://github.com/junegunn/fzf.vim
The issue is that it depends on fzf: https://github.com/junegunn/fzf, which itself is adding a fzf.vim file to `/usr/share/vim/vimfiles/plugin/fzf.vim` such that the fzf.vim from vim-fzf results in a conflict.
Is there any way to solve this?


Just delete it prior to installing so portage won't merge it into the system. I believe the fzf.vim file from fzf.vim is the one which you want.

Best Regards,
Georgi
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Thu Aug 22, 2024 5:47 pm    Post subject: Reply with quote

This seems like a bug by the author. Maybe the file from fzf should be put into it's on "fzf" directory. Or maybe it can be removed if fzf.vim is it's replacement.
Quote:
fzf itself is not a Vim plugin, and the official repository only provides the basic wrapper function for Vim. It's up to the users to write their own Vim commands with it. However, I've learned that many users of fzf are not familiar with Vimscript and are looking for the "default" implementation of the features they can find in the alternative Vim plugins.

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Jimmy2027
n00b
n00b


Joined: 12 May 2020
Posts: 47

PostPosted: Thu Aug 22, 2024 6:16 pm    Post subject: Reply with quote

Sadly both fzf.vim files are needed and yes this seems like a bad design choice of the author :/
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Thu Aug 22, 2024 6:21 pm    Post subject: Reply with quote

pjp wrote:
This seems like a bug by the author.


Yes. At first glance it looked like the author just wanted to override fzf.vim provided by fzf, but when both files are compared, it doesn't look that way. Maybe an issue in fzf.vim could at least bring some clarity.

Also what happens when Plug is used? Any conflict?

In my opinion if it works with Plug or Vundle, it's not worth the trouble to write an ebuild.

If you insist on writing an ebuild, I would split it into two, one being app-vim/fzf with vim use flag and the other app-vim/fzf-vim requiring app-vim/fzf with vim enabled.

EDIT: on further investigation, both packages provided fzf.vim since the beginning. Are you sure the problem is not somewhere else?

Best Regards,
Georgi
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Thu Aug 22, 2024 6:48 pm    Post subject: Reply with quote

logrusx wrote:
EDIT: on further investigation, both packages provided fzf.vim since the beginning. Are you sure the problem is not somewhere else?
The filename collision is why I thought it was a bug. Jimmy2027's last comment indicating both files are required strongly suggests it needs to be addressed upstream. ::gentoo includes fzf, albeit without any USE flags. But fzf with USE vim would collide with the other packages file of the same name.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Thu Aug 22, 2024 6:55 pm    Post subject: Reply with quote

pjp wrote:
Jimmy2027's last comment indicating both files are required strongly suggests it needs to be addressed upstream. ::gentoo includes fzf, albeit without any USE flags. But fzf with USE vim would collide with the other packages file of the same name.


I don't think the plugin is intended to be used that way. The Vim ecosystem relies heavily on bundling plugins, this is inside of the ecosystem, not as separate packages. Not that it's impossible, but when plugins are bundled with tool like Vundle, Plug, Lazy.nvim or something else, they actually reside in their own respective and files from different plugins do not collide. Unless there's something in the source code that collides in logical point of view, there may be as many files with the same name as you like. They stay in their respective plugins directories and they don't collide.

Hence my suggestion if it works with Plug or Vundle, it's not worth the trouble to write ebuilds.

Best Regards,
Georgi
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Thu Aug 22, 2024 7:37 pm    Post subject: Reply with quote

I may have misunderstood. I thought both packages were trying to install a file at the same location, being:
/usr/share/vim/vimfiles/plugin/fzf.vim

If it's two files of the same name in different locations, then I don't think there's a problem at all. It would be a matter of precedence / preference resolution.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Fri Aug 23, 2024 5:00 am    Post subject: Reply with quote

pjp wrote:
If it's two files of the same name in different locations, then I don't think there's a problem at all. It would be a matter of precedence / preference resolution.


They do if a plugin manager is used. It'll install them in the user home directory. Here OP's trying to install fzf.vim globally and hence the file collision. If only one of them, namely fzf.vim is managed by the plugin manager, there will be no collision.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Jimmy2027
n00b
n00b


Joined: 12 May 2020
Posts: 47

PostPosted: Fri Aug 23, 2024 5:36 am    Post subject: Reply with quote

I would like to use only one package manager as much as I can. Maybe for this particular example it is not possible because of the unfortunate file collision. Is there any folder structure in /usr/share/vim/vimfiles that would allow vim to find both fzf.vim files? I guess I could also write the ebuild to merge both fzf.vim files into one, but at this point I agree that it would be better to use a plugin manager.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Fri Aug 23, 2024 6:59 am    Post subject: Reply with quote

Jimmy2027 wrote:
I would like to use only one package manager as much as I can.

I believe this is at least impractical with things like Vim/Neo-vim, Emacs, python, nodejs. You don't need this stuff system-wide.

Jimmy2027 wrote:
Maybe for this particular example it is not possible because of the unfortunate file collision. Is there any folder structure in /usr/share/vim/vimfiles that would allow vim to find both fzf.vim files?


I don't know.

Jimmy2027 wrote:
I guess I could also write the ebuild to merge both fzf.vim files into one


Messing with other packages files is highly undesirable. I'm not even sure if you can. Portage runs in a sandbox and you can't modify files outside of the sandbox.

Jimmy2027 wrote:
but at this point I agree that it would be better to use a plugin manager.


It is better to use the user plugin/package management for those I mentioned above. Even if somebody has packaged something in tree, better use user plugin management. It'll always give you the most recent versions and the best flexibility and configurability.

The option with an issue or a discussion item in the GitHub repo remains open and at this point the best information source if you want to understand something better.

Best Regards,
Georgi
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Fri Aug 23, 2024 10:55 pm    Post subject: Reply with quote

I'm not using these, but I don't bother with a plugin manager.

If I were writing the ebuild, I'd change the name of thew "new" file.

fzf uses fzf.vim
fzf.vim uses fzfvim.vim

Or something like that.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2418

PostPosted: Sat Aug 24, 2024 8:26 am    Post subject: Reply with quote

pjp wrote:
I'm not using these, but I don't bother with a plugin manager.


With things like Vim and any vim derivatives you're better off using user plugin management.

pjp wrote:
If I were writing the ebuild, I'd change the name of thew "new" file.

fzf uses fzf.vim
fzf.vim uses fzfvim.vim


That may work, but it's mot worth the trouble.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum