summaryrefslogtreecommitdiff
path: root/common/home/programs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-04-06 09:33:22 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-04-06 09:33:22 +0200
commit225c795749a68088c1e33d58ac66209a06ee62a7 (patch)
tree8b6eed0555a32dd0c16a9afc7b997a556b1ed0b9 /common/home/programs
parent20871c5109aa5590384d5e60ebeab3d0d22fdafd (diff)
2026-04-06 updates by auto-switch
Diffstat (limited to 'common/home/programs')
-rw-r--r--common/home/programs/nixvim/default.nix61
-rw-r--r--common/home/programs/nixvim/plugins/dap.nix31
-rw-r--r--common/home/programs/nixvim/plugins/default.nix5
3 files changed, 83 insertions, 14 deletions
diff --git a/common/home/programs/nixvim/default.nix b/common/home/programs/nixvim/default.nix
index e89c1d5..92308be 100644
--- a/common/home/programs/nixvim/default.nix
+++ b/common/home/programs/nixvim/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ pkgs, lib, ... }:
{
enable = true;
defaultEditor = true;
@@ -38,6 +38,8 @@
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
vim.api.nvim_set_hl(0, "NeoTreeNormal", { bg = "none" })
vim.api.nvim_set_hl(0, "NeoTreeNormalNC", { bg = "none" })
+
+ require('dap').set_log_level('TRACE')
'';
diagnostic.settings = {
@@ -83,7 +85,7 @@
colorscheme = "gruvbox-dark-pale";
};
- plugins = import ./plugins/default.nix { inherit pkgs; };
+ plugins = import ./plugins/default.nix { inherit pkgs; inherit lib; };
globals = {
mapleader = ",";
@@ -136,6 +138,61 @@
action = "<cmd>lua vim.diagnostic.open_float()<cr>";
mode = "n";
}
+ {
+ key = "<leader>ds";
+ action = "<cmd>DapNew<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>db";
+ action = "<cmd>DapToggleBreakpoint<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>dc";
+ action = "<cmd>DapContinue<cr>";
+ mode = "n";
+ }
+ {
+ key = "<C-n>";
+ action = "<cmd>DapStepOver<cr>";
+ mode = "n";
+ }
+ {
+ key = "<C-i>";
+ action = "<cmd>DapStepInto<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>do";
+ action = "<cmd>DapStepOut<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>dr";
+ action = "<cmd>DapRestartFrame<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>dt";
+ action = "<cmd>DapTerminate<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>de";
+ action = "<cmd>lua require('dapui').eval(vim.fn.input('Eval: '))<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>dv";
+ action = "<cmd>lua require('dapui').toggle()<cr>";
+ mode = "n";
+ }
+ {
+ key = "<leader>cr";
+ action = "<cmd>source $MYVIMRC<cr>";
+ mode = "n";
+ }
{ key = "<C-u>a"; action = "ä"; mode = "i"; }
{ key = "<C-u>o"; action = "ö"; mode = "i"; }
{ key = "<C-u>u"; action = "ü"; mode = "i"; }
diff --git a/common/home/programs/nixvim/plugins/dap.nix b/common/home/programs/nixvim/plugins/dap.nix
index 88a3ae0..7707bc8 100644
--- a/common/home/programs/nixvim/plugins/dap.nix
+++ b/common/home/programs/nixvim/plugins/dap.nix
@@ -1,18 +1,29 @@
-{ ... }:
+{ lib, ... }:
{
enable = true;
adapters = {
- qemu = {
- type = "server";
- host = "localhost";
- port = 1234,
+ executables.qemu = {
+ command = "gdb";
+ args = [
+ "-i" "dap"
+ ];
};
};
configurations = {
- zig = {
- name = "Zig Qemu";
- type = "qemu";
- request: "attach";
- };
+ zig = [
+ {
+ name = "Qemu";
+ type = "qemu";
+ request = "attach";
+ program = lib.nixvim.mkRaw ''
+ function()
+ return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/zig-out/bin/", "file")
+ end
+ '';
+ target = "tcp:localhost:1234";
+ stopOnEntry = true;
+ gdbTarget = "tcp:localhost:1234";
+ }
+ ];
};
}
diff --git a/common/home/programs/nixvim/plugins/default.nix b/common/home/programs/nixvim/plugins/default.nix
index b199a36..dca17b3 100644
--- a/common/home/programs/nixvim/plugins/default.nix
+++ b/common/home/programs/nixvim/plugins/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ pkgs, lib, ... }:
let
plugins = [
"web-devicons"
@@ -9,6 +9,7 @@ plugins = [
"typst-preview"
"gitgutter"
"dap"
+ "dap-ui"
];
in
builtins.listToAttrs (
@@ -16,7 +17,7 @@ builtins.listToAttrs (
name = n;
value =
if builtins.pathExists ./${n}.nix then
- (import ./${n}.nix { inherit pkgs; })
+ (import ./${n}.nix { inherit pkgs; inherit lib; })
else
{ enable = true; };
}) plugins