From 1c7904642d77989e3ebb3cc68ecdc5842fc69687 Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Thu, 26 Dec 2024 14:58:44 +0100 Subject: [PATCH] win --- lua/plugins/completion.lua | 73 +++++++++++++++++++------------------- lua/plugins/quarto.lua | 2 +- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index 9947137..81f362b 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -14,6 +14,7 @@ return { -- optional: provides snippets for the snippet source dependencies = { { 'rafamadriz/friendly-snippets' }, + { 'moyiz/blink-emoji.nvim' }, { 'saghen/blink.compat', dev = false, @@ -28,60 +29,59 @@ return { dev = false, ft = { 'quarto', 'markdown', 'rmarkdown' }, }, - { 'hrsh7th/cmp-emoji' }, { 'kdheepak/cmp-latex-symbols' }, }, - -- use a release tag to download pre-built binaries version = 'v0.*', -- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust -- build = 'cargo build --release', - -- If you use nix, you can build from source using latest nightly rust with: - -- build = 'nix run .#build-plugin', - ---@module 'blink.cmp' ---@type blink.cmp.Config opts = { - -- 'default' for mappings similar to built-in completion - -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) - -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept - -- see the "default configuration" section below for full documentation on how to define - -- your own keymap. keymap = { preset = 'enter' }, - sources = { - completion = { - enabled_providers = { "lsp", "path", "snippets", "buffer", "lazydev" }, + default = { "lazydev", "lsp", "path", "snippets", "buffer", "emoji" }, + cmdline = { + enabled = false, }, providers = { - -- dont show LuaLS require statements when lazydev has items - lsp = { fallback_for = { "lazydev" } }, - lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" }, - -- references = { - -- name = "pandoc_references", - -- module = "blink.compat.source", - -- }, - emoji = { name = "emoji", module = "blink.compat.source" }, + emoji = { + module = "blink-emoji", + name = "Emoji", + score_offset = 15, -- Tune by preference + }, + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, + }, + references = { + name = "pandoc_references", + module = "blink.compat.source", + }, symbols = { name = "symbols", module = "blink.compat.source" }, }, }, - - highlight = { - -- sets the fallback highlight groups to nvim-cmp's highlight groups - -- useful for when your theme doesn't support blink.cmp - -- will be removed in a future release, assuming themes add support + appearance = { + -- Sets the fallback highlight groups to nvim-cmp's highlight groups + -- Useful for when your theme doesn't support blink.cmp + -- Will be removed in a future release use_nvim_cmp_as_default = true, + -- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' }, - -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - - -- experimental auto-brackets support - accept = { auto_brackets = { enabled = true } }, - - -- experimental signature help support - trigger = { signature_help = { enabled = true } }, - } + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + treesitter_highlighting = true, + }, + menu = { auto_show = function(ctx) return ctx.mode ~= 'cmdline' end }, + }, + signature = { enabled = true } + }, }, { -- completion @@ -90,7 +90,6 @@ return { event = 'InsertEnter', dependencies = { 'hrsh7th/cmp-nvim-lsp', - -- TODO: wait for PR merge to revert back to hrsh7th upstream 'jmbuhr/cmp-nvim-lsp-signature-help', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', diff --git a/lua/plugins/quarto.lua b/lua/plugins/quarto.lua index 39ab1c0..b77447b 100644 --- a/lua/plugins/quarto.lua +++ b/lua/plugins/quarto.lua @@ -4,7 +4,7 @@ return { -- for complete functionality (language features) 'quarto-dev/quarto-nvim', ft = { 'quarto' }, - dev = true, + dev = false, opts = { codeRunner = { enabled = true,