From ac00b911458bab65397e2e8468ab8cb27dadeeca Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 18 Oct 2023 15:01:55 +0900 Subject: [PATCH 1/3] new: nvim: adding orgmode plugin --- dotfiles/neovim/init.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index a6a46b1..c4fa5e5 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -130,6 +130,32 @@ require('lazy').setup({ 'folke/trouble.nvim', -- config = function }, + { + 'nvim-orgmode/orgmode', + dependencies = { + { 'nvim-treesitter/nvim-treesitter', lazy = true }, + }, + event = 'VeryLazy', + config = function() + -- Load treesitter grammer for orgmode + require('orgmode').setup_ts_grammar() + + -- Setup treesitter + require('nvim-treesitter.configs').setup({ + highlight = { + enable = true, + additional_vim_regex_highlighting = { 'org' }, + }, + ensure_installed = { 'org' }, + }) + + -- Setup orgmode + require('orgmode').setup({ + org_agenda_files = '~/orgfiles/**/*', + org_default_notes_file = '~/orgfiles/refile.org', + }) + end, + }, }) ----------------------------------------------------------- @@ -606,6 +632,7 @@ cmp.setup { { name = 'path' }, { name = 'nvim_lua' }, { name = 'luasnip' }, + { name = 'orgmode' }, }, } -- cmdline completions From ec5caca41a34f3584467de626235687bb7c8399f Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 18 Oct 2023 16:39:28 +0900 Subject: [PATCH 2/3] new: nvim: set space as leader --- dotfiles/neovim/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index c4fa5e5..478d58e 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -206,6 +206,7 @@ require('catppuccin').setup({ vim.cmd.colorscheme "catppuccin" ----------------------------------------------------------- +vim.g.mapleader = ' ' -- some terminalmode settings vim.keymap.set('t', 'h', 'h', { noremap = true, desc = "Exit terminal-mode and move to left window." }) From 025f48266a32e7e219f537c3220b477b14a83502 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 17 Nov 2023 17:06:56 +0900 Subject: [PATCH 3/3] fix: nvim: change event when orgmode is loaded --- dotfiles/neovim/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 8180992..d57a70a 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -92,6 +92,7 @@ require('lazy').setup({ 'hrsh7th/cmp-omni', -- source for omnifunc 'hrsh7th/cmp-nvim-lua', -- nvim lua 'hrsh7th/cmp-nvim-lsp-signature-help', + 'nvim-orgmode/orgmode', }, }, { @@ -135,7 +136,7 @@ require('lazy').setup({ dependencies = { { 'nvim-treesitter/nvim-treesitter', lazy = true }, }, - event = 'VeryLazy', + -- event = 'VeryLazy', -- doesn't work with existing comp and treesitter config = function() -- Load treesitter grammer for orgmode require('orgmode').setup_ts_grammar() @@ -338,11 +339,14 @@ parser_config.satysfi = { -- setup require 'nvim-treesitter.configs'.setup { ensure_installed = { - 'julia', - 'satysfi', + 'c', 'cpp', 'lua', 'julia', 'satysfi', }, + sync_install = false, + auto_install = true, -- requires tree-sitter cli in local + ignore_install = {}, highlight = { enable = true, + additional_vim_regex_highlighting = { 'org' }, }, incremental_selection = { enable = true,