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

Fix vimPlugins #2984

Closed
wants to merge 1 commit into from
Closed

Fix vimPlugins #2984

wants to merge 1 commit into from

Conversation

tailhook
Copy link
Contributor

Seems to be simply a typo or similar

@domenkozar
Copy link
Member

Do we want prebuilt vim plugins?

@tailhook
Copy link
Contributor Author

I don't think they need to be pre-built. But installing with nix-env would be nice.

@domenkozar
Copy link
Member

@tailhook did you test that installing them via nix-env works?

@tailhook
Copy link
Contributor Author

Yes.
However, to enable you need to to add set tsp+=... as described in vim-plugins/default.nix. I believe this step may be fixed as well, but it may be ok to leave it as is.

@bjornfor
Copy link
Contributor

Having vim-plugins from nix-env or environment.systemPackages automatically picked up would be nice :-) (And for reference, the setting is called "rtp", not "tsp".)

@tailhook
Copy link
Contributor Author

I see basically three ways to achieve automatic installation:

  1. Adding the following to config:
set rtp+=~/.nix-profile/vim-plugins/*

Unfortunately command-t plugin doesn't work in this case (I'm not sure why it fails, others work)

  1. Compose a vimrc by adding a line with set rtp+= for each plugin. IIUC this means that plugins would be enabled in config not just installing them using nix-env
  2. Install each package not in vim-plugins/<plugin_name> but directly into vim-plugins like all other distributions do AFAIK (I mean they use shared directory for all plugins)

@tailhook
Copy link
Contributor Author

Hm, the last option doesn't work. Because all plugins have doc/tags folder.

Anyway I think the best solution so far is adding:

      ensureDir $out/vim-plugins/plugin                                         
      echo "set runtimepath^=$out/vim-plugins/${path}" > $out/vim-plugins/plugin/${path}.vim

to installPhase. I.e. it adds <profile>/vim-plugins/plugin/<pluginname>.vim file which is loaded by vim automatically and that file adds real path to a plugin into a runtimepath (same as rtp)

It works perfectly for nix-env. However, it doesn't work for systemPackages because vim-plugins directory is not symlinked into /run/current-system/sw/

Thoughts?

@tailhook
Copy link
Contributor Author

I'll make a better pull request soon

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

Successfully merging this pull request may close these issues.

3 participants