bunch more neovim stuff

This commit is contained in:
cswimr 2025-02-08 12:53:14 -06:00
parent 2bb4d85963
commit 243c3e6b69
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
16 changed files with 415 additions and 80 deletions

View file

@ -7,11 +7,12 @@
./plugins/cmp.nix
./plugins/codesnap.nix
./plugins/conform.nix
./plugins/dap.nix
./plugins/dap
./plugins/dashboard.nix
./plugins/devcontainer.nix
./plugins/floatterm.nix
./plugins/hover.nix
./plugins/indent-blankline.nix
./plugins/lazygit.nix
./plugins/lsp.nix
./plugins/lualine.nix

View file

@ -5,9 +5,22 @@
enable = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "buffer"; }
{ name = "path"; }
{
name = "copilot";
group_index = 1;
}
{
name = "nvim_lsp";
group_index = 2;
}
{
name = "buffer";
group_index = 2;
}
{
name = "path";
group_index = 2;
}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";

View file

@ -21,7 +21,7 @@
prettier = {
__unkeyed-1 = "prettierd";
__unkeyed_2 = "prettier";
timeout_ms = "2000";
timeout_ms = "5000";
stop_after_first = "true";
};
in
@ -178,7 +178,7 @@
{
mode = "n";
key = "<leader>f";
action = ":Format<cr>";
action = "<CMD>Format<CR>";
options = {
desc = "Format";
silent = true;

View file

@ -1,13 +0,0 @@
{ pkgs, lib, ... }:
{
programs.nixvim = {
plugins = {
dap = {
enable = true;
};
dap-python = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,170 @@
{
imports = [
./dotnet.nix
];
programs.nixvim = {
plugins = {
dap.enable = true;
dap-python.enable = true;
dap-ui = {
enable = true;
settings = {
controls = {
enable = true;
element = "repl";
};
layouts = [
{
elements = [
{
id = "breakpoints";
size = 0.25;
}
{
id = "repl";
size = 0.75;
}
];
position = "bottom";
size = 10;
}
];
};
};
};
keymaps = [
{
mode = "n";
key = "<F6>";
action = "<CMD>lua require('dapui').toggle()<CR>";
options = {
desc = "Toggle Debugging UI";
silent = true;
};
}
{
mode = "n";
key = "<F5>";
action = "<CMD>DapContinue<CR>";
options = {
desc = "Continue Debugging";
silent = false;
};
}
{
mode = "n";
key = "<F10>";
action = "<CMD>DapStepOver<CR>";
options = {
desc = "Step Over (Debugger)";
silent = true;
};
}
{
mode = "n";
key = "<F11>";
action = "<CMD>DapStepInto<CR>";
options = {
desc = "Step Into (Debugger)";
silent = true;
};
}
{
mode = "n";
key = "<F12>";
action = "<CMD>DapStepOut<CR>";
options = {
desc = "Step Out (Debugger)";
silent = true;
};
}
{
mode = "n";
key = "<leader>b";
action = "<CMD>DapToggleBreakpoint<CR>";
options = {
desc = "Toggle Breakpoint (Debugger)";
silent = true;
};
}
{
mode = "n";
key = "<leader>B";
action = "<CMD>DapSetBreakpoint<CR>";
options = {
desc = "Set Breakpoint (Debugger)";
silent = false;
};
}
{
mode = "n";
key = "<leader>lp";
action = "<CMD>lua require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>";
options = {
desc = "Set Log Point (Debugger)";
silent = false;
};
}
{
mode = "n";
key = "<leader>dr";
action = "<CMD>DapToggleRepl<CR>";
options = {
desc = "Toggle REPL";
silent = true;
};
}
{
mode = "n";
key = "<leader>dl";
action = "<CMD>lua require('dap').run_last()<CR>";
options = {
desc = "Run Last (Debugger)";
silent = false;
};
}
{
mode = [
"n"
"v"
];
key = "<leader>dh";
action = "<CMD>lua require('dap.ui.widgets').hover()<CR>";
options = {
desc = "TODO";
silent = true;
};
}
{
mode = [
"n"
"v"
];
key = "<leader>dh";
action = "<CMD>lua require('dap.ui.widgets').preview()<CR>";
options = {
desc = "TODO";
silent = true;
};
}
{
mode = "n";
key = "<leader>df";
action = "<CMD>lua require('dap.ui.widgets').centered_float(widgets.frames)<CR>";
options = {
desc = "TODO";
silent = true;
};
}
{
mode = "n";
key = "<leader>ds";
action = "<CMD>lua require('dap.ui.widgets').centered_float(widgets.scopes)<CR>";
options = {
desc = "TODO";
silent = true;
};
}
];
};
}

View file

@ -0,0 +1,75 @@
{ pkgs, lib, ... }:
{
programs.nixvim = {
extraPackages = with pkgs; [
netcoredbg
];
plugins.dap = {
adapters = {
executables = {
coreclr = {
command = "${lib.getExe pkgs.netcoredbg}";
args = [ "--interpreter=vscode" ];
};
};
};
configurations =
let
dotnet_config = {
type = "coreclr";
name = "launch - netcoredbg";
request = "launch";
program.__raw = # lua
''
function()
if vim.fn.confirm("Should I recompile first?", "&yes\n&no", 2) == 1 then
vim.g.dotnet_build_project()
end
return vim.g.dotnet_get_dll_path()
end
'';
};
in
{
cs = [ dotnet_config ];
fsharp = [ dotnet_config ];
};
luaConfig.pre = # lua
''
vim.g.dotnet_build_project = function()
local default_path = vim.fn.getcwd() .. '/'
if vim.g['dotnet_last_proj_path'] ~= nil then
default_path = vim.g['dotnet_last_proj_path']
end
local path = vim.fn.input('Path to your *proj file', default_path, 'file')
vim.g['dotnet_last_proj_path'] = path
local cmd = 'dotnet build -c Debug ' .. path .. ' > /dev/null'
print("")
print('Cmd to execute: ' .. cmd)
local f = os.execute(cmd)
if f == 0 then
print('\nBuild: ')
else
print('\nBuild: (code: ' .. f .. ')')
end
end
vim.g.dotnet_get_dll_path = function()
local request = function()
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
end
if vim.g['dotnet_last_dll_path'] == nil then
vim.g['dotnet_last_dll_path'] = request()
else
if vim.fn.confirm('Do you want to change the path to dll?\n' .. vim.g['dotnet_last_dll_path'], '&yes\n&no', 2) == 1 then
vim.g['dotnet_last_dll_path'] = request()
end
end
return vim.g['dotnet_last_dll_path']
end
'';
};
};
}

View file

@ -19,17 +19,8 @@
keymaps = [
{
mode = "n";
key = "<leader>d";
action = "";
options = {
desc = "Manage Dev Container";
silent = true;
};
}
{
mode = "n";
key = "<leader>ds";
action = ":DevcontainerStart<CR>";
key = "<leader>dcs";
action = "<CMD>DevcontainerStart<CR>";
options = {
desc = "Start Dev Container";
silent = false;
@ -37,8 +28,8 @@
}
{
mode = "n";
key = "<leader>dc";
action = ":DevcontainerStopAll<CR>";
key = "<leader>dcc";
action = "<CMD>DevcontainerStopAll<CR>";
options = {
desc = "Stop Dev Container";
silent = false;
@ -46,8 +37,8 @@
}
{
mode = "n";
key = "<leader>dr";
action = ":DevcontainerRemoveAll<CR>";
key = "<leader>dcr";
action = "<CMD>DevcontainerRemoveAll<CR>";
options = {
desc = "Remove Dev Container";
silent = false;
@ -55,8 +46,8 @@
}
{
mode = "n";
key = "<leader>da";
action = ":DevcontainerAttach<CR>";
key = "<leader>dca";
action = "<CMD>DevcontainerAttach<CR>";
options = {
desc = "Attach to Dev Container";
silent = false;
@ -64,7 +55,7 @@
}
{
mode = "n";
key = "<leader>de";
key = "<leader>dce";
action = ":DevcontainerExec ";
options = {
desc = "Execute Command in Dev Container";
@ -73,8 +64,8 @@
}
{
mode = "n";
key = "<leader>dl";
action = ":DevcontainerLogs<CR>";
key = "<leader>dcl";
action = "<CMD>DevcontainerLogs<CR>";
options = {
desc = "Open Dev Container Logs";
silent = true;
@ -82,8 +73,8 @@
}
{
mode = "n";
key = "<leader>dz";
action = ":DevcontainerEditNearestConfig<CR>";
key = "<leader>dcz";
action = "<CMD>DevcontainerEditNearestConfig<CR>";
options = {
desc = "Edit Nearest devcontainer.json";
silent = false;

View file

@ -17,8 +17,11 @@
''
require("FloatTerm").setup({
window_config = {
border = 'shadow',
title = "Terminal",
},
pad_vertical = 5,
pad_horizontal = 10,
})
'';
keymaps = [

View file

@ -21,7 +21,7 @@
mouse_providers = {
'LSP',
},
mouse_delay = 100
mouse_delay = 400
})
vim.o.mousemoveevent = true
'';

View file

@ -0,0 +1,59 @@
{
programs.nixvim = {
plugins = {
rainbow-delimiters = {
enable = true;
highlight.__raw = "highlight";
};
indent-blankline = {
enable = true;
settings = {
exclude = {
buftypes = [
"terminal"
"quickfix"
];
filetypes = [
""
"checkhealth"
"help"
"lspinfo"
"packer"
"TelescopePrompt"
"TelescopeResults"
"yaml"
];
};
scope = {
show_start = false;
show_end = false;
};
};
};
};
extraConfigLuaPre = # lua
''
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowPeach",
"RainbowGreen",
"RainbowMauve",
"RainbowTeal",
}
local hooks = require("ibl.hooks")
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#f38ba8" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#f9e2af" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#89b4fa" })
vim.api.nvim_set_hl(0, "RainbowPeach", { fg = "#fab387" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#a6e3a1" })
vim.api.nvim_set_hl(0, "RainbowMauve", { fg = "#cba6f7" })
vim.api.nvim_set_hl(0, "RainbowTeal", { fg = "#94e2d5" })
end)
--vim.g.rainbow_delimiters = { highlight = highlight }
'';
extraConfigLuaPost = "hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)";
};
}

View file

@ -8,7 +8,7 @@
{
mode = "n";
key = "<leader>g";
action = "<cmd>LazyGit<cr>";
action = "<CMD>LazyGit<CR>";
options = {
desc = "LazyGit";
silent = true;

View file

@ -29,7 +29,11 @@
};
};
ruff.enable = true; # Python
csharp_ls.enable = true;
omnisharp = {
enable = true; # C#
package = pkgs.omnisharp-roslyn;
cmd = [ "${lib.getExe pkgs.omnisharp-roslyn}" ];
};
nil_ls = {
enable = true; # Nix
settings.formatting.command = [ "${lib.getExe pkgs.nixfmt-rfc-style}" ];
@ -38,6 +42,7 @@
enable = true;
package = pkgs.callPackage ../../../packages/luau-lsp.nix { inherit pkgs; };
};
lua_ls.enable = true;
html.enable = true;
jsonls.enable = true;
yamlls.enable = true;
@ -47,6 +52,7 @@
dockerls.enable = true;
docker_compose_language_service.enable = true;
bashls.enable = true;
ts_ls.enable = true;
denols.enable = true; # JavaScript / TypeScript (Deno)
eslint.enable = true; # JavaScript / TypeScript
typos_lsp.enable = true;
@ -76,11 +82,24 @@
};
};
};
extraPlugins = with pkgs.vimPlugins; [
vim-csharp
# (pkgs.vimUtils.buildVimPlugin {
# # https://github.com/OrangeT/vim-csharp
# name = "vim-csharp";
# src = pkgs.fetchFromGitHub {
# owner = "OrangeT";
# repo = "vim-csharp";
# rev = "b5982fc69bba7d507638a308d6875b031054280d";
# sha256 = "";
# };
# })
];
keymaps = [
{
mode = "n";
key = "<leader>x";
action = ":Trouble<CR>";
action = "<CMD>Trouble<CR>";
options = {
desc = "Trouble";
silent = true;
@ -89,7 +108,7 @@
{
mode = "n";
key = "<leader>xx";
action = ":Trouble diagnostics toggle<CR>";
action = "<CMD>Trouble diagnostics toggle<CR>";
options = {
desc = "Diagnostics (Trouble)";
silent = true;
@ -98,7 +117,7 @@
{
mode = "n";
key = "<leader>xX";
action = ":Trouble diagnostics toggle filter.buf=0<CR>";
action = "<CMD>Trouble diagnostics toggle filter.buf=0<CR>";
options = {
desc = "Buffer Diagnostics (Trouble)";
silent = true;
@ -107,7 +126,7 @@
{
mode = "n";
key = "<leader>xs";
action = ":Trouble symbols toggle focus=false<CR>";
action = "<CMD>Trouble symbols toggle focus=false<CR>";
options = {
desc = "Symbols (Trouble)";
silent = true;
@ -116,7 +135,7 @@
{
mode = "n";
key = "<leader>xd";
action = ":Trouble lsp_definitions toggle<CR>";
action = "<CMD>Trouble lsp_definitions toggle<CR>";
options = {
desc = "LSP Definitions / references / ... (Trouble)";
silent = true;
@ -125,7 +144,7 @@
{
mode = "n";
key = "<leader>xl";
action = ":Trouble loclist toggle<CR>";
action = "<CMD>Trouble loclist toggle<CR>";
options = {
desc = "Location List (Trouble)";
silent = true;
@ -134,7 +153,7 @@
{
mode = "n";
key = "<leader>xq";
action = ":Trouble qflist toggle<CR>";
action = "<CMD>Trouble qflist toggle<CR>";
options = {
desc = "Quickfix (Trouble)";
silent = true;

View file

@ -25,7 +25,7 @@
end
end
local function toggle_profile()
vim.g.toggle_profile = function()
local prof = require("profile")
if prof.is_recording() then
prof.stop()
@ -46,18 +46,17 @@
end)
end
end
vim.keymap.set("", "<leader>p", toggle_profile, { desc = "Toggle Profiling", silent = true })
'';
# keymaps = [
# {
# mode = "n";
# key = "<leader>p";
# action = "toggle_profile";
# options = {
# desc = "Toggle Profiling";
# silent = true;
# };
# }
# ];
keymaps = [
{
mode = "n";
key = "<leader>p";
action = "<CMD>lua vim.g.toggle_profile()<CR>";
options = {
desc = "Toggle Profiling";
silent = true;
};
}
];
};
}

View file

@ -105,7 +105,7 @@
{
mode = "n";
key = "<leader>te";
action = ":Telescope file_browser path=%:p:h select_buffer=true<CR>";
action = "<CMD>Telescope file_browser path=%:p:h select_buffer=true<CR>";
options = {
desc = "File Explorer";
silent = true;
@ -114,7 +114,7 @@
{
mode = "n";
key = "<leader>tr";
action = ":Telescope live_grep<CR>";
action = "<CMD>Telescope live_grep<CR>";
options = {
desc = "Live Grep";
silent = true;
@ -123,7 +123,7 @@
{
mode = "n";
key = "<leader>ta";
action = ":Telescope aerial<CR>";
action = "<CMD>Telescope aerial<CR>";
options = {
desc = "Aerial";
silent = true;
@ -132,7 +132,7 @@
{
mode = "n";
key = "<leader>tb";
action = ":Telescope buffers<CR>";
action = "<CMD>Telescope buffers<CR>";
options = {
desc = "Buffers";
silent = true;
@ -141,7 +141,7 @@
{
mode = "n";
key = "<leader>tt";
action = ":Telescope colorscheme<CR>";
action = "<CMD>Telescope colorscheme<CR>";
options = {
desc = "Color Schemes";
silent = true;
@ -150,7 +150,7 @@
{
mode = "n";
key = "<leader>tk";
action = ":Telescope keymaps<CR>";
action = "<CMD>Telescope keymaps<CR>";
options = {
desc = "Keymaps";
silent = true;
@ -159,7 +159,6 @@
{
mode = "n";
key = "<leader>tp";
# action = ":Telescope repo list<CR>";
action = "<CMD>Telescope project display_type=full hide_workspace=true<CR>";
options = {
desc = "Projects";
@ -169,7 +168,7 @@
{
mode = "n";
key = "<leader>tc";
action = ":Telescope commands<CR>";
action = "<CMD>Telescope commands<CR>";
options = {
desc = "Commands";
silent = true;
@ -178,7 +177,7 @@
{
mode = "n";
key = "<leader>tm";
action = ":Telescope man_pages<CR>";
action = "<CMD>Telescope man_pages<CR>";
options = {
desc = "Man Pages";
silent = true;
@ -187,7 +186,7 @@
{
mode = "n";
key = "<leader>tn";
action = ":Telescope vim_options<CR>";
action = "<CMD>Telescope vim_options<CR>";
options = {
desc = "Vim Options";
silent = true;
@ -197,7 +196,7 @@
{
mode = "n";
key = "<leader>tgc";
action = ":Telescope git_commits<CR>";
action = "<CMD>Telescope git_commits<CR>";
options = {
desc = "Git Commits";
silent = true;
@ -206,7 +205,7 @@
{
mode = "n";
key = "<leader>tgb";
action = ":Telescope git_branches<CR>";
action = "<CMD>Telescope git_branches<CR>";
options = {
desc = "Git Branches";
silent = true;
@ -215,7 +214,7 @@
{
mode = "n";
key = "<leader>tgs";
action = ":Telescope git_status<CR>";
action = "<CMD>Telescope git_status<CR>";
options = {
desc = "Git Status";
silent = true;
@ -224,7 +223,7 @@
{
mode = "n";
key = "<leader>tgS";
action = ":Telescope git_stash<CR>";
action = "<CMD>Telescope git_stash<CR>";
options = {
desc = "Git Stash";
silent = true;

View file

@ -46,6 +46,7 @@
bash
c
cpp
c_sharp
css
dockerfile
go

View file

@ -31,9 +31,27 @@
enable = true;
#lazyLoad.enable = true;
settings = {
transparent_background = false;
term_colors = false;
styles = {
conditionals = null;
};
custom_highlights = # lua
''
function(colors)
return {
Comment = { fg = "#f4b8e4", style = { "italic" } },
["@punctuation.comment"] = { fg = "#f4b8e4", style = { "italic" } },
["@variable"] = { fg = "#82eaf0" },
["@operator"] = { fg = "#EBA0AC" },
["@meta.block.paradox"] = { fg = "#EBA0AC" },
["@comment.shebang"] = { fg = "#ef9f76", style = { "italic", "bold" } },
["@punctuation.comment.shebang"] = { fg = "#ef9f76", style = { "italic", "bold" } },
["@string.special.shell"] = { fg = "#82e5f0" },
["@property.ts"] = { fg = "#32d5e7" },
}
end
'';
};
};
plugins = {
@ -48,7 +66,7 @@
image.enable = true;
which-key.enable = true;
neocord.enable = false;
rainbow-delimiters.enable = true;
lazydev.enable = true;
neoconf.enable = true;
colorizer = {
enable = true;
@ -59,7 +77,6 @@
comment.enable = true;
dotnet.enable = true;
sqlite-lua.enable = true;
lazydev.enable = true;
};
userCommands = {
ViewInit = {
@ -74,6 +91,7 @@
'';
extraConfigVim = ''
set number " enable number lines
set relativenumber " enable relative number lines
'';
};
}