From d3035d8dee816d377452d44daab83b8c039d53d5 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Thu, 1 Dec 2022 01:11:51 +0000 Subject: [PATCH] org mode --- vim/.vim/lua/lsp.lua | 1 + vim/.vim/lua/orgconfig.lua | 4 ++++ vim/.vim/lua/plugins.lua | 5 +++++ vim/.vim/lua/treesitter.lua | 12 ++++++------ vim/.vimrc | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 vim/.vim/lua/orgconfig.lua diff --git a/vim/.vim/lua/lsp.lua b/vim/.vim/lua/lsp.lua index 35c73d0..01cbf2f 100644 --- a/vim/.vim/lua/lsp.lua +++ b/vim/.vim/lua/lsp.lua @@ -99,6 +99,7 @@ cmp.setup({ sources = { { name = "nvim_lua" }, + { name = 'orgmode' }, { name = "nvim_lsp" }, { name = "path" }, { name = "vim_vsnip" }, diff --git a/vim/.vim/lua/orgconfig.lua b/vim/.vim/lua/orgconfig.lua new file mode 100644 index 0000000..193e4da --- /dev/null +++ b/vim/.vim/lua/orgconfig.lua @@ -0,0 +1,4 @@ +require('orgmode').setup({ + org_agenda_files = {'~/org/*'}, + org_default_notes_file = '~/org/refile.org', +}) diff --git a/vim/.vim/lua/plugins.lua b/vim/.vim/lua/plugins.lua index f844258..1fb29c2 100644 --- a/vim/.vim/lua/plugins.lua +++ b/vim/.vim/lua/plugins.lua @@ -21,6 +21,11 @@ require('packer').startup(function(use) use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + use { + 'nvim-orgmode/orgmode', + config = [[ require('orgconfig') ]] + } + -- Undo tree use { 'mbbill/undotree', diff --git a/vim/.vim/lua/treesitter.lua b/vim/.vim/lua/treesitter.lua index 96b5a1a..0b3098e 100644 --- a/vim/.vim/lua/treesitter.lua +++ b/vim/.vim/lua/treesitter.lua @@ -1,3 +1,6 @@ +-- Load custom treesitter grammar for org filetype +require('orgmode').setup_ts_grammar() + require('nvim-treesitter.configs').setup { -- A list of parser names, or "all" -- ensure_installed = { "c", "lua", "vim", "java", "kotlin"}, @@ -9,13 +12,10 @@ require('nvim-treesitter.configs').setup { highlight = { -- `false` will disable the whole extension enable = true, + -- Required for spellcheck, some LaTex highlights and + -- code block highlights that do not have ts grammar + additional_vim_regex_highlighting = {'org'}, disable = {"java"}, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, }, } diff --git a/vim/.vimrc b/vim/.vimrc index 7f94721..a0c73e5 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -8,6 +8,7 @@ set rtp+=~/.vim/after set directory=/tmp set undodir=/tmp set nobackup +set formatoptions+=j set nowritebackup au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")