From ac00b911458bab65397e2e8468ab8cb27dadeeca Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 18 Oct 2023 15:01:55 +0900 Subject: [PATCH 1/6] 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/6] 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 1fb014714a45dfd96c3577b342fa8e088f07cd35 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Wed, 15 Nov 2023 22:31:11 +0900 Subject: [PATCH 3/6] nvim: fix config of pwsh-es --- dotfiles/neovim/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 423037f..6a7b67e 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -529,7 +529,8 @@ lspconfig.bashls.setup { } -- pwsh lspconfig.powershell_es.setup { - bundle_path = '~/scoop/apps/powershell-editorservice/current/PowerShellEditorServices' + bundle_path = '~/scoop/apps/powershell-editorservice/current', + capabilities = capabilities, } -- -- jetls -- lspconfig.jetls.setup {} From 025f48266a32e7e219f537c3220b477b14a83502 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 17 Nov 2023 17:06:56 +0900 Subject: [PATCH 4/6] 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, From 4c426c808919188b343dc0f35320d86ccb033cb6 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sat, 2 Dec 2023 18:05:21 +0900 Subject: [PATCH 5/6] new: nvim: telescope keybindings --- dotfiles/neovim/init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index d57a70a..60b5f98 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -320,7 +320,18 @@ require('lualine_setup') ----------------------------------------------------------- -- telescope -vim.keymap.set('n', '', function() require('telescope.builtin').find_files { sort_lastused = true } end) -- fd? +local builtin = require('telescope.builtin') +vim.keymap.set('n', '', function() builtin.find_files { sort_lastused = true } end) -- fd? +vim.keymap.set('n', 'ff', function() builtin.find_files { sort_lastused = true } end) +vim.keymap.set('n', 'fw', builtin.lsp_workspace_symbols) +vim.keymap.set('n', 'fd', builtin.lsp_document_symbols) +vim.keymap.set('n', 'fb', builtin.buffers) +vim.keymap.set('n', 'fg', builtin.live_grep) +vim.keymap.set('n', 'fh', builtin.help_tags) +vim.keymap.set('n', 'fc', builtin.git_commits) +vim.keymap.set('n', 'fgc', builtin.git_commits) +vim.keymap.set('n', 'fs', builtin.git_status) +vim.keymap.set('n', 'fgs', builtin.git_status) ----------------------------------------------------------- -- Treesitter From cd6cc2b21ff481287d3114ca6fcd2ca994b4cb67 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Sun, 3 Dec 2023 16:24:23 +0900 Subject: [PATCH 6/6] nvim: update: add desc to telescope keymaps --- dotfiles/neovim/init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 60b5f98..c984b9f 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -322,16 +322,16 @@ require('lualine_setup') -- telescope local builtin = require('telescope.builtin') vim.keymap.set('n', '', function() builtin.find_files { sort_lastused = true } end) -- fd? -vim.keymap.set('n', 'ff', function() builtin.find_files { sort_lastused = true } end) -vim.keymap.set('n', 'fw', builtin.lsp_workspace_symbols) -vim.keymap.set('n', 'fd', builtin.lsp_document_symbols) -vim.keymap.set('n', 'fb', builtin.buffers) -vim.keymap.set('n', 'fg', builtin.live_grep) -vim.keymap.set('n', 'fh', builtin.help_tags) -vim.keymap.set('n', 'fc', builtin.git_commits) -vim.keymap.set('n', 'fgc', builtin.git_commits) -vim.keymap.set('n', 'fs', builtin.git_status) -vim.keymap.set('n', 'fgs', builtin.git_status) +vim.keymap.set('n', 'ff', function() builtin.find_files { sort_lastused = true } end, { desc = "find files"}) +vim.keymap.set('n', 'fw', builtin.lsp_workspace_symbols, { desc = "lsp workspace symbols" }) +vim.keymap.set('n', 'fd', builtin.lsp_document_symbols, { desc = "lsp document symbols" }) +vim.keymap.set('n', 'fb', builtin.buffers, { desc = "buffers" }) +vim.keymap.set('n', 'fg', builtin.live_grep, { desc = "grep" }) +vim.keymap.set('n', 'fh', builtin.help_tags, { desc = "help tags" }) +vim.keymap.set('n', 'fc', builtin.git_commits, { desc = "git commit" }) +vim.keymap.set('n', 'fgc', builtin.git_commits, { desc = "git commit" }) +vim.keymap.set('n', 'fs', builtin.git_status, { desc = "git status" }) +vim.keymap.set('n', 'fgs', builtin.git_status, { desc = "git status" }) ----------------------------------------------------------- -- Treesitter