feat: config rewrite (#1)

This commit is contained in:
Patrick Canal
2026-05-23 09:25:51 +02:00
committed by GitHub
parent f992b47a95
commit c6b94479c2
17 changed files with 111 additions and 332 deletions
+1 -8
View File
@@ -1,22 +1,15 @@
{ pkgs, ... }:
{
imports = [
./keybindings.nix
./opts.nix
./lsp.nix
./cmp.nix
./keymaps.nix
./plugins
];
colorschemes.catppuccin.enable = true;
extraPackages = with pkgs; [
wl-clipboard
];
clipboard = {
register = "unnamedplus";
providers.wl-copy.enable = true;
providers.wl-copy.package = pkgs.wl-clipboard;
providers.xclip.enable = true;
providers.xclip.package = pkgs.xclip;
};
}
+52
View File
@@ -0,0 +1,52 @@
{ ... }:
let
defaultOptions = {
silent = true;
};
in
{
keymaps = [
{
key = "<space>e";
action = ":Neotree toggle<CR>";
options = defaultOptions;
}
{
key = "<C-s>";
action = ":w<CR>";
}
{
key = "<S-q>";
action = ":bdelete<CR>";
options = defaultOptions;
}
{
key = "<A-l>";
action = ":bnext<CR>";
options = defaultOptions;
}
{
key = "<A-h>";
action = ":bprevious<CR>";
options = defaultOptions;
}
{
key = "<C-f>";
action = ":lua vim.lsp.buf.format()<CR>";
options = defaultOptions;
}
{
action = ":ToggleTerm direction=float<CR>";
key = "<Space>t";
}
{
action = "<C-\\><C-n>";
key = "<Esc>";
options = {
silent = true;
desc = "Exit terminal insert mode";
};
mode = "t";
}
];
}
-174
View File
@@ -1,174 +0,0 @@
{ ... }:
{
keymaps = [
{
action = ":bnext<CR>";
key = "<A-l>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = ":bprevious<CR>";
key = "<A-h>";
options = {
silent = true;
desc = "Previous tab";
};
mode = "n";
}
{
action = ":bdelete<CR>";
key = "<S-q>";
options = {
silent = true;
desc = "Next tab";
};
mode = "n";
}
{
action = "<C-\\><C-n>";
key = "<Esc>";
options = {
silent = true;
desc = "Exit terminal insert mode";
};
mode = "t";
}
{
action = ":w<CR>";
key = "<C-s>";
options = {
silent = true;
desc = "Save";
};
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>";
options = {
silent = true;
desc = "Quit";
};
mode = "n";
}
{
action = ":wincmd l<CR>";
key = "<Space>wl";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = ":wincmd k<CR>";
key = "<Space>wk";
options = {
silent = true;
desc = "Go to upper panel";
};
mode = "n";
}
{
action = ":wincmd j<CR>";
key = "<Space>wj";
options = {
silent = true;
desc = "Go to down panel";
};
mode = "n";
}
{
action = ":wincmd h<CR>";
key = "<Space>wh";
options = {
silent = true;
desc = "Go to left panel";
};
mode = "n";
}
{
action = "$";
key = "gl";
options = {
silent = true;
desc = "Go to end line";
};
mode = [
"n"
"v"
];
}
{
action = "^";
key = "gh";
options = {
silent = true;
desc = "Go to start line";
};
mode = [
"n"
"v"
];
}
{
action = ":lua Snacks.explorer()<CR>";
key = "<Space>e";
options = {
silent = true;
desc = "Toggle file explorer";
};
mode = "n";
}
# ToggleTerm
{
action = ":ToggleTerm direction=float<CR>";
key = "<Space>t";
options = {
silent = true;
desc = "Toggle terminal";
};
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";
};
}
];
}
+8 -7
View File
@@ -1,17 +1,18 @@
{ ... }:
{
opts = {
cursorline = true;
number = true;
relativenumber = true;
signcolumn = "yes";
splitright = true;
splitbelow = true;
cursorline = true;
scrolloff = 5;
undofile = true;
ignorecase = true;
shiftwidth = 4;
signcolumn = "yes";
autoindent = true;
updatetime = 200;
smartcase = true;
gdefault = true;
ignorecase = true;
termguicolors = true;
gdefault = true;
cursorlineopt = "both";
};
}
+10
View File
@@ -0,0 +1,10 @@
{ ... }:
{
plugins.guess-indent = {
enable = true;
settings = {
underline.enable = true;
static.enable = true;
};
};
}
@@ -13,6 +13,8 @@
{ name = "path"; }
{ name = "buffer"; }
{ name = "dap"; }
{ name = "blink-emoji"; }
{ name = "blink-ripgrep"; }
];
mapping = {
"<Tab>" = "cmp.mapping.select_next_item()";
+20
View File
@@ -0,0 +1,20 @@
{ ... }:
{
plugins.cursorline = {
enable = true;
settings = {
cursorline = {
enable = true;
timeout = 0;
number = false;
};
cursorword = {
enable = true;
minLength = 3;
hl = {
underline = true;
};
};
};
};
}
-66
View File
@@ -1,66 +0,0 @@
{ pkgs, ... }:
{
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;
};
}
-20
View File
@@ -1,20 +0,0 @@
{ ... }:
{
plugins.dashboard = {
enable = true;
settings.config = {
header = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
footer = [ "Made with " ];
};
};
}
+16 -14
View File
@@ -1,27 +1,29 @@
{ ... }:
{
imports = [
./blink-indent.nix
./cmp.nix
./comment.nix
./dap.nix
./dashboard.nix
./fidget.nix
./guess-indent.nix
./cursorline.nix
./gitsigns.nix
./lsp.nix
./lualine.nix
./snacks.nix
./telescope.nix
./vimwiki.nix
];
plugins = {
autoclose.enable = true;
bufferline.enable = true;
colorful-menu.enable = true;
gitsigns.enable = true;
lazygit.enable = true;
nix-develop.enable = true;
nvim-surround.enable = true;
toggleterm.enable = true;
neo-tree.enable = true;
web-devicons.enable = true;
bufferline.enable = true;
nvim-autopairs.enable = true;
which-key.enable = true;
notify.enable = true;
toggleterm.enable = true;
treesitter.enable = true;
todo-comments.enable = true;
fidget.enable = true;
blink-indent.enable = true;
blink-ripgrep.enable = true;
blink-pairs.enable = true;
};
}
-10
View File
@@ -1,10 +0,0 @@
{
plugins.fidget = {
enable = true;
settings.progress = {
suppress_on_insert = true;
ignore_done_already = true;
poll_rate = 1;
};
};
}
@@ -1,6 +1,6 @@
{ ... }:
{
plugins.guess-indent = {
plugins.gitsigns = {
enable = true;
};
}
@@ -22,8 +22,6 @@
docker_compose_language_service.enable = true;
jsonls.enable = true;
phpactor.enable = true;
gleam.enable = true;
elixirls.enable = true;
qmlls.enable = true;
};
keymaps = {
+1 -3
View File
@@ -1,6 +1,4 @@
{ ... }:
{
plugins.lualine = {
enable = true;
};
plugins.lualine.enable = true;
}
-11
View File
@@ -1,11 +0,0 @@
{ ... }:
{
plugins.snacks = {
enable = true;
settings = {
explorer = {
enabled = true;
};
};
};
}
-16
View File
@@ -1,16 +0,0 @@
{ ... }:
{
plugins.vimwiki = {
enable = true;
settings = {
list = [
{
path = "$HOME/.vimwiki/";
template_path = "$HOME/.vimwiki/";
template_default = "default";
template_ext = "html";
}
];
};
};
}