mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-14 03:45:59 +01:00
Compare commits
7 commits
b4d80b4b8c
...
6b2e523d57
Author | SHA1 | Date | |
---|---|---|---|
6b2e523d57 | |||
|
e949a51c55 | ||
|
473ebea4cf | ||
|
fc2e5998e7 | ||
3935189b79 | |||
97dabab4d9 | |||
346e6f535e |
14 changed files with 107 additions and 67 deletions
|
@ -17,11 +17,16 @@ isMaximal: {
|
|||
lspkind.enable = false;
|
||||
lightbulb.enable = true;
|
||||
lspsaga.enable = false;
|
||||
nvimCodeActionMenu.enable = isMaximal;
|
||||
trouble.enable = true;
|
||||
lspSignature.enable = true;
|
||||
lsplines.enable = isMaximal;
|
||||
nvim-docs-view.enable = isMaximal;
|
||||
|
||||
# Code Actions
|
||||
code-actions = {
|
||||
enable = true;
|
||||
fastaction-nvim.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
debugger = {
|
||||
|
|
23
flake.lock
23
flake.lock
|
@ -69,11 +69,11 @@
|
|||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1724368098,
|
||||
"narHash": "sha256-qimVBdes+2gNRRcyFoIUA1RyOKV0Ee40hUaVVf7ZsNs=",
|
||||
"lastModified": 1724456641,
|
||||
"narHash": "sha256-SMgnviF6ofBPbyV3+rljPGcX0Hn9HBOhgXE10Cyjaic=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "e06b48c51291cc1df08adcd34a8796f86d5b235e",
|
||||
"rev": "c261925dbbf02f523af0e8add844df64fddf0359",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -571,6 +571,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-fastaction-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1721396662,
|
||||
"narHash": "sha256-L7na78FsE+QHlEwxMpiwQcoOPhtmrknvdTZfzUoDANI=",
|
||||
"owner": "Chaitanyabsprip",
|
||||
"repo": "fastaction.nvim",
|
||||
"rev": "2384dea7ba81d2709d0bee0e4bc7a8831ff13a9d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Chaitanyabsprip",
|
||||
"repo": "fastaction.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-fidget-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -1855,6 +1871,7 @@
|
|||
"plugin-dracula": "plugin-dracula",
|
||||
"plugin-dressing-nvim": "plugin-dressing-nvim",
|
||||
"plugin-elixir-tools": "plugin-elixir-tools",
|
||||
"plugin-fastaction-nvim": "plugin-fastaction-nvim",
|
||||
"plugin-fidget-nvim": "plugin-fidget-nvim",
|
||||
"plugin-flutter-tools": "plugin-flutter-tools",
|
||||
"plugin-gesture-nvim": "plugin-gesture-nvim",
|
||||
|
|
|
@ -138,6 +138,11 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
plugin-fastaction-nvim = {
|
||||
url = "github:Chaitanyabsprip/fastaction.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-lsp-signature = {
|
||||
url = "github:ray-x/lsp_signature.nvim";
|
||||
flake = false;
|
||||
|
|
|
@ -7,5 +7,12 @@ in {
|
|||
Tidalcycles language support has been removed as of 2024-06-06 as it was long unmaintained. If
|
||||
you depended on this functionality, please open an issue.
|
||||
'')
|
||||
|
||||
# 2024-07-20
|
||||
(mkRemovedOptionModule ["vim" "lsp" "nvimCodeActionMenu"] ''
|
||||
nvimCodeActionMenu has been deprecated and archived upstream. As of 0.7, code-actions will be
|
||||
available under `vim.lsp.code-actions.enable` and `vim.lsp.code.actions.<plugin>.enable`.
|
||||
Please take a look at the nvf manual for more details.
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
dapConfig = ''
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = '${cfg.dap.package}/bin/lldb-vscode',
|
||||
command = '${cfg.dap.package}/bin/lldb-dap',
|
||||
name = 'lldb'
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
|
|
|
@ -173,7 +173,7 @@ in {
|
|||
dap = {
|
||||
adapter = {
|
||||
type = "executable",
|
||||
command = "${cfg.dap.package}/bin/lldb-vscode",
|
||||
command = "${cfg.dap.package}/bin/lldb-dap",
|
||||
name = "rustacean_lldb",
|
||||
},
|
||||
},
|
||||
|
|
10
modules/plugins/lsp/code-actions/default.nix
Normal file
10
modules/plugins/lsp/code-actions/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
imports = [
|
||||
./fastaction-nvim
|
||||
];
|
||||
options.vim.lsp.code-actions = {
|
||||
enable = mkEnableOption "code-actions. Setting this to `false` will disable all code action plugins.";
|
||||
};
|
||||
}
|
36
modules/plugins/lsp/code-actions/fastaction-nvim/config.nix
Normal file
36
modules/plugins/lsp/code-actions/fastaction-nvim/config.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding pushDownDefault;
|
||||
|
||||
cfg = config.vim.lsp.code-actions;
|
||||
self = import ./fastaction-nvim.nix {inherit lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.code-actions.fastaction-nvim.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.fastaction-nvim.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.fastaction-nvim.enable) {
|
||||
vim = {
|
||||
startPlugins = ["fastaction-nvim"];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>c" = "Code Actions";
|
||||
};
|
||||
|
||||
maps = {
|
||||
normal = mkSetLuaBinding mappings.code_action "require('fastaction').code_action";
|
||||
visual = mkSetLuaBinding mappings.range_action "require('fastaction').range_code_action";
|
||||
};
|
||||
|
||||
pluginRC.fastaction-nvim = entryAnywhere ''
|
||||
-- Enable trouble diagnostics viewer
|
||||
require('fastaction').setup(${toLuaObject cfg.fastaction-nvim.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./nvim-code-action-menu.nix
|
||||
./config.nix
|
||||
./fastaction-nvim.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp.code-actions.fastaction-nvim = {
|
||||
enable = mkEnableOption "code actions for Neovim via fastaction.nvim";
|
||||
setupOpts = mkPluginSetupOption "fastaction-nvim" {};
|
||||
|
||||
mappings = {
|
||||
code_action = mkMappingOption "Displays code action popup [Fastaction.nvim]" "<leader>cfa";
|
||||
range_action = mkMappingOption " Displays code actions for visual range [Fastaction.nvim]" "<leader>cra";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -10,12 +10,14 @@
|
|||
|
||||
# lsp plugins
|
||||
./lspsaga
|
||||
./nvim-code-action-menu
|
||||
./trouble
|
||||
./lsp-signature
|
||||
./lightbulb
|
||||
./lspkind
|
||||
./lsplines
|
||||
./nvim-docs-view
|
||||
|
||||
# Code Actions
|
||||
./code-actions
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings pushDownDefault;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
|
||||
self = import ./nvim-code-action-menu.nix {inherit lib;};
|
||||
mappingDefinitions = self.options.vim.lsp.nvimCodeActionMenu.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.nvimCodeActionMenu.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.nvimCodeActionMenu.enable) {
|
||||
vim = {
|
||||
startPlugins = ["nvim-code-action-menu"];
|
||||
|
||||
maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>c" = "+CodeAction";
|
||||
};
|
||||
|
||||
pluginRC.code-action-menu = entryAnywhere ''
|
||||
-- border configuration
|
||||
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'
|
||||
|
||||
-- show individual sections of the code action menu
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.details "vim.g.code_action_menu_show_details = true"}
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.diff "vim.g.code_action_menu_show_diff = true"}
|
||||
${lib.optionalString cfg.nvimCodeActionMenu.show.actionKind "vim.g.code_action_menu_show_action_kind = true"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
nvimCodeActionMenu = {
|
||||
enable = mkEnableOption "nvim code action menu";
|
||||
|
||||
show = {
|
||||
details = mkEnableOption "Show details" // {default = true;};
|
||||
diff = mkEnableOption "Show diff" // {default = true;};
|
||||
actionKind = mkEnableOption "Show action kind" // {default = true;};
|
||||
};
|
||||
|
||||
mappings = {
|
||||
open = mkMappingOption "Open code action menu [nvim-code-action-menu]" "<leader>ca";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
inherit (lib.trivial) boolToString warnIf;
|
||||
in {
|
||||
onedark = {
|
||||
setup = {style ? "dark"}: ''
|
||||
setup = {style ? "dark", ...}: ''
|
||||
-- OneDark theme
|
||||
require('onedark').setup {
|
||||
style = "${style}"
|
||||
|
@ -30,7 +30,7 @@ in {
|
|||
};
|
||||
|
||||
dracula = {
|
||||
setup = {transparent}: ''
|
||||
setup = {transparent, ...}: ''
|
||||
require('dracula').setup({
|
||||
transparent_bg = ${boolToString transparent},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue