mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-08 09:09:49 +01:00
Compare commits
3 commits
7416fee7df
...
2bc3adf8ae
Author | SHA1 | Date | |
---|---|---|---|
|
2bc3adf8ae | ||
8febf44422 | |||
|
4eeadf3c96 |
5 changed files with 116 additions and 13 deletions
|
@ -3,12 +3,16 @@
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||||
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
|
|
||||||
- Add [typst-preview.nvim] under
|
- Add [typst-preview.nvim] under
|
||||||
`languages.typst.extensions.typst-preview-nvim`.
|
`languages.typst.extensions.typst-preview-nvim`.
|
||||||
|
|
||||||
- Add a search widget to the options page in the nvf manual.
|
- Add a search widget to the options page in the nvf manual.
|
||||||
|
|
||||||
|
- Add [render-markdown.nvim] under
|
||||||
|
`languages.markdown.extensions.render-markdown-nvim`
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1694,6 +1694,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-render-markdown-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1735525479,
|
||||||
|
"narHash": "sha256-ncFqBv0JITX3pTsLON+HctLUaKXhLRMBUrRWmI8KOSA=",
|
||||||
|
"owner": "MeanderingProgrammer",
|
||||||
|
"repo": "render-markdown.nvim",
|
||||||
|
"rev": "6fbd1491abc104409f119685de5353c35c97c005",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "MeanderingProgrammer",
|
||||||
|
"repo": "render-markdown.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-rose-pine": {
|
"plugin-rose-pine": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -2170,6 +2186,7 @@
|
||||||
"plugin-precognition-nvim": "plugin-precognition-nvim",
|
"plugin-precognition-nvim": "plugin-precognition-nvim",
|
||||||
"plugin-project-nvim": "plugin-project-nvim",
|
"plugin-project-nvim": "plugin-project-nvim",
|
||||||
"plugin-registers": "plugin-registers",
|
"plugin-registers": "plugin-registers",
|
||||||
|
"plugin-render-markdown-nvim": "plugin-render-markdown-nvim",
|
||||||
"plugin-rose-pine": "plugin-rose-pine",
|
"plugin-rose-pine": "plugin-rose-pine",
|
||||||
"plugin-rtp-nvim": "plugin-rtp-nvim",
|
"plugin-rtp-nvim": "plugin-rtp-nvim",
|
||||||
"plugin-run-nvim": "plugin-run-nvim",
|
"plugin-run-nvim": "plugin-run-nvim",
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -488,6 +488,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-render-markdown-nvim = {
|
||||||
|
url = "github:MeanderingProgrammer/render-markdown.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Minimap
|
# Minimap
|
||||||
plugin-minimap-vim = {
|
plugin-minimap-vim = {
|
||||||
url = "github:wfxr/minimap.vim";
|
url = "github:wfxr/minimap.vim";
|
||||||
|
@ -721,6 +726,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-R-nvim = {
|
||||||
|
url = "github:R-nvim/R.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
plugin-haskell-tools-nvim = {
|
plugin-haskell-tools-nvim = {
|
||||||
url = "github:mrcjkb/haskell-tools.nvim";
|
url = "github:mrcjkb/haskell-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames concatLists;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList concatLists;
|
||||||
inherit (lib.types) bool enum either package listOf str;
|
inherit (lib.types) bool enum either package listOf str;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.markdown;
|
cfg = config.vim.languages.markdown;
|
||||||
defaultServer = "marksman";
|
defaultServer = "marksman";
|
||||||
|
@ -98,6 +99,29 @@ in {
|
||||||
description = "Extra filetypes to format with the Markdown formatter";
|
description = "Extra filetypes to format with the Markdown formatter";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensions = {
|
||||||
|
render-markdown-nvim = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption ""
|
||||||
|
// {
|
||||||
|
description = ''
|
||||||
|
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
|
||||||
|
|
||||||
|
Inline Markdown rendering with [render-markdown.nvim]
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "render-markdown" {
|
||||||
|
auto_override_publish_diagnostics = mkOption {
|
||||||
|
description = "Automatically override the publish_diagnostics handler";
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
@ -115,5 +139,13 @@ in {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.lsp.null-ls.enable = true;
|
||||||
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
vim.lsp.null-ls.sources.markdown-format = formats.${cfg.format.type}.nullConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Extensions
|
||||||
|
(mkIf cfg.extensions.render-markdown-nvim.enable {
|
||||||
|
vim.startPlugins = ["render-markdown-nvim"];
|
||||||
|
vim.pluginRC.render-markdown-nvim = entryAnywhere ''
|
||||||
|
require("render-markdown").setup(${toLuaObject cfg.extensions.render-markdown-nvim.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,13 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str nullOr attrsOf;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.r;
|
cfg = config.vim.languages.r;
|
||||||
|
|
||||||
|
@ -74,7 +76,12 @@ in {
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
package = mkGrammarOption pkgs "r";
|
rPackage = mkGrammarOption pkgs "r";
|
||||||
|
rnowebPackage = mkGrammarOption pkgs "rnoweb";
|
||||||
|
mdPackage = mkGrammarOption pkgs "markdown";
|
||||||
|
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
||||||
|
yamlPackage = mkGrammarOption pkgs "yaml";
|
||||||
|
csvPackage = mkGrammarOption pkgs "csv";
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
@ -109,14 +116,28 @@ in {
|
||||||
description = "R formatter package";
|
description = "R formatter package";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensions = {
|
||||||
|
R-nvim = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption ''
|
||||||
|
[R.nvim]: https://github.com/R-Nvim/R.nvim
|
||||||
|
|
||||||
|
R.nvim adds R support to Neovim, including:
|
||||||
|
|
||||||
|
- Communication with R via Neovim's built-in terminal or tmux
|
||||||
|
- A built-in object explorer and autocompletions built from your R environment
|
||||||
|
- Keyboard shortcuts for common inserts like <- and |>
|
||||||
|
- Quarto/R Markdown support
|
||||||
|
''
|
||||||
|
// {default = true;};
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "R-nvim" {};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.lsp.null-ls.enable = true;
|
||||||
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
|
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
@ -126,5 +147,24 @@ in {
|
||||||
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;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [
|
||||||
|
cfg.treesitter.rPackage
|
||||||
|
cfg.treesitter.rnowebPackage
|
||||||
|
cfg.treesitter.mdPackage
|
||||||
|
cfg.treesitter.mdInlinePackage
|
||||||
|
cfg.treesitter.yamlPackage
|
||||||
|
cfg.treesitter.csvPackage
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extensions.R-nvim.enable {
|
||||||
|
vim.startPlugins = ["R-nvim"];
|
||||||
|
vim.pluginRC.R-nvim= entryAnywhere ''
|
||||||
|
require("r").setup(${toLuaObject cfg.extensions.R-nvim.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue