Commit Graph

60 Commits

Author SHA1 Message Date
oxalica
039fc793c3
vim_configurable: handle python3Dependencies 2021-08-15 21:59:47 +08:00
Matthieu Coudron
06684792fb vimPlugins.plenary: init from lua package
This commit shows how to convert luarocks packages into (neo)vim ones.
The advantage for neovim lua plugins to register their rockspec (aka
package definition) is that the plugin can express its dependencies and
a few metadata through it.
2021-08-09 21:23:29 +02:00
Matthieu Coudron
1d1c6753c6 neovim: set packpath only if there are packages
part of the work to automatically disable the generation of init.vim when unnecessary
2021-06-07 23:36:03 +02:00
Tim Cuthbertson
3b4cace64d vim-utils: append customRC after plug / pathogen plugins are loaded 2021-06-06 16:25:11 +02:00
Matthieu Coudron
7836469dbe neovimUtils: makeNeovimConfig accepts plugins/customRc
mimics home-manager interface and makes it easier to associate configs with plugins. Added a test as well.
2021-05-25 22:41:08 +02:00
Matthieu Coudron
abb1e5cd4c vimUtils: dont use the alias to vim-pathogen
it breaks vim builds when disallowing aliases
2021-05-25 22:41:07 +02: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
badf51221d treewide: stdenv.lib -> lib 2021-01-16 17:58:11 +07: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
Isaac W Hanson
be1594bf7a vim-utils: restore beforePlugins option
some plugins require configuration before their plugin definition
2020-05-06 14:18:44 -04:00
Timo Kaufmann
71331ee9ef
Merge pull request #74846 from rummik/vam-regression
Fix converting vam.pluginDictionaries to VimL
2020-03-19 21:39:01 +00:00
*Kim Zick (rummik)
6de54148ef vim-utils: Fix converting vam.pluginDictionaries to VimL 2020-03-19 17:22:52 -04:00
vasile luta
5d2ea07f02 vimUtils.vimrcFile: fixes packpath order 2020-01-23 20:53:07 +02:00
Wael M. Nasreddine
8dccb59bac vim-plugins: honor the plugin manager re filetype and syntax
Currently, all the filetype and syntax are enabled *after* all the plugins has
already been loaded. Whilst this is the case for Pathogen, it's not
recommended when using VAM.

This commit applies the recommendation for:
- VAM[0]: The filetype and syntax are enabled *before* the plugins are loaded.
- Pathogen[1]: The filetype and syntax are enabled *after* the plugins are loaded.
- Plug[2]: The filetype and syntax are automatically enabled.

[0]: d9e865f3c2 (recommended-setup)
[1]: a553410f1b/README.markdown (runtime-path-manipulation)
[2]: 2f5f74e5e6/README.md (usage)
2020-01-07 13:13:41 -08:00
Wael M. Nasreddine
5f0327a6e0 vim-plugins: remove unused and empty neobundleImpl 2020-01-07 13:13:41 -08:00
Wael M. Nasreddine
e7faae24c0 vim-plugins: remove unused and empty vundleImpl 2020-01-07 13:13:41 -08:00
Wael M. Nasreddine
7909787a7d Revert "vimPlugins: turn filetype and syntax before sourcing the plugins (#66536)"
This reverts commit a3bf0c2e4005670fd710e7eb42403e0348754e77.
2020-01-07 13:13:41 -08:00
volth
7b8fb5c06c treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
volth
08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
volth
35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00: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
Maximilian Bosch
12a7cc0d1f
Merge pull request #52685 from timokau/fzf-vim-dep
vimPlugins.fzf-vim: automatically add fzfWrapper
2019-08-11 17:16:36 +02:00
Jörg Thalheim
dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00
Mateusz Gołębiewski
75211154ed vim: Allow independent setting of executable names
* Allow settign gvim wrapper name independently of vim wrapper name.
* Allow setting vim wrapper name independently of derivation name.
* Refactor multiple places where name was checked for null with default
  value.
