diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua index 0f044c5..19227d9 100644 --- a/lua/plugins/blink.lua +++ b/lua/plugins/blink.lua @@ -1,124 +1,125 @@ return { - 'saghen/blink.cmp', - -- optional: provides snippets for the snippet source - dependencies = { 'rafamadriz/friendly-snippets', "onsails/lspkind.nvim", "xzbdmw/colorful-menu.nvim", "nvim-tree/nvim-web-devicons"}, + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = { 'rafamadriz/friendly-snippets', "onsails/lspkind.nvim", "xzbdmw/colorful-menu.nvim", "nvim-tree/nvim-web-devicons" }, - -- use a release tag to download pre-built binaries - version = "v1.10.2", - -- AND/OR build from source - -- build = 'cargo build --release', - -- If you use nix, you can build from source with: - -- build = 'nix run .#build-plugin', + -- use a release tag to download pre-built binaries + version = "v1.10.2", + -- AND/OR build from source + -- build = 'cargo build --release', + -- If you use nix, you can build from source with: + -- build = 'nix run .#build-plugin', - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) - -- 'super-tab' for mappings similar to vscode (tab to accept) - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- All presets have the following mappings: - -- C-space: Open menu or open docs if already open - -- C-n/C-p or Up/Down: Select next/previous item - -- C-e: Hide menu - -- C-k: Toggle signature help (if signature.enabled = true) - -- - -- See :h blink-cmp-config-keymap for defining your own keymap + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap -- in your blink configuration - keymap = { - preset = 'none', + keymap = { + preset = 'none', - -- If completion hasn't been triggered yet, insert the first suggestion; if it has, cycle to the next suggestion. - [''] = { 'show', 'show_documentation', 'hide_documentation' }, - [''] = { 'hide', 'fallback' }, + -- If completion hasn't been triggered yet, insert the first suggestion; if it has, cycle to the next suggestion. + [''] = { 'show', 'show_documentation', 'hide_documentation' }, + [''] = { 'hide', 'fallback' }, - [""] = { "select_next", "snippet_forward", "fallback" }, - [""] = { "select_prev", "snippet_backward", "fallback" }, + [""] = { "select_next", "snippet_forward", "fallback" }, + [""] = { "select_prev", "snippet_backward", "fallback" }, - -- Selection with Enter - [""] = { "accept", "fallback" }, + -- Selection with Enter + [""] = { "accept", "fallback" }, - [''] = { 'select_prev', 'fallback' }, - [''] = { 'select_next', 'fallback' }, - [''] = { 'select_prev', 'fallback_to_mappings' }, - [''] = { 'select_next', 'fallback_to_mappings' }, + [''] = { 'select_prev', 'fallback' }, + [''] = { 'select_next', 'fallback' }, + [''] = { 'select_prev', 'fallback_to_mappings' }, + [''] = { 'select_next', 'fallback_to_mappings' }, - [''] = { 'scroll_documentation_up', 'fallback' }, - [''] = { 'scroll_documentation_down', 'fallback' }, + [''] = { 'scroll_documentation_up', 'fallback' }, + [''] = { 'scroll_documentation_down', 'fallback' }, - [''] = { 'show_signature', 'hide_signature', 'fallback' }, - }, - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono' - }, - - -- (Default) Only show the documentation popup when manually triggered - completion = { - ghost_text = { - enabled = true + [''] = { 'show_signature', 'hide_signature', 'fallback' }, }, - accept = { - create_undo_point = true, - auto_brackets = { - enabled = true, - kind_resolution = { - enabled = true, - }, - semantic_token_resolution = { + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { + ghost_text = { + enabled = true + }, + accept = { + create_undo_point = true, + auto_brackets = { enabled = true, + kind_resolution = { + enabled = true, + }, + semantic_token_resolution = { + enabled = true, + }, }, }, - }, - menu = { - direction_priority = function() - local ctx = require('blink.cmp').get_context() - local item = require('blink.cmp').get_selected_item() - if ctx == nil or item == nil then return { 's', 'n' } end + menu = { + direction_priority = function() + local ctx = require('blink.cmp').get_context() + local item = require('blink.cmp').get_selected_item() + if ctx == nil or item == nil then return { 's', 'n' } end - local item_text = item.textEdit ~= nil and item.textEdit.newText or item.insertText or item.label - local is_multi_line = item_text:find('\n') ~= nil + local item_text = item.textEdit ~= nil and item.textEdit.newText or item.insertText or item.label + local is_multi_line = item_text:find('\n') ~= nil - -- after showing the menu upwards, we want to maintain that direction - -- until we re-open the menu, so store the context id in a global variable - if is_multi_line or vim.g.blink_cmp_upwards_ctx_id == ctx.id then - vim.g.blink_cmp_upwards_ctx_id = ctx.id - return { 'n', 's' } - end - return { 's', 'n' } - end, - columns = { { "kind_icon" }, { "label", gap = 1 } }, - components = { + -- after showing the menu upwards, we want to maintain that direction + -- until we re-open the menu, so store the context id in a global variable + if is_multi_line or vim.g.blink_cmp_upwards_ctx_id == ctx.id then + vim.g.blink_cmp_upwards_ctx_id = ctx.id + return { 'n', 's' } + end + return { 's', 'n' } + end, + draw = { + columns = { { "kind_icon" }, { "label", gap = 1 } }, + components = { kind_icon = { text = function(ctx) - local icon = ctx.kind_icon - if vim.tbl_contains({ "Path" }, ctx.source_name) then - local dev_icon, _ = require("nvim-web-devicons").get_icon(ctx.label) - if dev_icon then - icon = dev_icon - end - else - icon = require("lspkind").symbol_map[ctx.kind] or "" - end + local icon = ctx.kind_icon + if vim.tbl_contains({ "Path" }, ctx.source_name) then + local dev_icon, _ = require("nvim-web-devicons").get_icon(ctx.label) + if dev_icon then + icon = dev_icon + end + else + icon = require("lspkind").symbol_map[ctx.kind] or "" + end - return icon .. ctx.icon_gap - end, + return icon .. ctx.icon_gap + end, - -- Optionally, use the highlight groups from nvim-web-devicons - -- You can also add the same function for `kind.highlight` if you want to - -- keep the highlight groups in sync with the icons. - highlight = function(ctx) - local hl = ctx.kind_hl - if vim.tbl_contains({ "Path" }, ctx.source_name) then - local dev_icon, dev_hl = require("nvim-web-devicons").get_icon(ctx.label) - if dev_icon then - hl = dev_hl - end - end - return hl - end, + -- Optionally, use the highlight groups from nvim-web-devicons + -- You can also add the same function for `kind.highlight` if you want to + -- keep the highlight groups in sync with the icons. + highlight = function(ctx) + local hl = ctx.kind_hl + if vim.tbl_contains({ "Path" }, ctx.source_name) then + local dev_icon, dev_hl = require("nvim-web-devicons").get_icon(ctx.label) + if dev_icon then + hl = dev_hl + end + end + return hl + end, }, label = { width = { fill = true, max = 60 }, @@ -144,40 +145,40 @@ return { return highlights end, }, - }, - }, - documentation = { - auto_show = true, - draw = function(opts) - if opts.item and opts.item.documentation and opts.item.documentation.value then - local out = require("pretty_hover.parser").parse(opts.item.documentation.value) - opts.item.documentation.value = out:string() - end + }, + } + }, + documentation = { + auto_show = true, + draw = function(opts) + if opts.item and opts.item.documentation and opts.item.documentation.value then + local out = require("pretty_hover.parser").parse(opts.item.documentation.value) + opts.item.documentation.value = out:string() + end - opts.default_implementation(opts) - end, - }, - list = { - selection = { - preselect = false, - auto_insert = false + opts.default_implementation(opts) + end, + }, + list = { + selection = { + preselect = false, + auto_insert = false + } } - } - }, + }, + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, - -- Default list of enabled providers defined so that you can extend it - -- elsewhere in your config, without redefining it, due to `opts_extend` - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" }, + signature = { enabled = true } }, - - -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance - -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, - -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` - -- - -- See the fuzzy documentation for more information - fuzzy = { implementation = "prefer_rust_with_warning" }, - signature = { enabled = true } - }, - opts_extend = { "sources.default" } -} \ No newline at end of file + opts_extend = { "sources.default" } +} diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua new file mode 100644 index 0000000..2150d38 --- /dev/null +++ b/lua/plugins/neorg.lua @@ -0,0 +1,8 @@ +return { + -- "nvim-neorg/neorg", + -- dependencies = { "nvim-neorg/lua-utils.nvim", "nvim-neotest/nvim-nio", "pysan3/pathlib.nvim", + -- 'nvim-neorg/tree-sitter-norg', + -- 'nvim-neorg/tree-sitter-norg-meta', }, + -- lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default + -- config = true, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 2c29e42..efc34c0 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -5,18 +5,26 @@ ]] return { - "romus204/tree-sitter-manager.nvim", - dependencies = {}, -- tree-sitter CLI must be installed system-wide - config = function() - require("tree-sitter-manager").setup({ - -- Default Options - ensure_installed = {"cpp", "cmake"}, -- list of parsers to install at the start of a neovim session - -- border = nil, -- border style for the window (e.g. "rounded", "single"), if nil, use the default border style defined by 'vim.o.winborder'. See :h 'winborder' for more info. - auto_install = true, -- if enabled, install missing parsers when editing a new file - highlight = true, -- treesitter highlighting is enabled by default - -- languages = {}, -- override or add new parser sources - -- parser_dir = vim.fn.stdpath("data") .. "/site/parser", - -- query_dir = vim.fn.stdpath("data") .. "/site/queries", - }) - end -} \ No newline at end of file + "romus204/tree-sitter-manager.nvim", + dependencies = {}, -- tree-sitter CLI must be installed system-wide + config = function() + require("tree-sitter-manager").setup({ + -- Default Options + ensure_installed = { "cpp", "cmake", "json", "bash" }, -- list of parsers to install at the start of a neovim session + -- border = nil, -- border style for the window (e.g. "rounded", "single"), if nil, use the default border style defined by 'vim.o.winborder'. See :h 'winborder' for more info. + auto_install = true, -- if enabled, install missing parsers when editing a new file + highlight = true, -- treesitter highlighting is enabled by default + -- languages = {}, -- override or add new parser sources + -- parser_dir = vim.fn.stdpath("data") .. "/site/parser", + -- query_dir = vim.fn.stdpath("data") .. "/site/queries", + languages = { + norg = { + install_info = { + url = "https://github.com/nvim-neorg/tree-sitter-norg", + use_repo_queries = true + } + } + } + }) + end +} diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index b08f971..ed9b88f 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -61,10 +61,18 @@ "rev": "562d9724e3869ffd1801c572dd149cc9f8d0cc36", "src": "https://github.com/nvimdev/lspsaga.nvim" }, + "lua-utils.nvim": { + "rev": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd", + "src": "https://github.com/nvim-neorg/lua-utils.nvim" + }, "mini.indentscope": { "rev": "e0601f75aa5137a5a13bb92a988c9a300f5bd3de", "src": "https://github.com/echasnovski/mini.indentscope" }, + "neorg": { + "rev": "1f14d72aad7165eac307a2a2f6be0fb97a04b3c2", + "src": "https://github.com/nvim-neorg/neorg" + }, "noice.nvim": { "rev": "7bfd942445fb63089b59f97ca487d605e715f155", "src": "https://github.com/folke/noice.nvim" @@ -81,6 +89,10 @@ "rev": "8a9378a822719346a0288fa004dab302ca3c0a8f", "src": "https://github.com/neovim/nvim-lspconfig" }, + "nvim-nio": { + "rev": "21f5324bfac14e22ba26553caf69ec76ae8a7662", + "src": "https://github.com/nvim-neotest/nvim-nio" + }, "nvim-notify": { "rev": "8701bece920b38ea289b457f902e2ad184131a5d", "src": "https://github.com/rcarriga/nvim-notify" @@ -93,6 +105,10 @@ "rev": "a7ba74849a00546a311f8c146320b433900393e7", "src": "https://github.com/nyoom-engineering/oxocarbon.nvim" }, + "pathlib.nvim": { + "rev": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1", + "src": "https://github.com/pysan3/pathlib.nvim" + }, "plenary.nvim": { "rev": "74b06c6c75e4eeb3108ec01852001636d85a932b", "src": "https://github.com/nvim-lua/plenary.nvim" @@ -121,6 +137,14 @@ "rev": "fa63bc63ae08b661843d9976a43becfbd3daf76c", "src": "https://github.com/romus204/tree-sitter-manager.nvim" }, + "tree-sitter-norg": { + "rev": "d89d95af13d409f30a6c7676387bde311ec4a2c8", + "src": "https://github.com/nvim-neorg/tree-sitter-norg" + }, + "tree-sitter-norg-meta": { + "rev": "729d4e54fb881ba0ddf0f925ec78401354c7c6db", + "src": "https://github.com/nvim-neorg/tree-sitter-norg-meta" + }, "which-key.nvim": { "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", "src": "https://github.com/folke/which-key.nvim"