mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
Merge branch 'main' of https://github.com/NotAShelf/nvf into language-overhaul
This commit is contained in:
commit
8028b9973f
12 changed files with 331 additions and 211 deletions
|
@ -33,6 +33,7 @@
|
|||
"minimap"
|
||||
"notes"
|
||||
"projects"
|
||||
"repl"
|
||||
"rich-presence"
|
||||
"runner"
|
||||
"session"
|
||||
|
|
|
@ -21,7 +21,17 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
treesitter.enable = true;
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
||||
# Codecompanion depends on the YAML grammar being added. Below is
|
||||
# an easy way of adding an user-configurable grammar package exposed
|
||||
# by the YAML language module *without* enabling the whole YAML language
|
||||
# module. The package is defined even when the module is disabled.
|
||||
grammars = [
|
||||
config.vim.languages.yaml.treesitter.package
|
||||
];
|
||||
};
|
||||
|
||||
autocomplete.nvim-cmp = {
|
||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
||||
|
|
|
@ -48,7 +48,7 @@ in {
|
|||
cmdline = {
|
||||
sources = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
default = [];
|
||||
default = null;
|
||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||
};
|
||||
|
||||
|
|
|
@ -122,6 +122,21 @@ in {
|
|||
"fallback"
|
||||
];
|
||||
};
|
||||
|
||||
# cmdline is not enabled by default, we're just providing keymaps in
|
||||
# case the user enables them
|
||||
cmdline.keymap = {
|
||||
${mappings.complete} = ["show" "fallback"];
|
||||
${mappings.close} = ["hide" "fallback"];
|
||||
${mappings.scrollDocsUp} = ["scroll_documentation_up" "fallback"];
|
||||
${mappings.scrollDocsDown} = ["scroll_documentation_down" "fallback"];
|
||||
# NOTE: mappings.confirm is skipped because our default, <CR> would
|
||||
# lead to accidental triggers of blink.accept instead of executing
|
||||
# the cmd
|
||||
|
||||
${mappings.next} = ["select_next" "show" "fallback"];
|
||||
${mappings.previous} = ["select_prev" "fallback"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
56
modules/plugins/languages/clojure.nix
Normal file
56
modules/plugins/languages/clojure.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) either listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
||||
cfg = config.vim.languages.clojure;
|
||||
in {
|
||||
options.vim.languages.clojure = {
|
||||
enable = mkEnableOption "Clojure language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Clojure treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "clojure";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Clojure LSP support" // {default = config.vim.lsp.enable;};
|
||||
package = mkOption {
|
||||
type = either package (listOf str);
|
||||
default = pkgs.clojure-lsp;
|
||||
description = "Clojure LSP";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.clojure-lsp = ''
|
||||
lspconfig.clojure_lsp.setup {
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${getExe cfg.lsp.package}"}''
|
||||
};
|
||||
}
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -9,6 +9,7 @@ in {
|
|||
./cue.nix
|
||||
./dart.nix
|
||||
./clang.nix
|
||||
./clojure.nix
|
||||
./css.nix
|
||||
./elixir.nix
|
||||
./fsharp.nix
|
||||
|
|
19
modules/plugins/repl/conjure/conjure.nix
Normal file
19
modules/plugins/repl/conjure/conjure.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.repl.conjure;
|
||||
in {
|
||||
options.vim.repl.conjure = {
|
||||
enable = mkEnableOption "Conjure";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [pkgs.vimPlugins.conjure];
|
||||
};
|
||||
}
|
5
modules/plugins/repl/conjure/default.nix
Normal file
5
modules/plugins/repl/conjure/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./conjure.nix
|
||||
];
|
||||
}
|
5
modules/plugins/repl/default.nix
Normal file
5
modules/plugins/repl/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./conjure
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue