diff --git a/lua/plugins/code-utils.lua b/lua/plugins/code-utils.lua index 0b5ce53..0ec62c0 100644 --- a/lua/plugins/code-utils.lua +++ b/lua/plugins/code-utils.lua @@ -2,82 +2,100 @@ -- │ Code utils │ -- ╰────────────╯ return { - -- │ Code parse │ - { - "nvim-treesitter/nvim-treesitter", - opts = function() - return require("plugins.opts.treesitter") - end, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - }, + -- │ Code parse │ + { + "nvim-treesitter/nvim-treesitter", + opts = function() + return require("plugins.opts.treesitter") + end, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, + }, - { - "nvim-treesitter/nvim-treesitter-context", - opts = function() - return require("plugins.opts.treesitterContext") - end, - }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = function() + return require("plugins.opts.treesitterContext") + end, + }, - -- │ Completion │ - { - "saghen/blink.cmp", - dependencies = { "rafamadriz/friendly-snippets" }, - version = "1.*", - -- build = "cargo build --release", - opts = { - -- C-e: Hide menu - -- C-k: Toggle signature help (if signature.enabled = true) - keymap = { - preset = "default", - [""] = { "accept", "fallback" }, - [""] = { "select_next", "fallback" }, - [""] = { "select_prev", "fallback" }, - }, - appearance = { - nerd_font_variant = "mono", - }, - completion = { documentation = { auto_show = false } }, - sources = {}, - -- default = { "lsp", "path", "snippets", "buffer" }, - fuzzy = { implementation = "prefer_rust_with_warning" }, - }, - opts_extend = { "sources.default" }, - }, + -- │ Completion │ + { + "saghen/blink.cmp", + dependencies = { "rafamadriz/friendly-snippets" }, + version = "1.*", + -- build = "cargo build --release", + opts = { + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + keymap = { + preset = "default", + [""] = { "accept", "fallback" }, + [""] = { "select_next", "fallback" }, + [""] = { "select_prev", "fallback" }, + }, + appearance = { + nerd_font_variant = "mono", + }, + completion = { + accept = { auto_brackets = { enabled = false }, }, + list = { selection = { preselect = false, auto_insert = true } }, + menu = { + auto_show = true, - -- -- │ Auto close │ - { - "windwp/nvim-ts-autotag", - config = function(_, opts) - require("nvim-ts-autotag").setup({ - opts = { - enable_close = true, - enable_rename = true, - enable_close_on_slash = false, - }, - }) - end, - }, + -- nvim-cmp style menu + draw = { + columns = { + { "label", "label_description", gap = 1 }, + { "kind_icon", "kind" } + }, + } + }, - { - 'm4xshen/autoclose.nvim', - opts = function() - return require("plugins.opts.autoclose") - end, - }, + -- Show documentation when selecting a completion item + documentation = { auto_show = true, auto_show_delay_ms = 500 }, + -- Display a preview of the selected item on the current line + ghost_text = { enabled = true }, + }, + sources = {}, + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, + opts_extend = { "sources.default" }, + }, - -- │ Diagnostics │ - { - "folke/trouble.nvim", - opts = { use_diagnostic_signs = true }, - }, + -- -- │ Auto close │ + { + "windwp/nvim-ts-autotag", + config = function(_, opts) + require("nvim-ts-autotag").setup({ + opts = { + enable_close = true, + enable_rename = true, + enable_close_on_slash = false, + }, + }) + end, + }, - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = function() - return require("plugins.opts.todocomments") - end, - }, + { + 'm4xshen/autoclose.nvim', + opts = function() + return require("plugins.opts.autoclose") + end, + }, + + -- │ Diagnostics │ + { + "folke/trouble.nvim", + opts = { use_diagnostic_signs = true }, + }, + + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = function() + return require("plugins.opts.todocomments") + end, + }, }