mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
Compare commits
11 commits
1f7ecd61cb
...
d2286843a6
Author | SHA1 | Date | |
---|---|---|---|
d2286843a6 | |||
ebbeb89b42 | |||
769ac9e6b3 | |||
a20c3fbbd3 | |||
|
715408d2bd | ||
|
1604c7423f | ||
|
dfdad4c2ce | ||
43e3663b2b | |||
|
b302e151e1 | ||
0ba3ccdab8 | |||
|
1bd0ae5f7e |
11 changed files with 156 additions and 39 deletions
|
@ -46,6 +46,8 @@ 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;
|
||||||
|
|
|
@ -285,6 +285,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
||||||
spellfiles to Neovim's runtime with ease.
|
spellfiles to Neovim's runtime with ease.
|
||||||
|
|
||||||
|
- Add combined nvf configuration (`config.vim`) into the final package's
|
||||||
|
passthru as `passthru.neovimConfiguration` for easier debugging.
|
||||||
|
|
||||||
[ppenguin](https://github.com/ppenguin):
|
[ppenguin](https://github.com/ppenguin):
|
||||||
|
|
||||||
- Telescope:
|
- Telescope:
|
||||||
|
@ -302,6 +305,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
`vim.languages.kotlin`
|
`vim.languages.kotlin`
|
||||||
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
||||||
- 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
|
||||||
|
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)
|
||||||
|
|
||||||
|
@ -326,4 +332,3 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
[Nowaaru](https://github.com/Nowaaru):
|
[Nowaaru](https://github.com/Nowaaru):
|
||||||
|
|
||||||
- Add `precognition-nvim`.
|
- Add `precognition-nvim`.
|
||||||
|
|
||||||
|
|
48
flake.lock
48
flake.lock
|
@ -38,11 +38,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728258832,
|
"lastModified": 1731182209,
|
||||||
"narHash": "sha256-RtrtcogcvjImxBMe/TRNoHT+6w4Omf64IhzI0/y6Zxk=",
|
"narHash": "sha256-yftvwv8bHEKjmSKREdkGLWTDhf7vA2Ssvl/XMpykigg=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "00ccbc83e83694b07005e8f9273ca8557e5f20ae",
|
"rev": "0a5e50286ca9f1b70eb4fa29ce84304cad657700",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -207,11 +207,11 @@
|
||||||
"plugin-catppuccin": {
|
"plugin-catppuccin": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730606011,
|
"lastModified": 1731169755,
|
||||||
"narHash": "sha256-efz7etLeDHflBBxsA1HdFsM4/cMD+psmanc2mxUKKtM=",
|
"narHash": "sha256-lsnePejThsEygTCKV/rfJJ/h+RSrro91am841iznJe4=",
|
||||||
"owner": "catppuccin",
|
"owner": "catppuccin",
|
||||||
"repo": "nvim",
|
"repo": "nvim",
|
||||||
"rev": "35d8057137af463c9f41f169539e9b190d57d269",
|
"rev": "637d99e638bc6f1efedac582f6ccab08badac0c6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1072,11 +1072,11 @@
|
||||||
"plugin-noice-nvim": {
|
"plugin-noice-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731022276,
|
"lastModified": 1731163840,
|
||||||
"narHash": "sha256-Rn8vNqVlDrhfcyVn/B8rY7ABlMgmbE4L8J6g0oV5Ywg=",
|
"narHash": "sha256-zT+fJ88V/LfmibXs4QpIyxCu1HHSjbqsrcQK/vadeRA=",
|
||||||
"owner": "folke",
|
"owner": "folke",
|
||||||
"repo": "noice.nvim",
|
"repo": "noice.nvim",
|
||||||
"rev": "4d48c360a19b3920a4041868530fd4b99919fa0c",
|
"rev": "2087bbf8cd64482b47fb5f33b5e0eabf329ab14b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1441,11 +1441,11 @@
|
||||||
"plugin-nvim-tree-lua": {
|
"plugin-nvim-tree-lua": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730603172,
|
"lastModified": 1731123986,
|
||||||
"narHash": "sha256-kwzsjwQ68yluytbVBkSqaVZKo1eaV8W1fUcmgcDJMIU=",
|
"narHash": "sha256-zt04Q3Mr1k9x6X6l3F9iy3C1edQYha4pQhDsOX5atPM=",
|
||||||
"owner": "nvim-tree",
|
"owner": "nvim-tree",
|
||||||
"repo": "nvim-tree.lua",
|
"repo": "nvim-tree.lua",
|
||||||
"rev": "610a1c189bdb2b9b936169b2ea9d1838f971fa2b",
|
"rev": "c7639482a1598f4756798df1b2d72f79fe5bb34f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1457,11 +1457,11 @@
|
||||||
"plugin-nvim-treesitter-context": {
|
"plugin-nvim-treesitter-context": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730295979,
|
"lastModified": 1731163983,
|
||||||
"narHash": "sha256-LKt1LkTfN3WTmychWoy4Hhil8CWn2LjPd+VV0aHNbrc=",
|
"narHash": "sha256-oRmhwRIynCNmgKpTtwUIliYf0Qo+zP3ymEWYs+vzx8A=",
|
||||||
"owner": "nvim-treesitter",
|
"owner": "nvim-treesitter",
|
||||||
"repo": "nvim-treesitter-context",
|
"repo": "nvim-treesitter-context",
|
||||||
"rev": "a2a334900d3643de585ac5c6140b03403454124f",
|
"rev": "158377d700596367a91ea41818f76abdbf75a232",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1537,11 +1537,11 @@
|
||||||
"plugin-onedark": {
|
"plugin-onedark": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720202427,
|
"lastModified": 1731171496,
|
||||||
"narHash": "sha256-TAVN4wa45a6ndugkvjb3ev5sBHsZCd5RbXWgW+3ds9A=",
|
"narHash": "sha256-NLHq9SUUo81m50NPQe8852uZbo4Mo4No10N3ptX43t0=",
|
||||||
"owner": "navarasu",
|
"owner": "navarasu",
|
||||||
"repo": "onedark.nvim",
|
"repo": "onedark.nvim",
|
||||||
"rev": "fae34f7c635797f4bf62fb00e7d0516efa8abe37",
|
"rev": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1713,11 +1713,11 @@
|
||||||
"plugin-rustaceanvim": {
|
"plugin-rustaceanvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731003427,
|
"lastModified": 1731172933,
|
||||||
"narHash": "sha256-Sobs/ybL7VPsyh2c0EED0U5kl/tGtFcaj76k9DYLuhw=",
|
"narHash": "sha256-B2AdSgGPANCBbVN+Sd7gvJ16ODZZwv4WSOxnRs3SWnk=",
|
||||||
"owner": "mrcjkb",
|
"owner": "mrcjkb",
|
||||||
"repo": "rustaceanvim",
|
"repo": "rustaceanvim",
|
||||||
"rev": "1c174224784973d782767197d73aecd9a0825753",
|
"rev": "244443311f1c4e34ec1ea7f219a4b682b6ec066e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1809,11 +1809,11 @@
|
||||||
"plugin-toggleterm-nvim": {
|
"plugin-toggleterm-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730458171,
|
"lastModified": 1731162901,
|
||||||
"narHash": "sha256-97yqt1H8fusscubDw6JA2ylBqAjPHyqvYHr2xFbRmyE=",
|
"narHash": "sha256-g1FwgCc3a8Fak0Nb0gQQ+SI44uyAGaH1tIk1qpaAPEY=",
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"repo": "toggleterm.nvim",
|
"repo": "toggleterm.nvim",
|
||||||
"rev": "5969229c0352ff1ed7f6e24aba9c6554e1842939",
|
"rev": "87b2d6a3cab8e2bd9a0255427074285f0365398d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -123,6 +123,11 @@ in {
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
paths = [neovim-wrapped printConfig printConfigPath];
|
||||||
postBuild = "echo Helpers added";
|
postBuild = "echo Helpers added";
|
||||||
|
|
||||||
|
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
||||||
|
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||||
|
# will return the configuration in full.
|
||||||
|
passthru.neovimConfig = vimOptions;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Wrapped version of Neovim with additional helper scripts";
|
description = "Wrapped version of Neovim with additional helper scripts";
|
||||||
mainProgram = "nvim";
|
mainProgram = "nvim";
|
||||||
|
|
|
@ -42,6 +42,20 @@ 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,6 +29,8 @@ 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"
|
||||||
|
@ -43,6 +45,12 @@ 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:
|
||||||
|
|
49
modules/plugins/languages/asm.nix
Normal file
49
modules/plugins/languages/asm.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
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,6 +2,7 @@
|
||||||
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
|
||||||
|
|
|
@ -14,6 +14,38 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
cfg = config.vim.languages.typst;
|
||||||
|
|
||||||
|
defaultServer = "tinymist";
|
||||||
|
servers = {
|
||||||
|
typst-lsp = {
|
||||||
|
package = pkgs.typst-lsp;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.typst_lsp.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
tinymist = {
|
||||||
|
package = pkgs.tinymist;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.tinymist.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/tinymist"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
defaultFormat = "typstfmt";
|
defaultFormat = "typstfmt";
|
||||||
formats = {
|
formats = {
|
||||||
typstfmt = {
|
typstfmt = {
|
||||||
|
@ -52,11 +84,17 @@ in {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
server = mkOption {
|
||||||
|
description = "Typst LSP server to use";
|
||||||
|
type = enum (attrNames servers);
|
||||||
|
default = defaultServer;
|
||||||
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "typst-lsp package, or the command to run as a list of strings";
|
description = "typst-lsp package, or the command to run as a list of strings";
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = pkgs.typst-lsp;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,19 +120,14 @@ 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.typst-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.typst-lsp = ''
|
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
lspconfig.typst_lsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach=default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ in {
|
||||||
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
|
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
|
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
|
||||||
color_icons = mkEnableOption "different highlight colors per icon";
|
color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
|
||||||
variant = mkOption {
|
variant = mkOption {
|
||||||
type = nullOr (enum ["light" "dark"]);
|
type = nullOr (enum ["light" "dark"]);
|
||||||
default = null;
|
default = null;
|
||||||
|
|
|
@ -189,7 +189,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
default = [];
|
default = {};
|
||||||
type = attrsOf lznPluginType;
|
type = attrsOf lznPluginType;
|
||||||
description = ''
|
description = ''
|
||||||
Plugins to lazy load.
|
Plugins to lazy load.
|
||||||
|
|
Loading…
Reference in a new issue