diff --git a/ftplugin/quarto.lua b/ftplugin/quarto.lua index b139e32..f08310d 100644 --- a/ftplugin/quarto.lua +++ b/ftplugin/quarto.lua @@ -5,6 +5,8 @@ vim.b.slime_cell_delimiter = '```' vim.b['quarto_is_r_mode'] = nil vim.b['reticulate_running'] = false +vim.bo.commentstring = '' + -- wrap text, but by word no character -- indent the wrappped line vim.wo.wrap = true diff --git a/init.lua b/init.lua index e1ba5a7..30a100b 100644 --- a/init.lua +++ b/init.lua @@ -20,5 +20,6 @@ require 'config.redir' -- vim.treesitter.language.add('pandoc_markdown_inline', { path = "/usr/local/lib/libtree-sitter-pandoc-markdown-inline.so" }) -- vim.treesitter.language.register('pandoc_markdown', { 'quarto', 'rmarkdown' }) +vim.treesitter.language.register("markdown", 'quarto') vim.treesitter.language.register("markdown", 'text') diff --git a/lua/plugins/common.lua b/lua/plugins/common.lua index b3feadf..6b341f6 100644 --- a/lua/plugins/common.lua +++ b/lua/plugins/common.lua @@ -1,4 +1,17 @@ return { -- common dependencies { 'nvim-lua/plenary.nvim' }, + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + styles = {}, + bigfile = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + statuscolumn = { enabled = false }, + words = { enabled = false }, + }, + }, } diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index a5d80f4..fc126cf 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -7,8 +7,99 @@ return { end, }, + { -- new completion plugin + 'saghen/blink.cmp', + enabled = true, + lazy = false, -- lazy loading handled internally + -- optional: provides snippets for the snippet source + dependencies = { + { 'rafamadriz/friendly-snippets' }, + { + 'saghen/blink.compat', + dev = false, + opts = { + impersonate_nvim_cmp = false, + enable_events = false, + debug = false, + }, + }, + { + 'jmbuhr/cmp-pandoc-references', + dev = false, + ft = { 'quarto', 'markdown', 'rmarkdown' }, + config = function() + vim.api.nvim_create_autocmd('FileType', { + pattern = { "markdown", "quarto", "rmarkdown" }, + callback = function() + require('cmp-pandoc-references.lsp').start() + end + }) + end + }, + { '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", "references", "emoji", "symbols" }, + }, + 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", + -- opts = { + -- impersonate_nvim_cmp = true, + -- enable_events = true, + -- debug = true, + -- } + -- }, + emoji = { name = "emoji", 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 + 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', + + -- experimental auto-brackets support + accept = { auto_brackets = { enabled = true } }, + + -- experimental signature help support + trigger = { signature_help = { enabled = true } }, + } + }, + { -- completion 'hrsh7th/nvim-cmp', + enabled = false, event = 'InsertEnter', dependencies = { 'hrsh7th/cmp-nvim-lsp', @@ -154,7 +245,7 @@ return { { -- gh copilot 'zbirenbaum/copilot.lua', - enabled = false, + enabled = true, config = function() require('copilot').setup { suggestion = { @@ -177,6 +268,7 @@ return { { -- LLMs "olimorris/codecompanion.nvim", + enabled = false, dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", diff --git a/lua/plugins/editing.lua b/lua/plugins/editing.lua index 33e09b5..993a9a7 100644 --- a/lua/plugins/editing.lua +++ b/lua/plugins/editing.lua @@ -1,8 +1,5 @@ return { - -- disables hungry features for files larget than 2MB - { 'LunarVim/bigfile.nvim' }, - -- add/delete/change can be done with the keymaps -- ys{motion}{char}, ds{char}, and cs{target}{replacement} { diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 6ce4eee..bccdc87 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -44,16 +44,16 @@ return { }, }, { 'Bilal2453/luvit-meta', lazy = true }, -- optional `vim.uv` typings - { -- optional completion source for require statements and module annotations - 'hrsh7th/nvim-cmp', - opts = function(_, opts) - opts.sources = opts.sources or {} - table.insert(opts.sources, { - name = 'lazydev', - group_index = 0, -- set group index to 0 to skip loading LuaLS completions - }) - end, - }, + -- { -- optional completion source for require statements and module annotations + -- 'hrsh7th/nvim-cmp', + -- opts = function(_, opts) + -- opts.sources = opts.sources or {} + -- table.insert(opts.sources, { + -- name = 'lazydev', + -- group_index = 0, -- set group index to 0 to skip loading LuaLS completions + -- }) + -- end, + -- }, -- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim }, { 'folke/neoconf.nvim', opts = {}, enabled = false }, @@ -116,8 +116,9 @@ return { } local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) - capabilities.textDocument.completion.completionItem.snippetSupport = true + -- capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + -- capabilities.textDocument.completion.completionItem.snippetSupport = true + capabilities = require('blink.cmp').get_lsp_capabilities(capabilities) -- also needs: -- $home/.config/marksman/config.toml : diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 6b8142c..c889450 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,4 +1,14 @@ return { + + { -- nice quickfix list + 'stevearc/quicker.nvim', + event = "FileType qf", + opts = {}, + }, + { -- more qf improvements + 'romainl/vim-qf' + }, + -- telescope -- a nice seletion UI also to find and open files { @@ -273,7 +283,7 @@ return { }, opts = { providers = { - priority = { 'markdown', 'lsp', 'norg' }, + priority = { 'markdown', 'lsp', 'norg' }, -- Configuration for each provider (3rd party providers are supported) lsp = { -- Lsp client names to ignore @@ -374,10 +384,10 @@ return { ft = { 'markdown', 'quarto', 'vimwiki' }, cond = function() -- Disable on Windows system - return vim.fn.has 'win32' ~= 1 + return vim.fn.has 'win32' ~= 1 end, dependencies = { - 'leafo/magick', -- that's a lua rock + 'leafo/magick', -- that's a lua rock }, config = function() -- Requirements