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

fzf: install fzf.vim to Neovim plugin directory #21733

Merged
merged 1 commit into from Sep 23, 2020

Conversation

gbrlsnchs
Copy link
Contributor

For Vim users, FZF works out of the box, but Neovim users have to
manually copy /usr/share/vim/vimfiles/plugin/fzf.vim to the proper
Neovim equivalent.

@Anachron
Copy link
Contributor

Anachron commented May 8, 2020

True, this creates not needed files for vim users though. Not sure how to solve this.

@daniel-eys
Copy link
Contributor

You don't have to copy vimfiles around, just add /usr/share/vim/vimfiles to your neovim runtimepath, so neovim can load plugins etc. from there, too.
set rtp+=/usr/share/vim/vimfiles

@gbrlsnchs
Copy link
Contributor Author

gbrlsnchs commented May 8, 2020

You don't have to copy vimfiles around, just add /usr/share/vim/vimfiles to your neovim runtimepath, so neovim can load plugins etc. from there, too.
set rtp+=/usr/share/vim/vimfiles

If I only use FZF without Vim, it'll create the files anyway... this way at least it's consistent.

Also, Neovim reads /usr/share/nvim/runtime by default, so why add vimfiles to it? It has its own files.

This is more a design issue with FZF... we have to install those files, what if I want to install Vim/Neovim after I have already installed FZF, I won't have the file instaled...

@gbrlsnchs
Copy link
Contributor Author

This PR is important for Neovim users that have FZF installed via XBPS. Vim support already existed and the files for it were installed regardless whether the user was a Vim user, so I just added support for Neovim. Unfortunately the flaw lies within FZF itself, since it is also home for the Vim plugin, when actually the plugin should be in a separate repository.

@gbrlsnchs gbrlsnchs closed this Sep 21, 2020
@gbrlsnchs gbrlsnchs deleted the fix-fzf-nvim branch September 21, 2020 15:00
@gbrlsnchs gbrlsnchs restored the fix-fzf-nvim branch September 21, 2020 15:06
@gbrlsnchs gbrlsnchs reopened this Sep 21, 2020
@ericonr
Copy link
Member

ericonr commented Sep 21, 2020

You still have 4 unrelated commits in this PR.

Also, anyone not wanting to have neovim files can just noextract= the directory in a xbps.d(5) file. It's better for the package to ship complete functionality if it's available from upstream.

@gbrlsnchs
Copy link
Contributor Author

gbrlsnchs commented Sep 21, 2020

You still have 4 unrelated commits in this PR.

Lol, sorry, just messed up the branch with my custom repository. Gonna fix that.

srcpkgs/fzf/template Outdated Show resolved Hide resolved
srcpkgs/fzf/template Show resolved Hide resolved
@gbrlsnchs gbrlsnchs marked this pull request as ready for review September 21, 2020 17:31
@ericonr
Copy link
Member

ericonr commented Sep 21, 2020

Squash the commits ;)

For Vim users, FZF works out of the box, but Neovim users have to
manually copy /usr/share/vim/vimfiles/plugin/fzf.vim to the proper
Neovim equivalent.

fzf: move completion functionality to correct path

`shell/completion.bash` is not argument completion, it's a completion
functionality for FZF (integration with `kill`, etc). Like the one for
ZSH, it should go to `/usr/share/doc/fzf`.
@gbrlsnchs
Copy link
Contributor Author

I have squashed the commits, however CI is timing out. 😖

@sgn
Copy link
Member

sgn commented Sep 23, 2020

True, this creates not needed files for vim users though. Not sure how to solve this.

Ask neovim's developers to read those files by default?

@ericonr
Copy link
Member

ericonr commented Sep 23, 2020

Is this possible? I think certain vim plugins might not be compatible with neovim.

@sgn
Copy link
Member

sgn commented Sep 23, 2020

Is this possible? I think certain vim plugins might not be compatible with neovim.

Honestly, I don't know. neovim advertises itself as new (neo) vim, and provides vim alternatives, it should compatible.
Like vim in set compatible mode?

@ahesford
Copy link
Member

I agree with @sgn. We have a number of packages that install various vim plugins and making two copies of the same plugin file to appease another editor seems foolish. We install the vim plugin because upstream provides a vim plugin. If you're not using vim, manage the mapping manually. You can even noextract vim directories if it bothers you to have them.

@ericonr
Copy link
Member

ericonr commented Sep 23, 2020

If you're not using vim, manage the mapping manually. You can even noextract vim directories if it bothers you to have them.

Vim plugins "taking up space" isn't the issue, it's not having neovim ones.

We are already treating the vim plugin specially, by installing it manually in the template. By https://github.com/junegunn/fzf/blob/master/README-VIM.md#fzf-inside-terminal-buffer, fzf upstream expects the plugin to also work for neovim, so IMO it's our responsibility as packagers to ship it for all our vim alternatives.

neovim upstream should ideally have a way of importing plugins from vim directories, but I don't think waiting for a resolution on that should be a blocker.

@gbrlsnchs
Copy link
Contributor Author

You can even noextract vim directories if it bothers you to have them.

The same applies for Neovim files then. Using noextract for it seems to be a solution.

Neovim is big enough to be taken into account. FZF on Arch Linux works out of the box with Neovim because files get installed for it too.

@sgn
Copy link
Member

sgn commented Sep 23, 2020

Hey, my fork of vim which hasn't been published read the plugin from /usr/share/svim/vimfiles, would you mind to update the PR to support my fork as well?

Anyway, my fork of Void Linux works out of the box, too, but it's heavily customised, so I couldn't merge it into void-packages.


This comment is a joke ;)

@gbrlsnchs
Copy link
Contributor Author

I don't really see a reason to make fun of my concern. I'm even spending my work time patching this in order to make FZF installation a better experience for others that won't probably have time or expertise patching this same issue.

I still use my own patch for it, so for me particularly it's fine, my intention here is to help others only.

@sgn
Copy link
Member

sgn commented Sep 23, 2020

Let's chill my friends :-p

@ericonr
Copy link
Member

ericonr commented Sep 23, 2020

Yes, it is unfortunate that VIM alternatives don't deal with plugins installed for the others. As it stands, I feel comfortable shipping this, neovim is a reasonably big vim fork.

@ericonr ericonr merged commit 466fb9e into void-linux:master Sep 23, 2020
@gbrlsnchs gbrlsnchs deleted the fix-fzf-nvim branch September 23, 2020 19:24
@jony255
Copy link
Contributor

jony255 commented Sep 23, 2020

I think this discussion is relevant to the pr I opened earlier today. Should I re-open it or keep it closed?

@gbrlsnchs
Copy link
Contributor Author

I think this discussion is relevant to the pr I opened earlier today. Should I re-open it or keep it closed?

As a user of both Void and Neovim, my opinion is to reopen and have it merged. noextract seems to be a good way to avoid Neovim files, if that's a problem.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants