nixbook: go dap, tidying
This commit is contained in:
parent
70e6d7ced5
commit
56dc76e1cf
2 changed files with 57 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.lib.cosmic) Actions;
|
inherit (config.lib.cosmic) Actions;
|
||||||
|
|
@ -43,7 +44,7 @@ in {
|
||||||
background = {
|
background = {
|
||||||
displays = {
|
displays = {
|
||||||
all = {
|
all = {
|
||||||
source = ../../../images/nier2.jpg;
|
source = lib.mkDefault config.stylix.image;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: let
|
||||||
|
lua = cmd: {__raw = cmd;};
|
||||||
|
luaFunc = cmd: lua ''
|
||||||
|
function ()
|
||||||
|
${cmd}
|
||||||
|
end'';
|
||||||
|
in {
|
||||||
globals = {
|
globals = {
|
||||||
mapleader = " ";
|
mapleader = " ";
|
||||||
};
|
};
|
||||||
|
|
@ -12,7 +18,7 @@
|
||||||
scrolloff = 4;
|
scrolloff = 4;
|
||||||
|
|
||||||
undofile = true;
|
undofile = true;
|
||||||
undodir.__raw = ''vim.fn.expand("$HOME/.local/share/nvim/undo")'';
|
undodir = lua ''vim.fn.expand("$HOME/.local/share/nvim/undo")'';
|
||||||
|
|
||||||
list = true;
|
list = true;
|
||||||
listchars = builtins.concatStringsSep "," [
|
listchars = builtins.concatStringsSep "," [
|
||||||
|
|
@ -161,14 +167,48 @@
|
||||||
action = "";
|
action = "";
|
||||||
options.desc = "Harpoon";
|
options.desc = "Harpoon";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "<F5>";
|
||||||
|
action = luaFunc "require('dap').continue()";
|
||||||
|
options.desc = "DAP continue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>dc";
|
||||||
|
action = luaFunc "require('dap').continue()";
|
||||||
|
options.desc = "DAP continue";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>db";
|
||||||
|
action = luaFunc "require('dap').toggle_breakpoint()";
|
||||||
|
options.desc = "DAP toggle breakpoint";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>dn";
|
||||||
|
action = luaFunc "require('dap').step_over()";
|
||||||
|
options.desc = "DAP step over";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>di";
|
||||||
|
action = luaFunc "require('dap').step_into()";
|
||||||
|
options.desc = "DAP step into";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>do";
|
||||||
|
action = luaFunc "require('dap').step_out()";
|
||||||
|
options.desc = "DAP step out";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>du";
|
||||||
|
action = luaFunc "require('dapui').toggle()";
|
||||||
|
options.desc = "DAP UI Toggle";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
autoCmd = [{
|
autoCmd = [{
|
||||||
event = "BufWritePre";
|
event = "BufWritePre";
|
||||||
pattern = "*.go";
|
pattern = "*.go";
|
||||||
# https://github.com/golang/tools/blob/master/gopls/doc/vim.md#imports-and-formatting
|
# https://github.com/golang/tools/blob/master/gopls/doc/vim.md#imports-and-formatting
|
||||||
callback.__raw = ''
|
callback = luaFunc ''
|
||||||
function()
|
|
||||||
local params = vim.lsp.util.make_range_params()
|
local params = vim.lsp.util.make_range_params()
|
||||||
params.context = {only = {"source.organizeImports"}}
|
params.context = {only = {"source.organizeImports"}}
|
||||||
-- buf_request_sync defaults to a 1000ms timeout. Depending on your
|
-- buf_request_sync defaults to a 1000ms timeout. Depending on your
|
||||||
|
|
@ -186,7 +226,6 @@
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.lsp.buf.format({async = false})
|
vim.lsp.buf.format({async = false})
|
||||||
end
|
|
||||||
'';
|
'';
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
@ -236,6 +275,17 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dap = {
|
||||||
|
enable = true;
|
||||||
|
extensions.dap-go = {
|
||||||
|
enable = true;
|
||||||
|
# tests.verbose = true; # ???
|
||||||
|
};
|
||||||
|
extensions.dap-ui = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
cmp = {
|
cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue