mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-25 22:56:46 +00:00
Compare commits
No commits in common. "516174e29699cf8c0fea84ca32cbe26d30248410" and "dfdad4c2cee7bad1a0f16db3d091f7a1e9f7247c" have entirely different histories.
516174e296
...
dfdad4c2ce
13 changed files with 291 additions and 439 deletions
|
@ -46,8 +46,6 @@ isMaximal: {
|
||||||
|
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
|
|
||||||
# Assembly is not common, and the asm LSP is a major hit-or-miss
|
|
||||||
assembly.enable = false;
|
|
||||||
markdown.enable = isMaximal;
|
markdown.enable = isMaximal;
|
||||||
html.enable = isMaximal;
|
html.enable = isMaximal;
|
||||||
css.enable = isMaximal;
|
css.enable = isMaximal;
|
||||||
|
|
|
@ -297,7 +297,6 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
[Soliprem](https://github.com/Soliprem):
|
[Soliprem](https://github.com/Soliprem):
|
||||||
|
|
||||||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||||
- Add formatter suppoort for R, with styler and formatR as options
|
|
||||||
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
||||||
ccc
|
ccc
|
||||||
- Fixed typo in Otter's setupOpts
|
- Fixed typo in Otter's setupOpts
|
||||||
|
@ -308,7 +307,6 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
||||||
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
||||||
the Typst language module.
|
the Typst language module.
|
||||||
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
|
|
||||||
|
|
||||||
[Bloxx12](https://github.com/Bloxx12)
|
[Bloxx12](https://github.com/Bloxx12)
|
||||||
|
|
||||||
|
|
516
flake.lock
516
flake.lock
File diff suppressed because it is too large
Load diff
|
@ -42,20 +42,6 @@ in {
|
||||||
after = ''
|
after = ''
|
||||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
local kinds = require("cmp.types").lsp.CompletionItemKind
|
|
||||||
local deprio = function(kind)
|
|
||||||
return function(e1, e2)
|
|
||||||
if e1:get_kind() == kind then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if e2:get_kind() == kind then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup(${toLuaObject cfg.setupOpts})
|
cmp.setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
||||||
${optionalString config.vim.lazy.enable
|
${optionalString config.vim.lazy.enable
|
||||||
|
|
|
@ -29,8 +29,6 @@ in {
|
||||||
sorting.comparators = mkOption {
|
sorting.comparators = mkOption {
|
||||||
type = mergelessListOf (either str luaInline);
|
type = mergelessListOf (either str luaInline);
|
||||||
default = [
|
default = [
|
||||||
(mkLuaInline "deprio(kinds.Text)")
|
|
||||||
(mkLuaInline "deprio(kinds.Snippet)")
|
|
||||||
"offset"
|
"offset"
|
||||||
"exact"
|
"exact"
|
||||||
"score"
|
"score"
|
||||||
|
@ -45,12 +43,6 @@ in {
|
||||||
(see `:help cmp-config.sorting.comparators`),
|
(see `:help cmp-config.sorting.comparators`),
|
||||||
or a string, in which case the builtin comparator with that name will
|
or a string, in which case the builtin comparator with that name will
|
||||||
be used.
|
be used.
|
||||||
|
|
||||||
A `deprio` function and a `kinds`
|
|
||||||
(`require("cmp.types").lsp.CompletionItemKind`) variable is provided
|
|
||||||
above `setupOpts`. By passing a type to the funcion, the returned
|
|
||||||
function will be a comparator that always ranks the specified kind the
|
|
||||||
lowest.
|
|
||||||
'';
|
'';
|
||||||
apply = map (
|
apply = map (
|
||||||
c:
|
c:
|
||||||
|
|
|
@ -24,7 +24,7 @@ in {
|
||||||
cmd = ["Neotree"];
|
cmd = ["Neotree"];
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals.nvim-web-devicons.enable = true;
|
visuals.nvimWebDevicons.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.types) package;
|
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.assembly;
|
|
||||||
in {
|
|
||||||
options.vim.languages.assembly = {
|
|
||||||
enable = mkEnableOption "Assembly support";
|
|
||||||
|
|
||||||
treesitter = {
|
|
||||||
enable = mkEnableOption "Assembly treesitter" // {default = config.vim.languages.enableTreesitter;};
|
|
||||||
package = mkGrammarOption pkgs "asm";
|
|
||||||
};
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = pkgs.asm-lsp;
|
|
||||||
description = "asm-lsp package";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
|
||||||
vim.lsp.lspconfig.enable = true;
|
|
||||||
vim.lsp.lspconfig.sources.asm-lsp = ''
|
|
||||||
lspconfig.asm_lsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = {"${cfg.lsp.package}/bin/asm-lsp"},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
|
@ -2,7 +2,6 @@
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./asm.nix
|
|
||||||
./bash.nix
|
./bash.nix
|
||||||
./dart.nix
|
./dart.nix
|
||||||
./clang.nix
|
./clang.nix
|
||||||
|
|
|
@ -15,38 +15,7 @@
|
||||||
cfg = config.vim.languages.r;
|
cfg = config.vim.languages.r;
|
||||||
|
|
||||||
r-with-languageserver = pkgs.rWrapper.override {
|
r-with-languageserver = pkgs.rWrapper.override {
|
||||||
packages = [pkgs.rPackages.languageserver];
|
packages = with pkgs.rPackages; [languageserver];
|
||||||
};
|
|
||||||
|
|
||||||
defaultFormat = "format_r";
|
|
||||||
formats = {
|
|
||||||
styler = {
|
|
||||||
package = pkgs.rWrapper.override {
|
|
||||||
packages = [pkgs.rPackages.styler];
|
|
||||||
};
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.styler.with({
|
|
||||||
command = "${cfg.format.package}/bin/R",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
format_r = {
|
|
||||||
package = pkgs.rWrapper.override {
|
|
||||||
packages = [pkgs.rPackages.formatR];
|
|
||||||
};
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.format_r.with({
|
|
||||||
command = "${cfg.format.package}/bin/R",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultServer = "r_language_server";
|
defaultServer = "r_language_server";
|
||||||
|
@ -93,22 +62,6 @@ in {
|
||||||
default = servers.${cfg.lsp.server}.package;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "R formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
description = "R formatter to use";
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
description = "R formatter package";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
@ -117,11 +70,6 @@ in {
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
|
||||||
vim.lsp.null-ls.enable = true;
|
|
||||||
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
|
|
@ -4,20 +4,33 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.binds.whichKey;
|
cfg = config.vim.binds.whichKey;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim.startPlugins = ["which-key"];
|
||||||
startPlugins = ["which-key"];
|
|
||||||
|
|
||||||
pluginRC.whichkey = entryAnywhere ''
|
vim.pluginRC.whichkey = entryAnywhere ''
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup (${toLuaObject cfg.setupOpts})
|
wk.setup ({
|
||||||
wk.register(${toLuaObject cfg.register})
|
key_labels = {
|
||||||
'';
|
["<space>"] = "SPACE",
|
||||||
};
|
["<leader>"] = "SPACE",
|
||||||
|
["<cr>"] = "RETURN",
|
||||||
|
["<tab>"] = "TAB",
|
||||||
|
},
|
||||||
|
|
||||||
|
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
||||||
|
window = {
|
||||||
|
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
|
||||||
|
},
|
||||||
|
''}
|
||||||
|
})
|
||||||
|
|
||||||
|
wk.register(${toLuaObject cfg.register})
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
_: {
|
||||||
imports = [
|
imports = [
|
||||||
./which-key.nix
|
./which-key.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
|
|
|
@ -1,51 +1,14 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
config,
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
lib,
|
inherit (lib.types) attrsOf nullOr str;
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
|
||||||
inherit (lib.types) attrsOf nullOr str attrs enum bool;
|
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
||||||
in {
|
in {
|
||||||
options.vim.binds.whichKey = {
|
options.vim.binds.whichKey = {
|
||||||
enable = mkEnableOption "which-key keybind helper menu";
|
enable = mkEnableOption "which-key keybind helper menu";
|
||||||
|
|
||||||
register = mkOption {
|
register = mkOption {
|
||||||
|
description = "Register label for which-key keybind helper menu";
|
||||||
type = attrsOf (nullOr str);
|
type = attrsOf (nullOr str);
|
||||||
default = {};
|
default = {};
|
||||||
description = "Register label for which-key keybind helper menu";
|
|
||||||
};
|
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "which-key" {
|
|
||||||
preset = mkOption {
|
|
||||||
type = enum ["classic" "modern" "helix"];
|
|
||||||
default = "modern";
|
|
||||||
description = "The default preset for the which-key window";
|
|
||||||
};
|
|
||||||
|
|
||||||
notify = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Show a warning when issues were detected with mappings";
|
|
||||||
};
|
|
||||||
|
|
||||||
replace = mkOption {
|
|
||||||
type = attrs;
|
|
||||||
default = {
|
|
||||||
"<space>" = "SPACE";
|
|
||||||
"<leader>" = "SPACE";
|
|
||||||
"<cr>" = "RETURN";
|
|
||||||
"<tab>" = "TAB";
|
|
||||||
};
|
|
||||||
description = "Functions/Lua Patterns for formatting the labels";
|
|
||||||
};
|
|
||||||
|
|
||||||
win = {
|
|
||||||
border = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = config.vim.ui.borders.plugins.which-key.style;
|
|
||||||
description = "Which-key window border style";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
(mkRemovedOptionModule ["vim" "visuals" "enable"] ''
|
(mkRemovedOptionModule ["vim" "visuals" "enable"] ''
|
||||||
As top-level toggles are being deprecated, you are encouraged to handle plugin
|
As top-level toggles are being deprecated, you are encouraged
|
||||||
toggles under individual options.
|
to handle plugin toggles under individual options.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
./cellular-automaton
|
./cellular-automaton
|
||||||
|
|
Loading…
Reference in a new issue