2019-02-24 05:07:46 +01:00
Patrick Callahan
b623da79e4 vim-utils: include vim man pages in the output of vim_customizable.customize 2019-02-24 04:31:00 +01:00
Timo Kaufmann
15bb6289d9 vimPlugins: fix vam dependency handling 2019-02-19 18:09:37 +01:00
Vladimír Čunát
3fe32b675e
Merge branch 'master' into staging 2019-01-22 15:59:42 +01: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
rnhmjoj
bcf54ce5bb
treewide: use ${stdenv.shell} instead of /bin/sh where possible 2019-01-16 20:37:15 +01:00
Timo Kaufmann
801a548183 vimUtils: fix map parentheses 2019-01-02 22:59:19 +01:00
Timo Kaufmann
f38363387e vimUtils: apply pluginToDrv recursively
This is necessary to handle plugin dependencies which also may be
strings.
2019-01-02 22:12:27 +01:00
Timo Kaufmann
a0dc57e27b
vimUtils: derive pname from the plugin string (#53121)
For backwards compatibility. The user may specify their own plugins
without the pname attribute. In that case the attrname of the plugin
(given as a string) is the pname.

Fixes #53112
2018-12-31 16:26:06 +01:00
Timo Kaufmann
093cfde1e0 vimUtils: fix requiredPlugins
I broke this in #52767 and didn't notice because I only tested with vim
and `requiredPlugins` is only used by neovim. This would break setups
that use string-plugins (like pathogen) with neovim.
2018-12-31 10:31:14 +01:00
Timo Kaufmann
96b6396101 vimUtils.buildVimPlugin: derive name from pname and version 2018-12-27 10:34:14 +01:00
Timo Kaufmann
8e8a09bfc9 vimUtils: add dependency logic to nativeImpl
nativeImpl previously simply ignored dependency information.
2018-12-24 23:41:44 +01:00
Timo Kaufmann
b352318cd1 vimUtils: represent vim plugins as derivations
Vim plugins were previously represented as strings by default,
necessitating a `knownPlugins` set. Backwards compatibility is kept
(strings are still accepted), so vam plugins should continue to work.
2018-12-24 23:41:41 +01:00
Thomas Kerber
3afe74864c
vim-utils: fix broken vim-plug implementation. 2018-09-20 14:41:12 +01:00
Jörg Thalheim
bd46155a8d vimUtils: replace vim-addon-nix with vim-nix
vim-addon-nix throws weird errors on startup
2018-09-20 08:26:03 +01:00
Roman Volosatovs
516a83c0e8
vimPlugins: Add vim-plug addon implementation 2018-09-20 08:52:32 +02: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
Profpatsch
b90104ea0e lib/debug: fix use-sites of deprecated debug functions 2018-04-27 18:59:39 +02:00
Maximilian Bosch
8e70725077
vim_configurable: enable overrides
Sometimes it's needed to override parts of `vim_configurable`, for
instance when using ENSIME (http://ensime.github.io/), in this case you
need a Python interpreter and the modules `sexpdata` and
`websocket_client`.

However overriding `vim_configurable` is quite hard as we run
`vimUtils.makeCustomizable` over the default comming from
`configurable.nix`. Therefore it's necessary to copy the code from
`all-packages.nix` and alter the parts you need: https://nixos.org/nix-dev/2017-April/023364.html

In order to simplify overriding `vim_configurable` I added an
`override` and an `overrideAttrs` function to `vimutils.makeCustomizable`
to ensure that the customization capabilities won't be lost after
altering the derivation.

Now it's possible to write expressions like this without evaluation
failures:

```
with pkgs;

let
  vimPy3 = vim_configurable.override {
    python = python3;
  };
in vimPy3.customize { ... }
```
2018-02-07 16:57:40 +01:00
Maximilian Bosch
acf0ee69ba
vim-plugins: add overrideAttrs support for buildVimPluginFrom2Nix 2017-10-01 11:33:12 +02:00
Maximilian Bosch
5fb2184bd3
vim-plugins: add {pre,post}Install hooks to buildVimPlugin 2017-09-25 22:18:47 +02:00
Evan Danaher
c34aa75d30 vim-utils: Handle overriding knownPlugins betters. 2017-03-19 18:44:02 -04:00
Michael Raskin
846b6d250a Merge pull request #23256 from edanaher/ensime
Ensime
2017-03-18 18:24:19 +01:00
Daiderd Jordan
8977b1f2ee vim-plugins: use https for github repositories 2017-03-04 13:16:46 +01:00
Evan Danaher
dcab427908 vim-plugins: Add infrastructure for python[3]Dependencies.
This allows vim plugins to specify python dependencies required at
runtime, and they will be added to the python environment.
2017-02-27 12:36:03 -05:00
Nick Novitski
7bb0611e2e vim_configurable: Add packPath option to vimrcConfig (#22776)
* vim_configurable: Add packages option to vimrcConfig

Version 8 of vim adds the concept of "vim packages": directories which
contain one or more vim plugins, in either "start" or "opt"
subdirectories. Those in "start" are to be loaded automatically, while
those in "opt" can be loaded manually. Vim detects any packages located
in one of its "packpaths".

The packages option takes a set of sets describing one or more vim
packages, and adds the derivation containing these packages to the
packpath.

* fix documentation.
2017-02-22 01:06:34 +01:00
Jörg Thalheim
b7d65f8af0
vim.vam: fix filetype detection
According to https://github.com/MarcWeber/vim-addon-manager/blob/master/doc/vim-addon-manager-additional-documentation.txt#L1310
`filetype on` must be called after all VAM plugins are initialized.
Otherwise vim set `conf` filetype for some files containing hash tags.
2017-02-13 14:10:23 +01:00