refactor: gigantic refactor

This commit is contained in:
leonhard committed 2026-11-12 13:26:08 +01:00
1 parent d1e2bde503
commit 0474f7bbb4
50 files changed
+232 -207

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
{
imports = [
./opts.nix
./keymaps.nix
./plugins
];
programs.nixvim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
colorschemes.tokyonight.enable = true;
clipboard.providers.wl-copy.enable = true;
globals.mapleader = " ";
};
}
+42
View File
@@ -0,0 +1,42 @@
{
programs.nixvim.keymaps = [
{
mode = "n";
key = "<Esc>";
action = "<cmd>nohlsearch<CR>";
options.silent = true;
}
{
mode = "n";
key = "<leader>q";
action.__raw = "vim.diagnostic.setloclist";
options.desc = "Open diagnostics quickfix list";
}
{
mode = "n";
key = "<C-h>";
action = "<C-w><C-h>";
options.desc = "Move focus to the left window";
}
{
mode = "n";
key = "<C-l>";
action = "<C-w><C-l>";
options.desc = "Move focus to the right window";
}
{
mode = "n";
key = "<C-k>";
action = "<C-w><C-k>";
options.desc = "Move focus to the upper window";
}
{
mode = "n";
key = "<C-j>";
action = "<C-w><C-j>";
options.desc = "Move focus to the lower window";
}
];
}
+37
View File
@@ -0,0 +1,37 @@
{
programs.nixvim.opts = {
number = true;
relativenumber = true;
showmode = false;
breakindent = true;
undofile = true;
ignorecase = true;
smartcase = true;
signcolumn = "yes";
updatetime = 250;
timeoutlen = 300;
splitright = true;
splitbelow = true;
list = true;
listchars = {
tab = "» ";
trail = "·";
nbsp = "␣";
};
inccommand = "split";
cursorline = true;
scrolloff = 10;
confirm = true;
};
}
+21
View File
@@ -0,0 +1,21 @@
{
programs.nixvim = {
plugins = {
blink-indent.enable = true;
blink-pairs.enable = true;
blink-cmp = {
enable = true;
settings = {
signature.enabled = true;
keymap = {
preset = "default";
"<CR>" = [
"accept"
"fallback"
];
};
};
};
};
};
}
+53
View File
@@ -0,0 +1,53 @@
{
programs.nixvim = {
plugins.dap = {
enable = true;
luaConfig.content = ''
local dap = require 'dap'
local dapui = require 'dapui'
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
'';
};
plugins.dap-ui.enable = true;
plugins.dap-python.enable = true;
keymaps = [
{
mode = "n";
key = "<F5>";
action = "<cmd>DapContinue<CR>";
options.desc = "Debug: Start/Continue";
options.silent = true;
}
{
mode = "n";
key = "<F1>";
action = "<cmd>DapStepInto<CR>";
options.desc = "Debug: Step Into";
options.silent = true;
}
{
mode = "n";
key = "<F2>";
action = "<cmd>DapStepOver<CR>";
options.desc = "Debug: Step Over";
options.silent = true;
}
{
mode = "n";
key = "<F3>";
action = "<cmd>DapStepOut<CR>";
options.desc = "Debug: Step Out";
options.silent = true;
}
{
mode = "n";
key = "<leader>b";
action = "<cmd>DapToggleBreakpoint<CR>";
options.desc = "Debug: Toggle Breakpoint";
options.silent = true;
}
];
};
}
+19
View File
@@ -0,0 +1,19 @@
{ pkgs, ... }:
{
imports = [
./blink.nix
./dap.nix
./lsp.nix
./fmt.nix
./treesitter.nix
./telescope.nix
./lualine.nix
./which-key.nix
];
programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [
vim-sleuth
];
};
}
+45
View File
@@ -0,0 +1,45 @@
{ pkgs, ... }:
{
programs.nixvim = {
opts.formatexpr = "v:lua.require'conform'.formatexpr()";
keymaps = [
{
key = "<leader>f";
action.__raw = ''
function() require 'conform'.format { async = true } end
'';
options.desc = "Format Buffer";
}
];
plugins.conform-nvim = {
enable = true;
settings = {
default_format_opts.lsp_format = "fallback";
format_on_save = {
lsp_format = "fallback";
timeout_ms = 500;
};
formatters_by_ft = {
c = [ "clang-format" ];
lua = [ "stylua" ];
nix = [ "nixfmt" ];
python = [ "ruff_format" ];
};
formatters.clang-format.prepend_args = [
"--style=file"
"--fallback-style=LLVM"
];
};
};
extraPackages = with pkgs; [
stylua
nixfmt
ruff
];
};
}
+63
View File
@@ -0,0 +1,63 @@
{
imports = [
./typst.nix
];
programs.nixvim = {
diagnostic.settings = {
severity_sort = true;
float = {
border = "rounded";
source = "if_many";
};
signs.text.__raw = "{
[vim.diagnostic.severity.ERROR] = '󰅚 ',
[vim.diagnostic.severity.WARN] = '󰀪 ',
[vim.diagnostic.severity.INFO] = '󰋽 ',
[vim.diagnostic.severity.HINT] = '󰌶 ',
}";
virtual_text = {
source = "if_many";
spacing = 2;
format.__raw = "
function(diagnostic)
return diagnostic.message
end
";
};
};
plugins = {
lsp = {
enable = true;
keymaps = {
silent = true;
lspBuf = {
"gd" = "definition";
"gD" = "declaration";
"gr" = "references";
"gI" = "implementation";
"<leader>ca" = "code_action";
"<leader>D" = "type_definition";
"<leader>rn" = "rename";
};
};
servers = {
lua_ls.enable = true;
nil_ls.enable = true;
basedpyright.enable = true;
ts_ls.enable = true;
vue_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = false;
installRustc = false;
};
clangd.enable = true;
};
};
};
};
}
+21
View File
@@ -0,0 +1,21 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
settings = {
options = {
section_separators = "";
component_separators = "";
};
sections = {
lualine_b = [
{
__unkeyed-1 = "branch";
icon = "";
}
];
lualine_c = [ "filename" ];
lualine_x = [ "filetype" ];
};
};
};
}
+46
View File
@@ -0,0 +1,46 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
ripgrep
];
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzf-native.enable = true;
keymaps = {
"<leader>sh" = {
action = "help_tags";
options.desc = "Search Help";
};
"<leader>sf" = {
action = "find_files";
options.desc = "Search Files";
};
"<leader>ss" = {
action = "builtin";
options.desc = "Search Select Telescope";
};
"<leader>sg" = {
action = "live_grep";
options.desc = "Search by Grep";
};
"<leader><leader>" = {
action = "buffers";
options.desc = "Find existing buffers";
};
"<leader>/" = {
action = "current_buffer_fuzzy_find";
options.desc = "Find in current buffer";
};
};
settings.defaults.file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"^node_modules/"
"%.ipynb"
];
};
}
+14
View File
@@ -0,0 +1,14 @@
{ pkgs, ... }:
{
programs.nixvim = {
plugins.treesitter = {
enable = true;
highlight.enable = true;
indent.enable = true;
};
extraPackages = with pkgs; [
gcc
];
};
}
+10
View File
@@ -0,0 +1,10 @@
{
programs.nixvim = {
dependencies.tinymist.enable = true;
dependencies.websocat.enable = true;
plugins.typst-preview.enable = true;
plugins.lsp.servers.tinymist.enable = true;
};
}
+3
View File
@@ -0,0 +1,3 @@
{
programs.nixvim.plugins.which-key.enable = true;
}