install initial nixvim
This commit is contained in:
2026-04-08 10:13:11 +02:00
parent 6f64253c4b
commit d7b58e2216
64 changed files with 592 additions and 286 deletions

View File

@@ -0,0 +1,21 @@
{ inputs, pkgs, ... }:
{
imports = [
./plugins
];
programs.nixvim = {
extraPackages = with pkgs; [
texliveFull
texlivePackages.standalone
texlivePackages.relsize # needed for BA
# papis-nvim
];
extraConfigVim = ''
filetype plugin on
set nocompatible
syntax on
'';
};
}

View File

@@ -0,0 +1,54 @@
{
imports = [
./aerial.nix
./autopairs.nix
./barbar.nix
./bullets.nix
./cmp.nix
./comment-box.nix
./comment.nix
./conform.nix
./dap.nix
./diffview.nix
./dynomark.nix
./edgy.nix
./gitsigns.nix
./haskell-tools.nix
./knap.nix
./leap.nix
./lsp.nix
./ltex-extra.nix
./lualine.nix
./markdown-preview.nix
./mkdnflow.nix
./neoscroll.nix
./neotree.nix
./noice.nix
./notify.nix
./oil.nix
./openscad.nix
./otter.nix
./papis.nix
./peek.nix
./markdown-preview.nix
./smart-splits.nix
./snippets.nix
./sniprun.nix
./startup.nix
./surround.nix
./telescope.nix
./texpresso.nix
./todo-comments.nix
./toggleterm.nix
./treesitter.nix
./trouble.nix
./typst-preview.nix
./typst-vim.nix
./undotree.nix
./vimtex.nix
./web-devicons.nix
./which-key.nix
./yanky.nix
./zk.nix
];
}

View File

@@ -0,0 +1,29 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ python312Packages.pylatexenc ];
programs.nixvim.plugins = {
render-markdown = {
enable = true;
settings = {
ft = [
"markdown"
"quarto"
];
latex = {
enabled = false;
};
completions = {
lsp = {
enabled = true;
};
};
};
};
web-devicons = {
enable = true;
};
};
}

View File

@@ -0,0 +1,40 @@
{ ... }:
{
programs.nixvim = {
plugins = {
vimtex = {
enable = true;
settings = {
view_automatic = false;
mappings_disable = {
"n" = [ "K" ];
};
};
};
};
autoGroups = {
"lazyvim_vimtex_conceal" = {
clear = true;
};
};
autoCmd = [
{
event = [ "FileType" ];
group = "lazyvim_vimtex_conceal";
pattern = [
"bib"
"tex"
];
callback.__raw = # lua
''
function ()
vim.wo.conceallevel = 2
end
'';
}
];
};
}

View File

