From f59c523e6f8d968235eb7a8fa8c7d9e592b3a563 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 17 Apr 2023 22:01:50 +0300 Subject: [PATCH] An attempt at setting up neorg --- dotfiles/neovim/lazy-lock.json | 2 + dotfiles/neovim/lua/my/plugins/neorg.lua | 54 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 dotfiles/neovim/lua/my/plugins/neorg.lua diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json index 9d8e751..cc15d15 100644 --- a/dotfiles/neovim/lazy-lock.json +++ b/dotfiles/neovim/lazy-lock.json @@ -37,6 +37,8 @@ "neoconf.nvim": { "branch": "main", "commit": "bc531ca41ba55d87416b4b3ade606ff81236389b" }, "neodev.nvim": { "branch": "main", "commit": "0a8e312923671e78499b2e204f0f678379ba92c1" }, "neogit": { "branch": "master", "commit": "039ff3212ec43cc4d3332956dfb54e263c8d5033" }, + "neorg": { "branch": "main", "commit": "1fecaab548161abd0238b3d16c81e69c7d14252a" }, + "neorg-telescope": { "branch": "main", "commit": "7d9f89375421401c41c3c270a2acad0b44ee0331" }, "nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" }, "null-ls.nvim": { "branch": "main", "commit": "13dd1fc13063681ca7e039436c88f6eca7e3e937" }, "nvim-autopairs": { "branch": "master", "commit": "e755f366721bc9e189ddecd39554559045ac0a18" }, diff --git a/dotfiles/neovim/lua/my/plugins/neorg.lua b/dotfiles/neovim/lua/my/plugins/neorg.lua new file mode 100644 index 0000000..10fa7dc --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/neorg.lua @@ -0,0 +1,54 @@ +local M = { + "nvim-neorg/neorg", + build = ":Neorg sync-parsers", + dependencies = { "nvim-lua/plenary.nvim", "nvim-neorg/neorg-telescope" }, + ft = "norg", + config = function() + require("neorg").setup({ + load = { + ["core.defaults"] = {}, -- Loads default behaviour + ["core.norg.concealer"] = {}, -- Adds pretty icons to your documents + ["core.integrations.telescope"] = {}, + -- {{{ Completions + ["core.norg.completion"] = { + config = { + engine = "nvim-cmp", + }, + }, + -- }}} + -- {{{ Dirman + ["core.norg.dirman"] = { -- Manages Neorg workspaces + config = { + workspaces = { + notes = "~/Neorg", + ["uni-notes"] = "~/Projects/uni-notes", + }, + }, + }, + -- }}} + -- {{{ Keybinds + ["core.keybinds"] = { + config = { + hook = function(keybinds) + -- Binds the `gtd` key in `norg` mode to execute `:echo 'Hello'` + keybinds.map("norg", "n", "gtd", "echo 'Hello!'") + end, + }, + }, + -- }}} + }, + }) + + -- {{{ Lazy cmp loading + vim.api.nvim_create_autocmd("InsertEnter", { + group = vim.api.nvim_create_augroup("CmpSourceNeorg", {}), + pattern = "*.norg", + callback = function() + require("cmp").setup.buffer({ sources = { { name = "neorg" } } }) + end, + }) + -- }}} + end, +} + +return M