Compare commits

..

7 commits

27 changed files with 281 additions and 95 deletions

2
.gitignore vendored
View file

@ -4,3 +4,5 @@
tmp/
.direnv/
.pre-commit-config.yaml
.aider*
.env

View 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;
};
}

View file

@ -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"; }
];
};

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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;
};
}

View 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" ];
};
}

View 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" ];
};
}

View 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" ]; }
];
};
}

View 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;
};
}

View file

@ -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;

View 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;
};
}

View 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;
};
};
}

View 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" ];
};
}

View 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;
};
}

View 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; }; };
};
};
};
};
}

View 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;
};
}

View file

@ -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" ];
}
];
};
}

View 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;
};
};
}

View file

@ -31,6 +31,10 @@ _:
action = "oldfiles";
options.desc = "Recent files";
};
"<leader>fc" = {
action = "commands";
options.desc = "Commands";
};
};
};
web-devicons.enable = true;

View 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";
};
};
}

View file

@ -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;
};
}

View 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;
};
}

View 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";
};
};
}

View 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;
};
}