diff --git a/home/sam/nvim/lua/sam/plugins/orgmode.lua b/home/sam/nvim/lua/sam/plugins/orgmode.lua new file mode 100644 index 0000000..ca0ead1 --- /dev/null +++ b/home/sam/nvim/lua/sam/plugins/orgmode.lua @@ -0,0 +1,36 @@ +return { + { + "nvim-orgmode/orgmode", + ft = { "org" }, + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + config = function() + -- Ensure *.org files are treated as "org" filetype + vim.filetype.add({ + extension = { + org = "org", + }, + }) + + -- Treesitter grammar for org (required for good highlighting) + local ok, parsers = pcall(require, "nvim-treesitter.parsers") + if ok then + local parser_config = parsers.get_parser_configs() + parser_config.org = { + install_info = { + url = "https://github.com/milisims/tree-sitter-org", + revision = "main", + files = { "src/parser.c", "src/scanner.c" }, + }, + filetype = "org", + } + end + + require("orgmode").setup({ + org_agenda_files = { "~/organizer/agenda/**/*", "~/organizer/*.org" }, + org_default_notes_file = "~/organizer/inbox.org", + }) + end, + }, +}