mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
treewide: Use nixpkgs fetchers for npins
plugins: switch from neodev to lazydev
This commit is contained in:
parent
7510ef2c13
commit
8adc4c352a
32 changed files with 700 additions and 681 deletions
|
@ -8,7 +8,6 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.types) either listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
@ -16,6 +15,12 @@
|
|||
|
||||
cfg = config.vim.languages.lua;
|
||||
in {
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
|
||||
neodev has been replaced by lazydev
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.languages.lua = {
|
||||
enable = mkEnableOption "Lua language support";
|
||||
treesitter = {
|
||||
|
@ -32,7 +37,7 @@ in {
|
|||
default = pkgs.lua-language-server;
|
||||
};
|
||||
|
||||
neodev.enable = mkEnableOption "neodev.nvim integration, useful for neovim plugin developers";
|
||||
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -49,7 +54,6 @@ in {
|
|||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
|
@ -59,10 +63,15 @@ in {
|
|||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.neodev.enable {
|
||||
vim.startPlugins = ["neodev-nvim"];
|
||||
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
|
||||
require("neodev").setup({})
|
||||
(mkIf cfg.lsp.lazydev.enable {
|
||||
vim.startPlugins = ["lazydev-nvim"];
|
||||
vim.pluginRC.lazydev = entryBefore ["lua-lsp"] ''
|
||||
require("lazydev").setup({
|
||||
enabled = function(root_dir)
|
||||
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
|
||||
end,
|
||||
library = { { path = "''${3rd}/luv/library", words = { "vim%.uv" } } },
|
||||
})
|
||||
'';
|
||||
})
|
||||
]))
|
||||
|
|
|
@ -22,7 +22,7 @@ in {
|
|||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"lsp-signature"
|
||||
"lsp-signature-nvim"
|
||||
];
|
||||
|
||||
lsp.lspSignature.setupOpts = {
|
||||
|
|
|
@ -14,7 +14,7 @@ in {
|
|||
{
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"none-ls"
|
||||
"none-ls-nvim"
|
||||
"plenary-nvim"
|
||||
];
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"todo-comments"
|
||||
"todo-comments-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
|
|
|
@ -34,7 +34,7 @@ in {
|
|||
})
|
||||
(mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["lualine"];
|
||||
startPlugins = ["lualine-nvim"];
|
||||
pluginRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["smartcolumn"];
|
||||
startPlugins = ["smartcolumn-nvim"];
|
||||
|
||||
pluginRC.smartcolumn = entryAnywhere ''
|
||||
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["which-key"];
|
||||
startPlugins = ["which-key-nvim"];
|
||||
|
||||
pluginRC.whichkey = entryAnywhere ''
|
||||
local wk = require("which-key")
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["highlight-undo"];
|
||||
startPlugins = ["highlight-undo-nvim"];
|
||||
|
||||
pluginRC.highlight-undo = entryAnywhere ''
|
||||
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["indent-blankline"];
|
||||
startPlugins = ["indent-blankline-nvim"];
|
||||
|
||||
pluginRC.indent-blankline = entryAnywhere ''
|
||||
require("ibl").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue