From eb77aa882343f079601d11aa7f224591004dc66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 18 Feb 2023 16:24:38 +0100 Subject: [PATCH] nvim: add orgmode --- modules/programs/nvim/default.nix | 1 + modules/programs/nvim/init.lua | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index db96e2f..c6a02ad 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -70,6 +70,7 @@ in nvim-treesitter.withAllGrammars nvim-ts-context-commentstring nvim-web-devicons # for dashboard-nvim + orgmode plenary-nvim # for telescope, neogit telescope-nvim which-key-nvim diff --git a/modules/programs/nvim/init.lua b/modules/programs/nvim/init.lua index c55e2f0..3326708 100644 --- a/modules/programs/nvim/init.lua +++ b/modules/programs/nvim/init.lua @@ -145,6 +145,7 @@ cmp.setup({ { name = "copilot", priority = 8 }, { name = "luasnip", priority = 7 }, { name = "nvim_lsp", priority = 9 }, + { name = "orgmode", priority = 9 }, }, }) @@ -393,3 +394,22 @@ require("copilot").setup({ panel = { enabled = false }, }) require("copilot_cmp").setup() + +local orgmode = require("orgmode") +-- Load custom treesitter grammar for org filetype +orgmode.setup_ts_grammar() +-- Treesitter configuration +require("nvim-treesitter.configs").setup({ + -- If TS highlights are not enabled at all, or disabled via `disable` prop, + -- highlighting will fallback to default Vim syntax highlighting + highlight = { + enable = true, + -- Required for spellcheck, some LaTex highlights and + -- code block highlights that do not have ts grammar + additional_vim_regex_highlighting = { "org" }, + }, +}) +orgmode.setup({ + org_agenda_files = { "~/Notes/org" }, + org_default_notes_file = "~/Notes/org/refile.org", +})