feat(nvim): add telkasten.nvim

This commit is contained in:
Moritz Böhme 2023-07-15 12:29:13 +02:00
parent 35b2144c68
commit 8d528f9814
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
4 changed files with 60 additions and 1 deletions

View file

@ -966,7 +966,8 @@
"pre-commit-hooks": "pre-commit-hooks",
"rofi-wayland": "rofi-wayland",
"smartcolumn-nvim": "smartcolumn-nvim",
"stable": "stable"
"stable": "stable",
"telekasten-nvim": "telekasten-nvim"
}
},
"rust-overlay": {
@ -1041,6 +1042,22 @@
"type": "github"
}
},
"telekasten-nvim": {
"flake": false,
"locked": {
"lastModified": 1689074017,
"narHash": "sha256-yBw0Ja9xBhHcEdzvKvg6LCDzmIgW9kg0XaXS7hcr958=",
"owner": "renerocksai",
"repo": "telekasten.nvim",
"rev": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd",
"type": "github"
},
"original": {
"owner": "renerocksai",
"repo": "telekasten.nvim",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {

View file

@ -50,6 +50,9 @@
smartcolumn-nvim.flake = false;
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
telekasten-nvim.flake = false;
telekasten-nvim.url = "github:renerocksai/telekasten.nvim";
# Hyprland
hypr-contrib.url = "github:hyprwm/contrib";
hyprland.url = "github:hyprwm/Hyprland";

View file

@ -243,5 +243,38 @@ with builtins;
event = [ "BufReadPost" "BufNewFile" ];
conf = "require('Comment').setup()";
}
{
plugin = telekasten-nvim;
dependencies = [
{ plugin = telescope-nvim; }
];
cmd = [ "Telekasten" ];
keys = [
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; }
];
conf = ''
require("telekasten").setup({
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
auto_set_filetype = false,
auto_set_syntax = false,
image_subdir = "assets",
})
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = "*/zettelkasten/*",
callback = function(event)
vim.api.nvim_buf_set_keymap(0, "n", "<CR>", "", {
callback = function()
local current_word = vim.fn.expand("<cWORD>")
if vim.fn.match(current_word, "[[") == 0 then
require("telekasten").follow_link()
else
require("telekasten").toggle_todo()
end
end,
})
end,
})
'';
}
];
}

View file

@ -31,5 +31,11 @@ with lib.my;
version = mkVersionInput inputs.cmp-async-path;
src = inputs.cmp-async-path;
});
telekasten-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
pname = "telekasten-nvim";
version = mkVersionInput inputs.telekasten-nvim;
src = inputs.telekasten-nvim;
};
};
}