Compare commits
7 commits
57dabe199f
...
39a5189c0d
Author | SHA1 | Date | |
---|---|---|---|
39a5189c0d | |||
021a7dae5b | |||
bf7928d3cc | |||
d774279c50 | |||
d3ce1b22c4 | |||
8cde6f4ea7 | |||
0e4408a3fd |
27 changed files with 281 additions and 95 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@
|
|||
tmp/
|
||||
.direnv/
|
||||
.pre-commit-config.yaml
|
||||
.aider*
|
||||
.env
|
||||
|
|
10
modules/programs/nvim/new_plugins/comment.nix
Normal file
10
modules/programs/nvim/new_plugins/comment.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.comment.enable = true;
|
||||
};
|
||||
}
|
|
@ -66,7 +66,7 @@ in
|
|||
"conform.nvim"
|
||||
];
|
||||
keymaps = [
|
||||
{ key = "<leader>cf"; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; }
|
||||
{ key = "="; action.__raw = ''function() require("conform").format() end''; options.desc = "Format current file"; }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
10
modules/programs/nvim/new_plugins/crates-nvim.nix
Normal file
10
modules/programs/nvim/new_plugins/crates-nvim.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.crates-nvim.enable = true;
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/direnv.nix
Normal file
10
modules/programs/nvim/new_plugins/direnv.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.direnv.enable = true;
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/friendly-snippets.nix
Normal file
10
modules/programs/nvim/new_plugins/friendly-snippets.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.friendly-snippets.enable = true;
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/fugitive.nix
Normal file
10
modules/programs/nvim/new_plugins/fugitive.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.fugitive.enable = true;
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/gitsigns.nix
Normal file
10
modules/programs/nvim/new_plugins/gitsigns.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.gitsigns.enable = true;
|
||||
};
|
||||
}
|
11
modules/programs/nvim/new_plugins/helpview.nix
Normal file
11
modules/programs/nvim/new_plugins/helpview.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.helpview.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "helpview.nvim" ];
|
||||
};
|
||||
}
|
11
modules/programs/nvim/new_plugins/hmts.nix
Normal file
11
modules/programs/nvim/new_plugins/hmts.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.hmts.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "hmts.nvim" ];
|
||||
};
|
||||
}
|
15
modules/programs/nvim/new_plugins/keymaps.nix
Normal file
15
modules/programs/nvim/new_plugins/keymaps.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
keymaps = [
|
||||
{ key = "<esc>"; action = "<cmd>noh<cr><esc>"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; }
|
||||
{ key = "<"; action = "<gv"; options.desc = "Shift left"; mode = [ "v" ]; }
|
||||
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; }
|
||||
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; }
|
||||
];
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/lastplace.nix
Normal file
10
modules/programs/nvim/new_plugins/lastplace.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.lastplace.enable = true;
|
||||
};
|
||||
}
|
|
@ -16,9 +16,9 @@ in
|
|||
keymapsOnEvents = {
|
||||
LspAttach = [
|
||||
{
|
||||
key = "<leader>cc";
|
||||
key = "<leader>q";
|
||||
action = "<cmd>Lspsaga code_action<cr>";
|
||||
options.desc = "Code Action";
|
||||
options.desc = "Quickfix";
|
||||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ in
|
|||
options.buffer = true;
|
||||
}
|
||||
{
|
||||
key = "<leader>cr";
|
||||
key = "<leader>r";
|
||||
action = "<cmd>Lspsaga rename<cr>";
|
||||
options.desc = "Rename";
|
||||
options.buffer = true;
|
||||
|
|
10
modules/programs/nvim/new_plugins/markdown-preview.nix
Normal file
10
modules/programs/nvim/new_plugins/markdown-preview.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.markdown-preview.enable = true;
|
||||
};
|
||||
}
|
13
modules/programs/nvim/new_plugins/marks.nix
Normal file
13
modules/programs/nvim/new_plugins/marks.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.marks = {
|
||||
enable = true;
|
||||
defaultMappings = false;
|
||||
};
|
||||
};
|
||||
}
|
16
modules/programs/nvim/new_plugins/mini.nix
Normal file
16
modules/programs/nvim/new_plugins/mini.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
align = { };
|
||||
};
|
||||
};
|
||||
performance.combinePlugins.standalonePlugins = [ "mini.nvim" ];
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/nvim-autopairs.nix
Normal file
10
modules/programs/nvim/new_plugins/nvim-autopairs.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.nvim-autopairs.enable = true;
|
||||
};
|
||||
}
|
36
modules/programs/nvim/new_plugins/obsidian.nix
Normal file
36
modules/programs/nvim/new_plugins/obsidian.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
_:
|
||||
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.obsidian = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ui.enable = false;
|
||||
dir = "~/Documents/Nextcloud/Notes/zettelkasten/";
|
||||
note_id_func.__raw = ''
|
||||
function(title)
|
||||
if title ~= nil then
|
||||
return title
|
||||
else
|
||||
suffix = ""
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
return tostring(os.date("%Y-%m-%d")) .. "-" .. suffix
|
||||
end
|
||||
end
|
||||
'';
|
||||
mappings = {
|
||||
"<localleader>n" = { action.__raw = ''function() return vim.cmd("ObsidianNew") end''; opts.desc = "New Note"; opts.buffer = true; };
|
||||
"<localleader>q" = { action.__raw = ''function() return vim.cmd("ObsidianQuickSwitch") end''; opts.desc = "Quick Switch"; opts.buffer = true; };
|
||||
"<localleader>b" = { action.__raw = ''function() return vim.cmd("ObsidianBacklinks") end''; opts.desc = "Backlinks"; opts.buffer = true; };
|
||||
"<localleader>l" = { action.__raw = ''function() return vim.cmd("ObsidianLink") end''; opts.desc = "Link"; opts.buffer = true; };
|
||||
"<localleader>e" = { action.__raw = ''function() return vim.cmd("ObsidianExtractNote") end''; opts.desc = "Extract Note"; opts.buffer = true; };
|
||||
"<localleader>r" = { action.__raw = ''function() return vim.cmd("ObsidianRename") end''; opts.desc = "Rename"; opts.buffer = true; };
|
||||
"<cr>" = { action.__raw = ''function() return require("obsidian").util.smart_action() end''; opts.buffer = true; opts.expr = true; };
|
||||
"gf" = { action.__raw = ''function() return require("obsidian").util.gf_passthrough() end''; opts = { noremap = false; expr = true; buffer = true; }; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/oil.nix
Normal file
10
modules/programs/nvim/new_plugins/oil.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.oil.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz = {
|
||||
programs.nixvim = lib.mkMerge [
|
||||
{ plugins.which-key.enable = true; }
|
||||
{ plugins.lastplace.enable = true; }
|
||||
{ plugins.comment.enable = true; }
|
||||
{ plugins.ts-context-commentstring.enable = true; }
|
||||
{
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
settings.view_method = "zathura";
|
||||
};
|
||||
}
|
||||
{
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
keymaps.todoTelescope.key = "<leader>fc";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
keymaps = [
|
||||
{ key = "<esc>"; action = "<cmd>noh<cr><esc>"; options.desc = "Escape and clear hlsearch"; mode = [ "i" "n" ]; }
|
||||
{ key = "<"; action = "<gv"; options.desc = "Shift left"; mode = [ "v" ]; }
|
||||
{ key = ">"; action = ">gv"; options.desc = "Shift right"; mode = [ "v" ]; }
|
||||
{ key = "y"; action = "ygv<esc>"; options.desc = "Yank"; mode = [ "v" ]; }
|
||||
];
|
||||
}
|
||||
{ plugins.oil.enable = true; }
|
||||
{ plugins.nvim-autopairs.enable = true; }
|
||||
{ plugins.vim-surround.enable = true; }
|
||||
|
||||
# TODO: add linters
|
||||
# {
|
||||
# plugins.lint.enable = true;
|
||||
# plugins.lint.lintersByFt = { };
|
||||
# }
|
||||
|
||||
{
|
||||
plugins.marks.enable = true;
|
||||
plugins.marks.defaultMappings = false;
|
||||
}
|
||||
{
|
||||
plugins.hmts.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "hmts.nvim" ];
|
||||
}
|
||||
{ plugins.gitsigns.enable = true; }
|
||||
{ plugins.fugitive.enable = true; }
|
||||
{ plugins.friendly-snippets.enable = true; }
|
||||
{ plugins.direnv.enable = true; }
|
||||
{ plugins.crates-nvim.enable = true; }
|
||||
{
|
||||
plugins.helpview.enable = true;
|
||||
performance.combinePlugins.standalonePlugins = [ "helpview.nvim" ];
|
||||
}
|
||||
{
|
||||
plugins.obsidian.enable = true;
|
||||
plugins.obsidian.settings = {
|
||||
dir = "~/Documents/Nextcloud/Notes/zettelkasten/";
|
||||
note_id_func.__raw = ''
|
||||
function(title)
|
||||
if title ~= nil then
|
||||
return title
|
||||
else
|
||||
suffix = ""
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
return tostring(os.date("%Y-%m-%d")) .. "-" .. suffix
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
||||
{
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
modules = {
|
||||
align = { };
|
||||
};
|
||||
};
|
||||
performance.combinePlugins.standalonePlugins = [ "mini.nvim" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
13
modules/programs/nvim/new_plugins/render-markdown.nix
Normal file
13
modules/programs/nvim/new_plugins/render-markdown.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.render-markdown = {
|
||||
enable = true;
|
||||
settings.latex.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -31,6 +31,10 @@ _:
|
|||
action = "oldfiles";
|
||||
options.desc = "Recent files";
|
||||
};
|
||||
"<leader>fc" = {
|
||||
action = "commands";
|
||||
options.desc = "Commands";
|
||||
};
|
||||
};
|
||||
};
|
||||
web-devicons.enable = true;
|
||||
|
|
13
modules/programs/nvim/new_plugins/todo-comments.nix
Normal file
13
modules/programs/nvim/new_plugins/todo-comments.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
keymaps.todoTelescope.key = "<leader>ft";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.ts-context-commentstring.enable = true;
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/vim-surround.nix
Normal file
10
modules/programs/nvim/new_plugins/vim-surround.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.vim-surround.enable = true;
|
||||
};
|
||||
}
|
13
modules/programs/nvim/new_plugins/vimtex.nix
Normal file
13
modules/programs/nvim/new_plugins/vimtex.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.vimtex = {
|
||||
enable = true;
|
||||
settings.view_method = "zathura";
|
||||
};
|
||||
};
|
||||
}
|
10
modules/programs/nvim/new_plugins/which-key.nix
Normal file
10
modules/programs/nvim/new_plugins/which-key.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf readFile;
|
||||
in
|
||||
{
|
||||
home-manager.users.moritz.programs.nixvim = {
|
||||
plugins.which-key.enable = true;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue