Commit Graph

58 Commits

Author SHA1 Message Date
Matthieu C.
ceed006199 neovim: remove warning about --replace
by using --replace-warn
2024-06-11 00:06:06 +02:00
Elliot Cameron
be137fd0d0 neovim: propagate pname and version through wrapper 2024-04-22 10:46:27 +02:00
John Chadwick
a55b396e05 neovim: also unset PYTHONSAFEPATH in python wrapper 2024-01-22 23:58:49 -05:00
Matthieu Coudron
022cbac13d neovim: make generated wrapper args overridable
especially useful in home-manager to remove the generated options
2023-12-27 23:01:38 +01:00
Lucas Hoffmann
1ada32da4b
neovim: generate init.lua by default (#222907)
* wrapNeovimUnstable: generate lua rc files by default

backwards compatible. The viml source is source from init.lua 

---------

Co-authored-by: Matthieu Coudron <886074+teto@users.noreply.github.com>
2023-12-27 20:38:59 +01:00
Matthieu Coudron
72729d323f neovim: run hooks for build phase
the latest changes skipped the postBuild hook which in turn would prevent the wrapping from being done
2023-10-11 01:58:44 +02:00
Matthieu Coudron
7d810bf8a4 neovim: enable structured attributes 2023-09-28 23:33:43 +02:00
Yusup
801e33f562
neovim: pass wrapper args only once (#257136) 2023-09-25 11:04:15 +02:00
figsoda
a040c852e6 neovim: install the required perl modules 2023-07-05 19:38:58 -04:00
Matthieu Coudron
2473b44627 neovim: add perl to supported providers
false by default.
I noticed checkhealth complaining about it

Which made me realize the providers ignored user config and were always
using default config, hence the backport.
2023-07-06 01:32:01 +02:00
Matthieu Coudron
c17904b980 neovim: more flexibility in startup commands
the neovim mechanisms generate provider rc configuration such as:
vim.g.<LANG>_host_prog=$out/bin/nvim-<LANG>

In home-manager, we want more control over it, e.g., to pass it via
command line or in init.lua.

We also want to retrieve the generated packpathDirs so that we can link
it in the expected $XDG_DATA_HOME folder so that we then dont have to
tell neovim where look for it anymore.
2023-04-07 10:21:22 +02:00
Shawn8901
3866fa44a7 treewide: remove global with lib; in pkgs/{audio,blockchain,editors} 2023-01-21 23:11:12 +01:00
Daniel Thwaites
d797db230d neovim: rename wrapper 2022-11-30 18:54:29 +01:00
Markus S. Wamser
c9d167f174 pkgs.applications: remove unused args 2022-10-12 16:00:16 +02:00
Florian Warzecha
86c51f68bc
nixos/neovim: fix remote plugin manifest generation (#191852)
Stops using ex mode when running neovim for remote plugin manifest generation, since that leads to errors in more recent neovim versions with various plugins.
neovim commit that breaks this plugin generation: https://github.com/neovim/neovim/commit/64d147b
2022-09-21 23:56:19 +02:00
Matthieu Coudron
e3c0484acd neovim: correctly concat single line configs
The changes introduced in https://github.com/NixOS/nixpkgs/pull/184364#discussion_r945772144
didn't concat correctly the plugin configs when they were a single
string see: https://github.com/nix-community/home-manager/pull/3147

This adds a test for it.
2022-08-20 21:12:18 +02:00
06kellyjac
d33f4a26a1 Revert "neovim: pass the --clean flag to only use wrapped rc"
This reverts commit ce49cb7792.
2022-08-05 11:51:15 +01:00
06kellyjac
ce49cb7792 neovim: pass the --clean flag to only use wrapped rc 2022-07-26 11:07:44 +02:00
Michael Adler
137a153655
neovim: provide default value for python3Env (#147241) 2021-12-01 10:15:46 +01:00
Matthieu Coudron
51e3fe5346 neovim: set meta in the unwrapped version
instead of the wrapper: the wrapper will inherit the value from the unwrapped version. This allows nix run nixpkgs#neovim-unwrapped to work too.
2021-07-10 20:49:40 +02:00
Matthieu Coudron
83f6711464 neovim.tests: added more tests
to check for creation of vi/vim aliases.
These tests also now follow the coding conventions of having tests in
passthru.test .
2021-06-09 21:45:25 +02:00
Matthieu Coudron
4a2cbcfbb4 neovim: add some tests
To test the generated RC is included in the file and that we have the
option not to wrap the RC.

run:
nix-build -A tests.vim
2021-06-07 18:21:21 +02:00
Nicolas Berbiche
fbe60d186b
neovim: always generate rplugin.vim (#124990) 2021-05-31 00:05:51 +02:00
Matthieu Coudron
4a860879ea wrapNeovimUnstable: accept a wrapRc boolean
additional argument not generated by makeNeovimConfig
If true (the default), appends "-u <customRc>" to the wrapped arguments.
Set to false if you want to control where to save the generated config
(e.g., in ~/.config/init.vim or project/.nvimrc)
2021-05-25 22:41:08 +02:00
Matthieu Coudron
a793aacf9d neovim: accepts an extraName to distinguish between wrappers
especially useful to distinguish between the different neovim generated during the tests
2021-05-25 22:41:07 +02:00
Martin Weinelt
d942d4473d neovim, neovimUtils, neovim-qt: drop python2 support
In 2a00e53bd pynvim support for python2 was disabled, this broke the
neovim build. I really think it is time to let go of python2 support in
neovim.
2021-05-02 22:43:53 +02:00
Ana Hobden
c9ab377ebc neovim: set meta.mainProgram
Signed-off-by: Ana Hobden <operator@hoverbear.org>
2021-04-26 07:13:22 -07:00
Matthieu Coudron
b3abdc9534
tests.vim: init (moved from vim-utils.nix) (#119467)
* tests.vim: init (moved from vim-utils.nix)

Moved tests from pkgs/misc/vim-plugins/vim-utils.nix to pkgs/test/vim.
Also reduced the amount of generated config:
- Make it possible to have an empty config when configured adequately
- removed default vim config when using native packages, it could be
  source of bugs see linked issues (syntax on overrides vim highlights)

Things to watch out for:
- if you set configure.beforePlugins yourself, you will need to add set nocompatible too not to lose it
- filetype indent plugin on | syn on is not enabled anymore by default for the vim-plug installer: I dont think we should override vim defualts, at least not here since it is shared with neovim. Also sometimes it's enabled before plugins (pathogen etc,) which is not consistent.


you can run the tests via
$ nix-build -A tests.vim
2021-04-21 12:55:05 +02:00
Ben Siraphob
e03c068af5 treewide: makeWrapper buildInputs to nativeBuildInputs 2021-02-19 20:09:16 +07:00
Ben Siraphob
badf51221d treewide: stdenv.lib -> lib 2021-01-16 17:58:11 +07:00
Klemens Nanni
e0f258f596
neovim: Do $PATH lookup in neovim.desktop instead of hardcoding derivation
See db236e588d "steam: Do $PATH lookup in steam.desktop [...]".
tl;dr: Otherwise widget/panel/desktop icons in DEs like KDE break.

Simply stop adding the full derivation path for neovim and stick with
how upstream uses no path at all.

While here, take care of gnvim.desktop as well by adjusting the sed(1)
expression (and simplifying it in one go);  I do not use gnvim.desktop
but built it and confirmed the resulting files to contain no full paths
any longer.
2020-11-05 11:41:53 +01:00
Matthieu Coudron
42cc40ddc8 neovim: fix nodejs and ruby generation
These were not translated correctly in the new wrapper.
2020-11-02 23:27:49 +01:00
Matthieu Coudron
95702fe6d2 neovim: revert change to extraMakeWrapperArgs
wrapNeovim incited users to use a list instead of a string. Revert that:
the change is not super useful while breaking home-manager.
2020-10-31 14:32:02 +01:00
Matthieu Coudron
2eb1610725
neovimUtils: neovim utilities to handle more usecases
Current nixpkgs always wraps neovim with the "-u" which has sideeffects as explained in https://github.com/NixOS/nixpkgs/issues/55376 : 
1.  vim won't set the variable $MYVIMRC as explained #34215
 2. vim skips loading folder-specific .vimrc / .nvimrc

I wanted to provide a way for users to better control what flags are used to wrap neovim. This is achived by introducing wrapNeovimUnstable et neovimUtils, utilities to help with that. We provide a compatibility layer so that wrapNeovim still works and to let us experiment with wrapNeovimUnstable to better control neovim configuration, plugin dependencies, haskell environment etc so that it becomes easier to generate per-project neovim config.

With this commit, it's possible for instance for home-manager to wrap neovim without the `-u` and just write the config in the
expected $XDG_CONFIG_HOME/nvim/init.vim .
Expect wrapNeovimUnstable interface to evolve in the upcoming months.
2020-10-29 09:50:26 +01:00
Matthieu Coudron
4c4c4874c4
neovim: add config to passthru (#101100)
first will register the config under the name init.vim which is more
appropriate for neovim.
Pass the generated config to passthru so that one can easily pass the
current config to a
raw/unwrapped neovim (helps with development).

For instance, home-manager can reference the config in $XDG_CONFIG_HOME/nvim/init.vim
without the need to wrap nvim with its config.
2020-10-20 12:26:39 +02:00
Konstantin Alekseev
f9a5d8539d neovim: fix node neovim binary link 2020-08-12 13:59:02 -07:00
Doron Behar
c63b5c4c36 wrapNeovim: fix darwin build 2020-08-04 09:14:09 +03:00
Doron Behar
85f6da6eed wrapNeovim: Rewrite
Cleanups:
- Removed unneeded neovim.meta.description reset.
- Remove unnecessary -x checks in `postBuild`.
- Use a ${placeholder "out"} if needed.

Changes:
- Switch to symlinkJoin, so e.g manpages link to the environment (#87929).
- Use nvim-node from $out/bin/ just like all other providers.
- Compute all arguments to makeWrapper in pure Nix "before" `postBuild`.
- Prevent double wrapping in case `configure != {}` and rplugin.vim
  needs to be generated.

Co-authored-by: Silvan Mosberger <contact@infinisil.com>
2020-07-31 20:39:12 +03:00
Ersin Akinci
588ca6e310
neovim: use TMPDIR as home during initilizaiton 2020-03-15 12:55:06 +00:00
Wael M. Nasreddine
7909787a7d Revert "vimPlugins: turn filetype and syntax before sourcing the plugins (#66536)"
This reverts commit a3bf0c2e40.
2020-01-07 13:13:41 -08:00
Shreyansh Khajanchi
3388941c59 neovim: fix icon not displaying 2019-10-17 11:34:40 +09:00
Wael Nasreddine
a3bf0c2e40
vimPlugins: turn filetype and syntax before sourcing the plugins (#66536)
Vim Terraform expects the `filetypedetect` group to exist. However, since we were enabling the filetype and the syntax *after* loading the plugins, it was exiting with an error preventing us from generating the remote plugins manifest with the plugin enabled. See #65894 for context.
2019-08-13 12:25:06 -07:00
Jonas Holst Damtoft
dbb27af6c6 neovim: Allow passing extra makeWrapperArgs 2019-05-29 18:15:15 +09:00
Timo Kaufmann
ab22e8cc9c neovim: generate remote plugin manifest
This makes sure the user doesn't have to call `UpdateRemotePlugins`
manually for plugins installed through nix. A minor patch to neovim is
necessary, but it should be harmless. See
https://github.com/neovim/neovim/issues/9413 for a discussion about
the patch.
2019-01-18 21:18:32 +01:00
Timo Kaufmann
51c4768f67 neovim: fix indentation 2019-01-18 21:15:17 +01:00
Alexey Shmalko
bc51418f1a
neovim-pygui: remove 2018-12-10 23:19:45 +02:00
Alexey Shmalko
4898e09215
pythonPackages.neovim-0.3.0 -> pythonPackages.pynvim-0.3.1 2018-12-09 01:15:41 +02:00
Wael M. Nasreddine
da4a004193
neovim wrapper: add withNodeJs to build wrapper with nodejs support 2018-11-14 19:54:47 -08:00
John Ericson
51907d257c stdenv, neovim: Use lib.warn for deprecation warnings 2018-09-05 11:40:29 -04:00
Symphorien Gibol
dddaa94ac2 neovim wrapper: also make <vimplugin>.pythonDepedencies a function
A function of the same signature as the argument of python.withPackages
2018-07-27 00:27:44 +02:00