Working config (until now)

This commit is contained in:
2025-05-05 21:53:36 +02:00
parent 516d786c1b
commit fa8f769068
16 changed files with 297 additions and 69 deletions

View File

@@ -11,6 +11,7 @@
{ name = "nvim_lsp_signature_help"; }
{ name = "path"; }
{ name = "buffer"; }
{ name = "dap"; }
];
mapping = {
"<Tab>" = "cmp.mapping.select_next_item()";

View File

@@ -46,6 +46,15 @@
};
mode = "n";
}
{
action = ":lua vim.lsp.buf.format()<CR>";
key = "<C-f>";
options = {
silent = true;
desc = "Format buffer";
};
mode = "n";
}
{
action = ":q<CR>";
key = "<C-q>";
@@ -129,5 +138,32 @@
};
mode = "n";
}
# Dap
{
action.__raw = ''
function()
require("dap").toggle_breakpoint()
end
'';
key = "<Space>b";
mode = "n";
options = {
silent = true;
desc = "Toggle breakpoint";
};
}
{
action.__raw = ''
function()
require("dapui").toggle()
end
'';
key = "<Space>y";
mode = "n";
options = {
silent = true;
desc = "Toggle debugger";
};
}
];
}

View File

@@ -10,15 +10,18 @@
lua_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
installRustfmt = true;
installCargo = false;
installRustc = false;
installRustfmt = false;
};
zls.enable = true;
nim_langserver.enable = true;
pyright.enable = true;
emmet_language_server.enable = true;
ts_ls.enable = true;
docker_compose_language_service.enable = true;
jsonls.enable = true;
phpactor.enable = true;
};
keymaps = {
lspBuf = {

66
home/nvim/plugins/dap.nix Normal file
View File

@@ -0,0 +1,66 @@
{ pkgs, ... }:
{
programs.nixvim.plugins = {
dap = {
enable = true;
adapters = {
executables = {
gdb = {
command = "gdb";
args = [
"-i"
"dap"
];
};
lldb = {
command = "lldb";
};
};
servers = {
codelldb = {
port = 13000;
executable = {
command = "${pkgs.vscode-extensions.vadimcn.vscode-lldb}/share/vscode/extensions/vadimcn.vscode-lldb/adapter/codelldb";
args = [
"--port"
"13000"
];
};
};
};
};
configurations = {
cpp = [
{
name = "Launch GDB";
type = "gdb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end'';
}
{
name = "Launch LLDB";
type = "lldb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end'';
}
{
name = "Launch CodeLLDB";
type = "codelldb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end'';
}
];
};
};
dap-ui.enable = true;
};
}

View File

@@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
{
imports = [
./telescope.nix
@@ -7,6 +7,7 @@
./lualine.nix
./dashboard.nix
./neotree.nix
./dap.nix
];
programs.nixvim.plugins = {