@@ -1,4 +1,4 @@
{ inputs, pkgs, ... }:
{ pkgs, inputs, ... }:
{
imports = [
@@ -6,38 +6,38 @@
./plugins
];
home.sessionVariables = {
EDITOR = "nvim";
};
home.sessionVariables.EDITOR = "nvim";
programs.nixvim = {
enable = true;
defaultEditor = true;
nixpkgs.useGlobalPackages = false;
clipboard = {
providers = {
wl-copy.enable = true;
};
};
viAlias = true;
vimAlias = true;
lualoader.enable = true;
extraPackages = with pkgs; [
extraPackages = with pkgs; [ # TODO:
texliveFull
texlivePackages.standalone
texlivePackages.relsize # needed for BA
# papis-nvim
];
extraConfigVim = ''
filetype plugin on
set nocompatible
syntax on
'';
nixpkgs.useGlobalPackages = false;
clipboard.providers.wl-copy.enable = true;
keymaps = [
{
key = "Y";
action = ''"+y'';
options.silent = true;
}
{
key = "P";
action = ''"+p'';
options.silent = true;
}
];
viAlias = true;
vimAlias = true;
lualoader.enable = true;
globals = {
mapleader = " ";

View File

@@ -0,0 +1,8 @@
{ ... }:
{
programs.nixvim.plugins.vim-css-color = {
enable = true;
lazyLoad.settings.filetypes = [ "css" ];
};
}

View File

@@ -1,54 +1,21 @@
{
imports = [
./aerial.nix
./autopairs.nix
./barbar.nix
./bullets.nix
./cmp.nix
./comment-box.nix
./comment.nix
./conform.nix
./dap.nix
./diffview.nix
./dynomark.nix
./edgy.nix
./gitsigns.nix
./haskell-tools.nix
./knap.nix
./leap.nix
./lsp.nix
./ltex-extra.nix
./lualine.nix
./markdown-preview.nix
./mkdnflow.nix
./neoscroll.nix
./neotree.nix
./noice.nix
./notify.nix
./oil.nix
./openscad.nix
./otter.nix
./papis.nix
./peek.nix
./markdown-preview.nix
./smart-splits.nix
./snippets.nix
./sniprun.nix
./startup.nix
./surround.nix
./telescope.nix
./texpresso.nix
./todo-comments.nix
./css-color.nix
./img-clip.nix
./lz-n.nix
./rainbow.nix
./render-markdown.nix
./rustaceanvim.nix
./toggleterm.nix
./treesitter.nix
./trouble.nix
./typst-preview.nix
./typst-vim.nix
./undotree.nix
./vimtex.nix
./unified.nix
./web-devicons.nix
./which-key.nix
./yanky.nix
./zk.nix
./wilder.nix
./yazi.nix
./yuck.nix
./vimtex.nix
];
}

View File

@@ -1,12 +0,0 @@
{ pkgs, ... }:
{
programs.nixvim = {
plugins = {
diffview = {
enable = true;
};
};
};
}

View File

@@ -0,0 +1,22 @@
{ ... }:
{
programs.nixvim = {
plugins.img-clip = {
enable = true;
lazyLoad.settings.filetypes = [
"md"
"tex"
"typ"
];
};
keymaps = [
{
key = "<leader>p";
action = "<cmd>PasteImage<cr>";
options.desc = "Paste image";
}
];
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
programs.nixvim.plugins.lz-n = {
enable = true;
};
}

View File

@@ -1,12 +0,0 @@
{ ... }:
{
programs.nixvim.plugins = {
peek = {
enable = true;
settings = {
app = "firefox";
};
};
};
}

View File

@@ -0,0 +1,100 @@
{ pkgs, ... }:
{
programs.nixvim = {
plugins = {
rainbow = {
enable = true;
lazyLoad.settings.event = [
"BufReadPost"
"BufNewFile"
];
settings = {
active = 1;
conf = {
guifgs = [
"#f5c2e7"
"#eba0ac"
"#a6e3a1"
"#74c7ec"
"#f5e0dc"
"#cba6f7"
"#fab387"
"#94e2d5"
"#89b4fa"
"#f2cdcd"
"#f38ba8"
"#f9e2af"
"#89dceb"
"#b4befe"
];
operators = "_,_";
parentheses = [
"start=/(/ end=/)/ fold"
"start=/{/ end=/}/ fold"
"start=/\\[/ end=/\\]/ fold"
"start=/\\begin/ end=/\\end/ fold"
];
separately = {
"*" = {
parentheses = [
"start=/(/ end=/)/ fold"
"start=/{/ end=/}/ fold"
"start=/\\[/ end=/\\]/ fold"
];
};
css = 0;
haskell = {
parentheses = [
"start=/(/ end=/)/ fold"
"start=/\[/ end=/\]/ fold"
"start=/\v\{\ze[^-]/ end=/}/ fold"
];
};
lisp = {
guifgs = [
"#f5c2e7"
"#eba0ac"
"#a6e3a1"
"#74c7ec"
"#f5e0dc"
"#cba6f7"
"#fab387"
"#94e2d5"
"#89b4fa"
"#f2cdcd"
"#f38ba8"
"#f9e2af"
"#89dceb"
"#b4befe"
];
};
markdown = {
parentheses_options = "containedin=markdownCode contained";
};
nerdtree = 0;
perl = {
syn_name_prefix = "perlBlockFoldRainbow";
};
stylus = {
parentheses = [ "start=/{/ end=/}/ fold contains=@colorableGroup" ];
};
tex = {
parentheses = [
"start=/(/ end=/)/ fold"
"start=/{/ end=/}/ fold"
"start=/\\[/ end=/\\]/ fold"
"start=/\\begin/ end=/\\end/ fold"
];
};
vim = {
parentheses_options = "containedin=vimFuncBody";
};
};
};
};
};
};
};
}

View File

@@ -3,27 +3,37 @@
{
home.packages = with pkgs; [ python312Packages.pylatexenc ];
programs.nixvim.plugins = {
render-markdown = {
enable = true;
settings = {
ft = [
"markdown"
"quarto"
];
latex = {
enabled = false;
};
completions = {
lsp = {
enabled = true;
};
programs.nixvim = {
plugins = {
render-markdown = {
enable = true;
lazyLoad.settings.filetypes = [ "md" ];
settings = {
ft = [ "markdown" ];
latex.enabled = false;
completions.lsp.enabled = true;
};
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>m";
group = "Markdown";
icon = " ";
}
];
};
web-devicons = {
enable = true;
};
keymaps = [
{
action = "<CMD>RenderMarkdown toggle<CR>";
key = "<leader>mp";
mode = "n";
options = {
desc = "Toggle markdown preview";
};
}
];
};
}

View File

@@ -0,0 +1,52 @@
{ pkgs, ... }:
{
programs.nixvim = {
extraPackages = with pkgs; [ rust-analyzer ];
plugins = {
rustaceanvim = {
enable = true;
lazyload.settings.filetype = "rs";
};
};
files = {
"ftplugin/rust.lua" = {
keymaps = [
{
action.__raw = ''
function()
vim.cmd.RustAnalyzer('codeAction')
end
'';
key = "<leader>a";
mode = [
"n"
];
options = {
desc = "Code action";
silent = true;
buffer.__raw = "vim.api.nvim_get_current_buf()";
};
}
{
action.__raw = ''
function()
vim.cmd.RustAnalyzer({'hover', 'actions'})
end
'';
key = "K";
mode = [
"n"
];
options = {
silent = true;
buffer.__raw = "vim.api.nvim_get_current_buf()";
};
}
];
};
};
};
}

View File

@@ -5,18 +5,32 @@
plugins = {
toggleterm = {
enable = true;
lazyLoad.settings.cmd = [
"ToggleTermSendCurrentLine"
"ToggleTermSendVisualLines"
"ToggleTermSendVisualSelection"
];
settings = {
open_mapping.__raw = "[[<c-,>]]";
insert_mappings = true;
shade_terminals = false;
};
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>c";
group = "Terminal";
icon = " ";
}
];
};
keymaps = [
{
action = "<CMD>ToggleTermSendCurrentLine<CR>";
key = "<leader>sts";
key = "<leader>cl";
mode = "n";
options = {
desc = "Send Current Line";
@@ -24,7 +38,7 @@
}
{
action = "<CMD>ToggleTermSendVisualLines<CR>";
key = "<leader>stv";
key = "<leader>cv";
mode = "x";
options = {
desc = "Send all the (whole) lines in selection";
@@ -32,7 +46,7 @@
}
{
action = "<CMD>ToggleTermSendVisualSelection<CR>";
key = "<leader>sts";
key = "<leader>cs";
mode = "x";
options = {
desc = "Send selection";

View File

@@ -5,6 +5,8 @@
plugins = {
trouble = {
enable = true;
lazyLoad.settings.cmd = "Trouble";
settings = {
modes = {
diagnostics = {

View File

@@ -5,7 +5,38 @@
plugins = {
undotree = {
enable = true;
lazyLoad.settings.cmd = "UndotreeShow";
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>t";
group = "Undotree";
icon = " ";
}
];
};
keymaps = [
{
key = "<leader>th";
action = "<cmd>UndotreeHide<cr>";
options.desc = "Hide undotree";
}
{
key = "<leader>tf";
action = "<cmd>UndotreeFocus<cr>";
options.desc = "Focus undotree";
}
{
key = "<leader>tp";
action = "<cmd>UndotreePersistUndo<cr>";
options.desc = "Persist undo";
}
{
key = "<leader>ts";
action = "<cmd>UndotreeShow<cr>";
options.desc = "Show undotree";
}
];
};
}

View File

@@ -0,0 +1,32 @@
{ ... }:
{
programs.nixvim = {
plugins = {
unified = {
enable = true;
lazyLoad.settings.cmd = "Unified";
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>u";
group = "Unified";
icon = " ";
}
];
};
keymaps = [
{
key = "<leader>us";
action = "<cmd>Unified<cr>";
options.desc = "Start Unified";
}
{
key = "<leader>uq";
action = "<cmd>Unified reset<cr><cmd>Unified reset<cr>";
options.desc = "Stop Unified";
}
];
};
}

View File

@@ -1,9 +1,11 @@
{ ... }:
{
programs.nixvim = {
plugins = {
web-devicons.enable = true;
};
programs.nixvim.plugins.web-devicons = {
enable = true;
lazyLoad.settings.event = [
"BufReadPost"
"BufNewFile"
];
};
}

View File

@@ -1,9 +1,11 @@
{ ... }:
{
programs.nixvim.plugins = {
which-key = {
enable = true;
};
programs.nixvim.plugins.which-key = {
enable = true;
lazyLoad.settings.event = [
"BufReadPost"
"BufNewFile"
];
};
}

View File

@@ -0,0 +1,51 @@
{ ... }:
{
programs.nixvim.plugins.wilder = {
enable = true;
lazyLoad.settings.event = [
"BufReadPost"
"BufNewFile"
];
settings.modes = [
":"
"/"
"?"
];
# Configure the wilder engine
options = {
pipeline.__raw = ''
wilder.branch(
wilder.cmdline_pipeline({
fuzzy = 1,
set_device = 1,
}),
wilder.vim_search_pipeline()
)
'';
renderer.__raw = ''
wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
highlighter = wilder.basic_highlighter(),
highlights = {
accent = "WilderAccent",
},
border = "rounded",
left = { " ", wilder.popupmenu_devicons() },
right = { " ", wilder.popupmenu_scrollbar() },
})
)
'';
};
};
# Define the custom highlight group for the accent color
programs.nixvim.highlight = {
WilderAccent = {
fg = "#f5c2e7";
bold = true;
};
};
}

View File

@@ -1,69 +0,0 @@
{ ... }:
{
programs.nixvim = {
plugins = {
yanky = {
enable = true;
settings = {
ring = {
storage = "sqlite";
};
};
};
sqlite-lua = {
enable = true;
};
};
keymaps = [
{
key = "p";
action = "<Plug>(YankyPutAfter)";
mode = [
"n"
"x"
];
}
{
key = "P";
action = "<Plug>(YankyPutBefore)";
mode = [
"n"
"x"
];
}
{
key = "gp";
action = "<Plug>(YankyGPutAfter)";
mode = [
"n"
"x"
];
}
{
key = "gP";
action = "<Plug>(YankyGPutBefore)";
mode = [
"n"
"x"
];
}
{
key = "<c-p>";
action = "<Plug>(YankyPreviousEntry)";
mode = [
"n"
];
}
{
key = "<c-n>";
action = "<Plug>(YankyNextEntry)";
mode = [
"n"
];
}
];
};
}

View File

@@ -0,0 +1,40 @@
{ ... }:
{
programs.nixvim = {
plugins = {
yazi = {
enable = true;
lazyLoad.settings.event = [
"BufReadPost"
"BufNewFile"
];
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>y";
group = "Yazi";
icon = " ";
}
];
};
keymaps = [
{
key = "<leader>yf";
action = "<cmd>Yazi<cr>";
options.desc = "Open yazi at the current file";
}
{
key = "<leader>yw";
action = "<cmd>Yazi cwd<cr>";
options.desc = "Open yazi at the current working directory";
}
{
key = "<leader>yl";
action = "<cmd>Yazi toggle<cr>";
options.desc = "Resume the last session";
}
];
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim.plugins.yuck = {
enable = true;
lazyLoad.settings.filetypes = [
"yuck"
];
};
}

View File

@@ -1,95 +0,0 @@
{ ... }:
{
programs.nixvim = {
plugins = {
zk = {
enable = true;
settings = {
picker = "telescope";
};
};
which-key.settings.spec = [
{
__unkeyed-1 = "<leader>z";
group = "Zettelkasten";
icon = "󰝰 ";
}
];
};
keymaps = [
{
key = "<leader>zn";
action = "<Cmd>ZkNew { title = vim.fn.input('Title: ') }<CR>";
mode = [ "n" ];
options = {
desc = "Create";
};
}
{
key = "<leader>zo";
action = "<Cmd>ZkNotes { sort = { 'modified' } }<CR>";
mode = [ "n" ];
options = {
desc = "Open";
};
}
{
key = "<leader>zt";
action = "<Cmd>ZkTags<CR>";
mode = [ "n" ];
options = {
desc = "Open Tags";
};
}
{
key = "<leader>zf";
action = "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>";
mode = [ "n" ];
options = {
desc = "Search";
};
}
{
key = "<leader>zf";
action = ":'<,'>ZkMatch<CR>";
mode = [ "v" ];
options = {
desc = "Search (Matching the Selection)";
};
}
];
files = {
# TODO: Add descriptions
# TODO: Did the sytnax change?
"ftplugin/markdown.lua" = {
extraConfigLua = # lua
''
-- Add the key mappings only for Markdown files in a zk notebook.
if require("zk.util").notebook_root(vim.fn.expand('%:p')) ~= nil then
local function map(...) vim.api.nvim_buf_set_keymap(0, ...) end
local opts = { noremap=true, silent=false }
-- Create a new note after asking for its title.
-- This overrides the global `<leader>zn` mapping to create the note in the same directory as the current buffer.
map("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
-- Create a new note in the same directory as the current buffer, using the current selection for title.
map("v", "<leader>znt", ":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }<CR>", opts)
-- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title.
map("v", "<leader>znc", ":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
-- Open notes linking to the current buffer.
map("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", opts)
-- Open notes linked by the current buffer.
map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts)
-- Preview a linked note.
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
-- Open the code actions for a visual selection.
map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts)
end
'';
};
};
};
}