diff --git a/lua/config/keymap.lua b/lua/config/keymap.lua index 495eaa4..639f36d 100644 --- a/lua/config/keymap.lua +++ b/lua/config/keymap.lua @@ -392,6 +392,7 @@ wk.add({ { "qe", require('otter').export, desc = "[e]xport" }, { "qh", ":QuartoHelp ", desc = "[h]elp" }, { "qp", ":lua require'quarto'.quartoPreview()", desc = "[p]review" }, + { "qu", ":lua require'quarto'.quartoUpdatePreview()", desc = "[u]pdate preview" }, { "qq", ":lua require'quarto'.quartoClosePreview()", desc = "[q]uiet preview" }, { "qr", group = "[r]un" }, { "qra", ":QuartoSendAll", desc = "run [a]ll" }, diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua index 607f4f1..98b95b8 100644 --- a/lua/plugins/completion.lua +++ b/lua/plugins/completion.lua @@ -27,7 +27,6 @@ return { }, { 'kdheepak/cmp-latex-symbols' }, }, - 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', @@ -80,271 +79,6 @@ return { }, }, - { -- completion - 'hrsh7th/nvim-cmp', - enabled = false, - event = 'InsertEnter', - dependencies = { - 'hrsh7th/cmp-nvim-lsp', - 'jmbuhr/cmp-nvim-lsp-signature-help', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-calc', - 'hrsh7th/cmp-emoji', - 'saadparwaiz1/cmp_luasnip', - 'f3fora/cmp-spell', - 'ray-x/cmp-treesitter', - 'kdheepak/cmp-latex-symbols', - 'jmbuhr/cmp-pandoc-references', - 'L3MON4D3/LuaSnip', - 'rafamadriz/friendly-snippets', - 'onsails/lspkind-nvim', - }, - config = function() - local cmp = require 'cmp' - local luasnip = require 'luasnip' - local lspkind = require 'lspkind' - - local has_words_before = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil - end - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - mapping = { - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - [''] = cmp.mapping(function(fallback) - if luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm { - select = true, - }, - [''] = cmp.mapping.confirm { - select = true, - }, - - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, { 'i', 's' }), - - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - }, - autocomplete = false, - - ---@diagnostic disable-next-line: missing-fields - formatting = { - format = lspkind.cmp_format { - mode = 'symbol', - menu = { - nvim_lsp = '[LSP]', - nvim_lsp_signature_help = '[sig]', - luasnip = '[snip]', - buffer = '[buf]', - path = '[path]', - spell = '[spell]', - pandoc_references = '[ref]', - tags = '[tag]', - treesitter = '[TS]', - calc = '[calc]', - latex_symbols = '[tex]', - emoji = '[emoji]', - }, - }, - }, - }, - signature = { enabled = true }, - appearance = { - use_nvim_cmp_as_default = false, - } - } - }, - - -- { -- completion - -- 'hrsh7th/nvim-cmp', - -- enabled = false, - -- event = 'InsertEnter', - -- dependencies = { - -- 'hrsh7th/cmp-nvim-lsp', - -- 'jmbuhr/cmp-nvim-lsp-signature-help', - -- 'hrsh7th/cmp-buffer', - -- 'hrsh7th/cmp-path', - -- 'hrsh7th/cmp-calc', - -- 'hrsh7th/cmp-emoji', - -- 'saadparwaiz1/cmp_luasnip', - -- 'f3fora/cmp-spell', - -- 'ray-x/cmp-treesitter', - -- 'kdheepak/cmp-latex-symbols', - -- 'jmbuhr/cmp-pandoc-references', - -- 'L3MON4D3/LuaSnip', - -- 'rafamadriz/friendly-snippets', - -- 'onsails/lspkind-nvim', - -- }, - -- config = function() - -- local cmp = require 'cmp' - -- local luasnip = require 'luasnip' - -- local lspkind = require 'lspkind' - -- - -- local has_words_before = function() - -- local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - -- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil - -- end - -- - -- cmp.setup { - -- snippet = { - -- expand = function(args) - -- luasnip.lsp_expand(args.body) - -- end, - -- }, - -- completion = { completeopt = 'menu,menuone,noinsert' }, - -- mapping = { - -- [''] = cmp.mapping.scroll_docs(-4), - -- [''] = cmp.mapping.scroll_docs(4), - -- - -- [''] = cmp.mapping(function(fallback) - -- if luasnip.expand_or_jumpable() then - -- luasnip.expand_or_jump() - -- fallback() - -- end - -- end, { 'i', 's' }), - -- [''] = cmp.mapping(function(fallback) - -- if luasnip.jumpable(-1) then - -- luasnip.jump(-1) - -- else - -- fallback() - -- end - -- end, { 'i', 's' }), - -- [''] = cmp.mapping.abort(), - -- [''] = cmp.mapping.confirm { - -- select = true, - -- }, - -- [''] = cmp.mapping.confirm { - -- select = true, - -- }, - -- - -- [''] = cmp.mapping(function(fallback) - -- if cmp.visible() then - -- cmp.select_next_item() - -- elseif has_words_before() then - -- cmp.complete() - -- else - -- fallback() - -- end - -- end, { 'i', 's' }), - -- [''] = cmp.mapping(function(fallback) - -- if cmp.visible() then - -- cmp.select_prev_item() - -- else - -- fallback() - -- end - -- end, { 'i', 's' }), - -- - -- [''] = cmp.mapping(function() - -- if luasnip.expand_or_locally_jumpable() then - -- luasnip.expand_or_jump() - -- end - -- end, { 'i', 's' }), - -- [''] = cmp.mapping(function() - -- if luasnip.locally_jumpable(-1) then - -- luasnip.jump(-1) - -- end - -- end, { 'i', 's' }), - -- }, - -- autocomplete = false, - -- - -- ---@diagnostic disable-next-line: missing-fields - -- formatting = { - -- format = lspkind.cmp_format { - -- mode = 'symbol', - -- menu = { - -- nvim_lsp = '[LSP]', - -- nvim_lsp_signature_help = '[sig]', - -- luasnip = '[snip]', - -- buffer = '[buf]', - -- path = '[path]', - -- spell = '[spell]', - -- pandoc_references = '[ref]', - -- tags = '[tag]', - -- treesitter = '[TS]', - -- calc = '[calc]', - -- latex_symbols = '[tex]', - -- emoji = '[emoji]', - -- }, - -- }, - -- }, - -- sources = { - -- { name = 'path' }, - -- { name = 'nvim_lsp_signature_help' }, - -- { name = 'nvim_lsp' }, - -- { name = 'luasnip', keyword_length = 3, max_item_count = 3 }, - -- { name = 'pandoc_references' }, - -- { name = 'buffer', keyword_length = 5, max_item_count = 3 }, - -- { name = 'spell' }, - -- { name = 'treesitter', keyword_length = 5, max_item_count = 3 }, - -- { name = 'calc' }, - -- { name = 'latex_symbols' }, - -- { name = 'emoji' }, - -- }, - -- view = { - -- entries = 'native', - -- }, - -- window = { - -- documentation = { - -- border = require('misc.style').border, - -- }, - -- }, - -- } - -- - -- -- for friendly snippets - -- require('luasnip.loaders.from_vscode').lazy_load() - -- -- for custom snippets - -- require('luasnip.loaders.from_vscode').lazy_load { paths = { vim.fn.stdpath 'config' .. '/snips' } } - -- -- link quarto and rmarkdown to markdown snippets - -- luasnip.filetype_extend('quarto', { 'markdown' }) - -- luasnip.filetype_extend('rmarkdown', { 'markdown' }) - -- end, - -- }, - -- { -- gh copilot 'zbirenbaum/copilot.lua', enabled = true, diff --git a/lua/plugins/quarto.lua b/lua/plugins/quarto.lua index 55e885e..d3d2124 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 = false, + dev = true, opts = { codeRunner = { enabled = true,