diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 5e1bdf2..f3f4177 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', }, }, { @@ -155,6 +156,32 @@ require('lazy').setup({ vim.g.maplocalleader = ' ' end, }, + { + 'nvim-orgmode/orgmode', + dependencies = { + { 'nvim-treesitter/nvim-treesitter', lazy = true }, + }, + -- event = 'VeryLazy', -- doesn't work with existing comp and treesitter + 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, + }, }) ----------------------------------------------------------- @@ -205,6 +232,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." }) @@ -317,7 +345,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, { 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 @@ -336,11 +375,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, @@ -554,7 +596,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 {} @@ -632,6 +675,7 @@ cmp.setup { { name = 'path' }, { name = 'nvim_lua' }, { name = 'luasnip' }, + { name = 'orgmode' }, }, } -- cmdline completions