feat: move nixvim out

This commit is contained in:
Kat Inskip 2025-12-02 01:01:36 -08:00
parent 4477a98282
commit 57815057f6
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
11 changed files with 329 additions and 109 deletions

29
nixvim/plugins/aerial.nix Normal file
View file

@ -0,0 +1,29 @@
_: {
plugins = let
basePlugin = {
enable = true;
autoLoad = true;
};
in {
aerial =
basePlugin
// {
settings = {
backends = [
"treesitter"
"lsp"
"markdown"
"man"
];
attach_mode = "global";
highlight_on_hover = true;
on_attach.__raw = ''
function(buffer)
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
end
'';
};
};
};
}

60
nixvim/plugins/hop.nix Normal file
View file

@ -0,0 +1,60 @@
_: {
keymaps = [
{
key = "f";
action.__raw = ''
function()
require'hop'.hint_char1({
direction = require'hop.hint'.HintDirection.AFTER_CURSOR,
current_line_only = true
})
end
'';
options.remap = true;
}
{
key = "F";
action.__raw = ''
function()
require'hop'.hint_char1({
direction = require'hop.hint'.HintDirection.BEFORE_CURSOR,
current_line_only = true
})
end
'';
options.remap = true;
}
{
key = "t";
action.__raw = ''
function()
require'hop'.hint_char1({
direction = require'hop.hint'.HintDirection.AFTER_CURSOR,
current_line_only = true,
hint_offset = -1
})
end
'';
options.remap = true;
}
{
key = "T";
action.__raw = ''
function()
require'hop'.hint_char1({
direction = require'hop.hint'.HintDirection.BEFORE_CURSOR,
current_line_only = true,
hint_offset = 1
})
end
'';
options.remap = true;
}
];
plugins = {
hop = {
enable = true;
autoLoad = true;
};
};
}

63
nixvim/plugins/lsp.nix Normal file
View file

@ -0,0 +1,63 @@
{
lib,
std,
...
}: let
inherit (std) set;
inherit (lib.attrsets) genAttrs;
in {
lsp.servers = let
baseServer = {
enable = true;
activate = true;
};
disablePackage = {
package = null;
};
serversToGen = [
"rust_analyzer"
"nixd"
"zk"
"gleam"
"luau_lsp"
"stylua"
];
disabledPackageServers = [
"rust_analyzer"
"luau_lsp"
"stylua"
];
in
set.merge [
(genAttrs serversToGen (_: baseServer))
(genAttrs disabledPackageServers (_: disablePackage))
{
}
];
plugins = let
pluginsToGen = [
"lspconfig"
"cmp"
"cmp-clippy"
"cmp-cmdline"
"cmp-emoji"
"cmp-nvim-lsp"
"cmp-path"
"cmp-rg"
"cmp-spell"
"cmp-tmux"
"cmp-treesitter"
"cmp-zsh"
];
basePlugin = {
enable = true;
autoLoad = true;
};
in
genAttrs pluginsToGen (_: basePlugin);
diagnostic.settings = {
virtual_text = true;
virtual_lines = true;
underlines = true;
};
}

View file

@ -0,0 +1,95 @@
_: {
plugins = let
basePlugin = {
enable = true;
autoLoad = true;
};
in {
startup =
basePlugin
// {
settings = {
colors = {
background = "#1f2227";
folded_section = "#56b6c2";
};
mappings = {
execute_command = "<CR>";
open_file = "o";
open_file_split = "<c-o>";
open_help = "?";
open_section = "<TAB>";
};
header = {
type = "text";
oldfiles_directory = false;
align = "center";
fold_section = false;
title = "Header";
margin = 5;
highlight = "Statement";
default_color = "";
oldfiles_amount = 0;
content = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
};
body = {
type = "mapping";
oldfiles_directory = false;
align = "center";
fold_section = false;
title = "Basic Commands";
margin = 5;
content = [
[" Find File" "Telescope find_files" "<leader>ff"]
["󰍉 Find Word" "Telescope live_grep" "<leader>lg"]
[" Recent Files" "Telescope oldfiles" "<leader>of"]
[" File Browser" "Telescope file_browser" "<leader>fb"]
[" New File" "lua require'startup'.new_file()" "<leader>nf"]
];
highlight = "String";
default_color = "";
oldfiles_amount = 0;
};
footer = {
type = "text";
oldfiles_directory = false;
align = "center";
fold_section = false;
title = "Footer";
margin = 5;
content = ["waow sleepy girl"];
highlight = "Number";
default_color = "";
oldfiles_amount = 0;
};
options = {
after = null;
cursor_column = 0.5;
disable_statuslines = true;
empty_lines_between_mappings = true;
mapping_keys = true;
paddings = [1 3 3 0];
};
parts = [
"header"
"body"
"footer"
];
};
};
};
}

View file

@ -0,0 +1,36 @@
_: {
keymaps = [
{
options.silent = true;
key = "<Leader>fb";
action.__raw = ''
function()
require("telescope").extensions.file_browser.file_browser()
end
'';
}
];
plugins = let
basePlugin = {
enable = true;
autoLoad = true;
};
in {
telescope =
basePlugin
// {
keymaps = {
"<Leader>fg" = "live_grep";
"<Leader>ff" = "find_files";
"<Leader>fB" = "buffers";
"<Leader>fh" = "help_tags";
};
extensions = {
file-browser.enable = true;
frecency.enable = true;
ui-select.enable = true;
undo.enable = true;
};
};
};
}