init
This commit is contained in:
commit
1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions
151
config/plugins/neorg.nix
Normal file
151
config/plugins/neorg.nix
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
helpers,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (helpers) mkRaw;
|
||||
in
|
||||
{
|
||||
# https://github.com/nvim-neorg/neorg
|
||||
# NOW neorg require lua-utils.nvim, nvim-nio, pathlib.vim
|
||||
# https://github.com/nix-community/nixvim/issues/1395#issuecomment-2267262919
|
||||
# Workaround
|
||||
# extraPlugins = [
|
||||
# (pkgs.vimUtils.buildVimPlugin {inherit (pkgs.luaPackages.lua-utils-nvim) pname version src;})
|
||||
#
|
||||
# (pkgs.vimUtils.buildVimPlugin {inherit (pkgs.luaPackages.pathlib-nvim) pname version src;})
|
||||
#
|
||||
# (pkgs.vimUtils.buildVimPlugin {inherit (pkgs.luaPackages.nvim-nio) pname version src;})
|
||||
# ];
|
||||
|
||||
plugins = {
|
||||
# https://haseebmajid.dev/posts/2024-04-21-til-how-to-fix-neorg-metadata-treesitter-issues-with-nixvim/
|
||||
# no need to use neorg-overlay inputs when also add these treesitter
|
||||
treesitter = {
|
||||
grammarPackages = with pkgs.tree-sitter-grammars; [
|
||||
tree-sitter-norg
|
||||
tree-sitter-norg-meta
|
||||
];
|
||||
};
|
||||
neorg = {
|
||||
enable = true;
|
||||
# package = pkgs-stable.vimPlugins.neorg;
|
||||
# package = pkgs.vimPlugins.neorg;
|
||||
# lazyLoading = true;
|
||||
settings.load = {
|
||||
"core.defaults" = helpers.emptyTable; # -- Loads default behaviour
|
||||
"core.summary" = helpers.emptyTable;
|
||||
"core.export" = helpers.emptyTable;
|
||||
"core.export.markdown" = helpers.emptyTable;
|
||||
"core.concealer" = {
|
||||
config = {
|
||||
folds = true;
|
||||
};
|
||||
}; # -- Adds pretty icons to your documents
|
||||
"core.dirman" = {
|
||||
config = {
|
||||
workspaces = {
|
||||
n = "~/neorg/notes";
|
||||
e = "~/neorg/english";
|
||||
l = "~/neorg/letter";
|
||||
g = "~/neorg/grammar";
|
||||
p = "~/neorg/perl";
|
||||
m = "~/neorg/misc";
|
||||
c = "~/neorg/nc";
|
||||
# nvim = "~/.config/nvim/NeorgNvimNotes";
|
||||
};
|
||||
default_workspace = "c";
|
||||
};
|
||||
};
|
||||
"core.keybinds" = {
|
||||
config = {
|
||||
default_keybinds = true;
|
||||
# # Raw lua
|
||||
# # https://github.com/nix-community/nixvim#raw-lua
|
||||
# hook = mkRaw ''
|
||||
# function(keybinds)
|
||||
# keybinds.unmap("norg", "i", "<M-CR>")
|
||||
# keybinds.remap_event("norg", "i", "<S-CR>", "core.itero.next-iteration", "<CR>")
|
||||
# end
|
||||
# '';
|
||||
};
|
||||
};
|
||||
# "core.latex.renderer" = helpers.emptyTable;
|
||||
"core.qol.toc" = {
|
||||
config = {
|
||||
close_after_use = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
autoCmd = [
|
||||
{
|
||||
pattern = [ "norg" ];
|
||||
event = [ "FileType" ];
|
||||
callback = mkRaw ''
|
||||
function()
|
||||
vim.opt.formatoptions:remove('r')
|
||||
vim.opt.formatoptions:remove('o')
|
||||
-- use this insteand: ['core.concealer'] = { config = { folds = false }, },
|
||||
vim.opt.foldlevelstart = 99
|
||||
|
||||
-- https://github.com/nvim-neorg/neorg/discussions/1066
|
||||
vim.opt.conceallevel = 2
|
||||
vim.keymap.set( 'n', '<leader>nT', function()
|
||||
if vim.opt.conceallevel:get() == 2 then
|
||||
vim.opt.conceallevel = 0
|
||||
elseif vim.opt.conceallevel:get() == 0 then
|
||||
vim.opt.conceallevel = 2
|
||||
end
|
||||
vim.cmd('Neorg toggle-concealer')
|
||||
end, { desc = '[neorg] toggle-concealer and conceallevel' })
|
||||
|
||||
|
||||
vim.keymap.set( 'n', '<leader>ng', function() vim.cmd.Neorg('generate-workspace-summary') end, { desc = '[neorg] generate-workspace-summary' })
|
||||
vim.keymap.set( 'n', '<leader>nt', function() vim.cmd.Neorg('toc') end, { desc = '[neorg] Table of Content' })
|
||||
vim.keymap.set( 'n', '<leader>nm', function() vim.cmd.Neorg('inject-metadata') end, { desc = '[neorg] Inject metadata' })
|
||||
vim.keymap.set( 'n', '<leader>nj', function() vim.api.nvim_feedkeys(':Neorg journal ', 'n', true) end, { desc = '[neorg] Neorg journal <fill>' })
|
||||
|
||||
vim.keymap.set( 'n', '<leader>tn', "<Plug>(neorg.qol.todo-items.todo.task-cycle)", { desc = "[neorg] Cycle Task" })
|
||||
|
||||
vim.keymap.set('i', "<S-CR>", "<Plug>(neorg.itero.next-iteration)", {} )
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
keymaps = [
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<leader>nw";
|
||||
action = mkRaw ''function() vim.api.nvim_feedkeys(':Neorg workspace ', 'n', true) end '';
|
||||
options.desc = "[neorg] Neorg workspace <fill>";
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<leader>nc";
|
||||
action = mkRaw ''function() vim.cmd('Neorg workspace c') end '';
|
||||
options.desc = "[neorg] Neorg workspace c";
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<leader>ni";
|
||||
action = mkRaw ''function() vim.cmd('Neorg index') end '';
|
||||
options.desc = "[neorg] Neorg index";
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<leader>nr";
|
||||
action = mkRaw ''function() vim.cmd('Neorg return') end '';
|
||||
options.desc = "[neorg] Neorg return";
|
||||
}
|
||||
{
|
||||
mode = [ "n" ];
|
||||
key = "<leader>ne";
|
||||
action = mkRaw ''function() vim.cmd('Neorg workspace e') end '';
|
||||
options.desc = "[neorg] Neorg workspace e (neorg-english)";
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue