change structure to make it more readable

This commit is contained in:
lucy 2026-07-30 17:20:40 +02:00
commit ad86712653
31 changed files with 259 additions and 234 deletions

43
nixos/nixvim/keymaps.nix Normal file
View file

@ -0,0 +1,43 @@
{
programs.nixvim = {
keymaps = [
{
key = "<C-f>";
action = "<cmd> lua vim.lsp.buf.format() <cr>";
}
{
key = "<c-t>";
action = "<cmd>ToggleTerm size=10<cr>";
}
{
key = "<leader>tf";
action = "<cmd>ToggleTerm size=10 direction=float<cr>";
}
{
key = "<esc>";
action = "<c-\\><c-n>";
mode = "t";
}
{
key = "<leader>w";
action = "<cmd>bdelete! <cr>";
}
{
key = "<C-l>";
action = "<C-W>l";
}
{
key = "<C-k>";
action = "<C-W>k";
}
{
key = "<C-j>";
action = "<C-W>j";
}
{
key = "<C-h>";
action = "<C-W>h";
}
];
};
}

62
nixos/nixvim/nixvim.nix Normal file
View file

@ -0,0 +1,62 @@
{
inputs,
config,
lib,
pkgs,
...
}:
{
imports = [
./plugins.nix
./keymaps.nix
];
programs.nixvim = {
nixpkgs.config.allowUnfree = true;
enable = true;
extraConfigLuaPost = ''
local map = vim.keymap.set
for i = 1, 10 do
map('n', '<A-' .. i .. '>', '<cmd> BufferGoto ' .. i .. '<cr>')
end
'';
opts = {
relativenumber = true;
number = true;
tabstop = 8;
shiftwidth = 8;
expandtab = true;
swapfile = false;
};
extraPackages = with pkgs; [
nixfmt
];
lsp = {
inlayHints.enable = true;
servers = {
clangd.enable = true;
qmlls.enable = true;
lua-language-server.enable = true;
rust_analyzer.enable = true;
nixd = {
enable = true;
config = {
formatting = {
command = "nixfmt";
};
};
};
};
};
globals = {
mapleader = " ";
};
diagnostic = {
settings = {
virtual_text = {
spacing = 4;
source = true;
};
};
};
};
}

95
nixos/nixvim/plugins.nix Normal file
View file

@ -0,0 +1,95 @@
{
programs.nixvim = {
plugins = {
lspconfig.enable = true;
web-devicons.enable = true;
blink-cmp = {
enable = true;
};
blink-indent = {
enable = true;
};
toggleterm = {
enable = true;
settings = {
size = 30;
direction = "horizontal";
};
};
cord = {
enable = true;
settings = {
display = {
theme = "atom";
};
editor = {
tooltip = "ur gay :3";
};
};
};
barbar = {
enable = true;
settings = {
icons = {
buffer_index = true;
};
};
};
lualine = {
enable = true;
settings = {
extensions = [ "toggleterm" ];
options = {
section_separators = {
left = "▎";
right = "▕";
};
component_separators = {
left = "";
right = "";
};
};
inactive_sections = {
lualine_a = [
"mode"
];
lualine_b = [
"filename"
"filetype"
];
lualine_c = [
"diagnostics"
];
lualine_x = [
"lsp_status"
];
lualine_y = [ ];
lualine_z = [
"location"
];
};
sections = {
lualine_a = [
"mode"
];
lualine_b = [
"filename"
"filetype"
];
lualine_c = [
"diagnostics"
];
lualine_x = [
"lsp_status"
];
lualine_y = [ ];
lualine_z = [
"location"
];
};
};
};
};
};
}