feat:add_nixvim

This commit is contained in:
dichgrem
2025-09-21 15:54:31 +08:00
parent c36f91562d
commit 8016a1173d
64 changed files with 3608 additions and 30 deletions

View File

@@ -0,0 +1,5 @@
{
plugins.colorizer = {
enable = true;
};
}

View File

@@ -0,0 +1,34 @@
{
plugins.debugprint = {
enable = true;
settings = {
commands = {
toggle_comment_debug_prints = "ToggleCommentDebugPrints";
delete_debug_prints = "DeleteDebugPrints";
};
display_counter = true;
display_snippet = true;
keymaps = {
normal = {
plain_below = "<leader>pb";
plain_above = "<leader>pB";
variable_below = "<leader>pv";
variable_above = "<leader>pV";
variable_below_alwaysprompt.__raw = "nil";
variable_above_alwaysprompt.__raw = "nil";
textobj_below = "<leader>po";
textobj_above = "<leader>pO";
toggle_comment_debug_prints.__raw = "nil";
delete_debug_prints.__raw = "nil";
};
visual = {
variable_below = "<leader>pv";
variable_above = "<leader>pV";
};
};
};
};
}

View File

@@ -0,0 +1,17 @@
{
plugins.harpoon = {
enable = true;
enableTelescope = true;
# keymapsSilent = true;
# keymaps = {
# addFile = "<leader>ha";
# toggleQuickMenu = "<C-e>";
# navFile = {
# "1" = "<leader>hj";
# "2" = "<leader>hk";
# "3" = "<leader>hl";
# "4" = "<leader>hm";
# };
# };
};
}

View File

@@ -0,0 +1,5 @@
{
plugins.kulala = {
enable = false;
};
}

View File

@@ -0,0 +1,28 @@
{
plugins = {
mini = {
enable = true;
modules = {
comment = {
options = {
customCommentString = ''
<cmd>lua require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring<cr>
'';
};
};
# Highlight word under cursor
cursorword = {
delay = 0;
};
# Show indent lines
indentscope = {
symbol = "";
draw.delay = 0;
};
};
};
ts-context-commentstring.enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{
plugins.nvim-autopairs = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{
plugins.nvim-surround = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{
plugins.persistence = {
enable = true;
};
}

View File

@@ -0,0 +1,5 @@
{pkgs, ...}: {
extraPlugins = with pkgs.vimPlugins; [
plenary-nvim
];
}

View File

@@ -0,0 +1,6 @@
{
plugins.project-nvim = {
enable = true;
enableTelescope = true;
};
}

View File

@@ -0,0 +1,103 @@
{
config,
lib,
pkgs,
...
}: {
extraConfigLuaPre = lib.mkOrder 1 (
lib.optionalString
(config.plugins.snacks.enable && config.plugins.snacks.settings.profiler.enabled) # Lua
''
if vim.env.PROF then
local snacks = "${pkgs.vimPlugins.snacks-nvim}"
vim.opt.rtp:append(snacks)
require("snacks.profiler").startup({
startup = {
-- event = "VimEnter", -- stop profiler on this event. Defaults to `VimEnter`
event = "UIEnter",
-- event = "VeryLazy",
},
})
end
''
);
plugins = {
snacks = {
enable = true;
settings = {
bigfile = {
enabled = true;
size = 1024 * 1024; # 1MB
setup.__raw = ''
function(ctx)
${lib.optionalString config.plugins.indent-blankline.enable ''require("ibl").setup_buffer(0, { enabled = false })''}
${lib.optionalString (lib.hasAttr "indentscope" config.plugins.mini.modules) ''vim.b.miniindentscope_disable = true''}
${lib.optionalString config.plugins.illuminate.enable ''require("illuminate").pause_buf()''}
-- Disable line numbers and relative line numbers
vim.cmd("setlocal nonumber norelativenumber")
-- Syntax highlighting
vim.schedule(function()
vim.bo[ctx.buf].syntax = ctx.ft
end)
-- Disable matchparen
vim.cmd("let g:loaded_matchparen = 1")
-- Disable cursor line and column
vim.cmd("setlocal nocursorline nocursorcolumn")
-- Disable folding
vim.cmd("setlocal nofoldenable")
-- Disable sign column
vim.cmd("setlocal signcolumn=no")
-- Disable swap file and undo file
vim.cmd("setlocal noswapfile noundofile")
-- Disable mini animate
vim.b.minianimate_disable = true
end
'';
};
gitbrowse.enabled = true;
gitui.enabled = true;
lazygit.enabled = true;
profiler.enabled = true;
};
};
};
keymaps = [
{
mode = "n";
key = "<leader>go";
action = "<cmd>lua Snacks.gitbrowse()<CR>";
options = {
desc = "Open file in browser";
};
}
{
mode = "n";
key = "<leader>gg";
action = "<cmd>lua Snacks.lazygit()<CR>";
options = {
desc = "Open lazygit";
};
}
{
mode = "n";
key = "<leader>gG";
action = "<cmd>lua Snacks.terminal({'gitui'})<CR>";
options = {
desc = "Open Gitui";
};
}
];
}

View File

@@ -0,0 +1,5 @@
{
plugins.wakatime = {
enable = true;
};
}