Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 27, 2025
1 parent 589ab2a commit ed2eb92
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 58 deletions.
109 changes: 67 additions & 42 deletions modules/nixvim/plugins/dap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,53 @@ in
};

plugins = {
dap-ui = {
enable = true;

lazyLoad.settings = {
before.__raw = ''
function()
require('lz.n').trigger_load('nvim-dap')
end
'';
keys = [
{
__unkeyed-1 = "<leader>du";
__unkeyed-3.__raw = ''
function()
require('dap.ext.vscode').load_launchjs(nil, {})
require("dapui").toggle()
end
'';
desc = "Toggle Debugger UI";
}
];
};
};
dap-virtual-text = {
enable = true;

lazyLoad.settings = {
before.__raw = ''
function()
require('lz.n').trigger_load('nvim-dap')
end
'';
cmd = [
"DapVirtualTextToggle"
"DapVirtualTextEnable"
];
};
};
dap = {
enable = true;
# TODO: # TODO: upgrade to mkNeovimPlugin
# lazyLoad.enable = true;

lazyLoad.settings = {
cmd = [
"DapContinue"
"DapNew"
];
};

adapters = {
executables = {
Expand Down Expand Up @@ -252,15 +295,15 @@ in
];
};

extensions = {
dap-ui = {
enable = true;
};
# extensions = {
# dap-ui = {
# enable = true;
# };

dap-virtual-text = {
enable = true;
};
};
# dap-virtual-text = {
# enable = true;
# };
# };

signs = {
dapBreakpoint = {
Expand Down Expand Up @@ -301,11 +344,7 @@ in
{
mode = "n";
key = "<leader>db";
action.__raw = ''
function()
require("dap").toggle_breakpoint()
end
'';
action = "<CMD>DapToggleBreakpoint<CR>";
options = {
desc = "Breakpoint toggle";
silent = true;
Expand All @@ -314,11 +353,7 @@ in
{
mode = "n";
key = "<leader>dc";
action.__raw = ''
function()
require("dap").continue()
end
'';
action = "<CMD>DapContinue<CR>";
options = {
desc = "Continue Debugging (Start)";
silent = true;
Expand All @@ -338,11 +373,7 @@ in
{
mode = "n";
key = "<leader>do";
action.__raw = ''
function()
require("dap").step_out()
end
'';
action = "<CMD>DapStepOut<CR>";
options = {
desc = "Step Out";
silent = true;
Expand All @@ -351,11 +382,7 @@ in
{
mode = "n";
key = "<leader>ds";
action.__raw = ''
function()
require("dap").step_over()
end
'';
action = "<CMD>DapStepOver<CR>";
options = {
desc = "Step Over";
silent = true;
Expand All @@ -364,11 +391,7 @@ in
{
mode = "n";
key = "<leader>dS";
action.__raw = ''
function()
require("dap").step_into()
end
'';
action = "<CMD>DapStepInto<CR>";
options = {
desc = "Step Into";
silent = true;
Expand All @@ -377,16 +400,14 @@ in
{
mode = "n";
key = "<leader>dt";
action.__raw = ''
function() require("dap").terminate() end
'';
action = "<CMD>DapTerminate<CR>";
options = {
desc = "Terminate Debugging";
silent = true;
};
}
]
++ lib.optionals config.plugins.dap.extensions.dap-ui.enable [
++ lib.optionals config.plugins.dap-ui.enable [
{
mode = "v";
key = "<leader>de";
Expand All @@ -413,7 +434,7 @@ in
silent = true;
};
}
{
(lib.mkIf (!config.plugins.lz-n.enable) {
mode = "n";
key = "<leader>du";
action.__raw = ''
Expand All @@ -426,11 +447,15 @@ in
desc = "Toggle Debugger UI";
silent = true;
};
}
})
]
++
lib.optionals
((builtins.elem nvim-dap-view config.extraPlugins) && !config.plugins.dap.extensions.dap-ui.enable)
(
(builtins.elem nvim-dap-view config.extraPlugins)
&& !config.plugins.dap.extensions.dap-ui.enable
&& !config.plugins.lz-n.enable
)
[
{
mode = "n";
Expand Down
4 changes: 4 additions & 0 deletions modules/nixvim/plugins/refactoring/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

lazyLoad = {
settings = {
before.__raw = lib.mkIf config.plugins.telescope.enable ''
require('lz.n').trigger_load('telescope.nvim')
'';

cmd = "Refactor";
};
};
Expand Down
41 changes: 30 additions & 11 deletions modules/nixvim/plugins/todo-comments/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,29 @@
enable = true;

lazyLoad.settings = {
before.__raw = ''
function()
# TODO: see if we can split this up somehow
before.__raw =
''
function()
''
+ lib.optionalString config.plugins.fzf-lua.enable ''
require('lz.n').trigger_load('fzf-lua')
end
'';
''
+ lib.optionalString config.plugins.trouble.enable ''
require('lz.n').trigger_load('trouble.nvim')
''
+ lib.optionalString config.plugins.telescope.enable ''
require('lz.n').trigger_load('telescope.nvim')
''
+
lib.optionalString
(config.plugins.snacks.enable && lib.hasAttr "picker" config.plugins.snacks.settings)
''
require('lz.n').trigger_load('snacks.nvim')
''
+ ''
end
'';
keys =
lib.mkIf (config.plugins.snacks.enable && lib.hasAttr "picker" config.plugins.snacks.settings)
[
Expand All @@ -18,13 +36,14 @@
desc = "Find TODOs";
}
];
cmd = [
"TodoFzfLua"
"TodoLocList"
"TodoQuickFix"
"TodoTelescope"
"TodoTrouble"
];
cmd =
[
"TodoLocList"
"TodoQuickFix"
]
++ lib.optional config.plugins.fzf-lua.enable "TodoFzfLua"
++ lib.optional config.plugins.telescope.enable "TodoTelescope"
++ lib.optional config.plugins.trouble.enable "TodoTrouble";
};

keymaps = {
Expand Down
6 changes: 1 addition & 5 deletions modules/nixvim/plugins/trouble/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
trouble = {
enable = true;

lazyLoad.settings.cmd =
[ "Trouble" ]
++ lib.optionals config.plugins.todo-comments.enable [
"TodoTrouble"
];
lazyLoad.settings.cmd = [ "Trouble" ];

settings = {
auto_close = true;
Expand Down

0 comments on commit ed2eb92

Please sign in to comment.