mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
coq-nvim: init plugin
still need to add most options, but this is enough to be usable right now! This also sets up the work needed for other completion frameworks, notably things like nvim-cmp and compe.
This commit is contained in:
parent
6de23559d7
commit
f8b70a30ea
4 changed files with 140 additions and 14 deletions
47
plugins/completion/coq.nix
Normal file
47
plugins/completion/coq.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.coq-nvim;
|
||||
helpers = import ../helpers.nix { lib = lib; };
|
||||
plugins = import ../plugin-defs.nix { inherit pkgs; };
|
||||
|
||||
in {
|
||||
options = {
|
||||
programs.nixvim.plugins.coq-nvim = {
|
||||
enable = mkEnableOption "Enable coq-nvim";
|
||||
|
||||
installArtifacts = mkEnableOption "Install coq-artifacts";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = with types; nullOr (oneOf [bool (enum ["shut-up"])]);
|
||||
default = null;
|
||||
description = "Auto-start or shut up";
|
||||
};
|
||||
|
||||
recommendedKeymaps = mkOption {
|
||||
type = with types; nullOr bool;
|
||||
default = null;
|
||||
description = "Use the recommended keymaps";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = let
|
||||
settings = {
|
||||
auto_start = cfg.autoStart;
|
||||
"keymap.recommended" = cfg.recommendedKeymaps;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraPlugins = [
|
||||
plugins.coq-nvim
|
||||
] ++ optional cfg.installArtifacts plugins.coq-artifacts;
|
||||
plugins.lsp = {
|
||||
preConfig = ''
|
||||
vim.g.coq_settings = ${helpers.toLuaObject settings}
|
||||
local coq = require 'coq'
|
||||
'';
|
||||
setupWrappers = [(s: ''coq.lsp_ensure_capabilities(${s})'')];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue