Skip to content

Commit ec33960

Browse files
committed
wip
1 parent 65a16d5 commit ec33960

File tree

3 files changed

+2
-267
lines changed

3 files changed

+2
-267
lines changed

lua/config/keymap.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ wk.add({
392392
{ "<leader>qe", require('otter').export, desc = "[e]xport" },
393393
{ "<leader>qh", ":QuartoHelp ", desc = "[h]elp" },
394394
{ "<leader>qp", ":lua require'quarto'.quartoPreview()<cr>", desc = "[p]review" },
395+
{ "<leader>qu", ":lua require'quarto'.quartoUpdatePreview()<cr>", desc = "[u]pdate preview" },
395396
{ "<leader>qq", ":lua require'quarto'.quartoClosePreview()<cr>", desc = "[q]uiet preview" },
396397
{ "<leader>qr", group = "[r]un" },
397398
{ "<leader>qra", ":QuartoSendAll<cr>", desc = "run [a]ll" },

lua/plugins/completion.lua

Lines changed: 0 additions & 266 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ return {
2727
},
2828
{ 'kdheepak/cmp-latex-symbols' },
2929
},
30-
3130
version = 'v0.*',
3231
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
3332
-- build = 'cargo build --release',
@@ -80,271 +79,6 @@ return {
8079
},
8180
},
8281

83-
{ -- completion
84-
'hrsh7th/nvim-cmp',
85-
enabled = false,
86-
event = 'InsertEnter',
87-
dependencies = {
88-
'hrsh7th/cmp-nvim-lsp',
89-
'jmbuhr/cmp-nvim-lsp-signature-help',
90-
'hrsh7th/cmp-buffer',
91-
'hrsh7th/cmp-path',
92-
'hrsh7th/cmp-calc',
93-
'hrsh7th/cmp-emoji',
94-
'saadparwaiz1/cmp_luasnip',
95-
'f3fora/cmp-spell',
96-
'ray-x/cmp-treesitter',
97-
'kdheepak/cmp-latex-symbols',
98-
'jmbuhr/cmp-pandoc-references',
99-
'L3MON4D3/LuaSnip',
100-
'rafamadriz/friendly-snippets',
101-
'onsails/lspkind-nvim',
102-
},
103-
config = function()
104-
local cmp = require 'cmp'
105-
local luasnip = require 'luasnip'
106-
local lspkind = require 'lspkind'
107-
108-
local has_words_before = function()
109-
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
110-
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
111-
end
112-
113-
cmp.setup {
114-
snippet = {
115-
expand = function(args)
116-
luasnip.lsp_expand(args.body)
117-
end,
118-
},
119-
completion = { completeopt = 'menu,menuone,noinsert' },
120-
mapping = {
121-
['<C-f>'] = cmp.mapping.scroll_docs(-4),
122-
['<C-d>'] = cmp.mapping.scroll_docs(4),
123-
124-
['<C-n>'] = cmp.mapping(function(fallback)
125-
if luasnip.expand_or_jumpable() then
126-
luasnip.expand_or_jump()
127-
fallback()
128-
end
129-
end, { 'i', 's' }),
130-
['<C-p>'] = cmp.mapping(function(fallback)
131-
if luasnip.jumpable(-1) then
132-
luasnip.jump(-1)
133-
else
134-
fallback()
135-
end
136-
end, { 'i', 's' }),
137-
['<C-e>'] = cmp.mapping.abort(),
138-
['<c-y>'] = cmp.mapping.confirm {
139-
select = true,
140-
},
141-
['<CR>'] = cmp.mapping.confirm {
142-
select = true,
143-
},
144-
145-
['<Tab>'] = cmp.mapping(function(fallback)
146-
if cmp.visible() then
147-
cmp.select_next_item()
148-
elseif has_words_before() then
149-
cmp.complete()
150-
else
151-
fallback()
152-
end
153-
end, { 'i', 's' }),
154-
['<S-Tab>'] = cmp.mapping(function(fallback)
155-
if cmp.visible() then
156-
cmp.select_prev_item()
157-
else
158-
fallback()
159-
end
160-
end, { 'i', 's' }),
161-
162-
['<C-l>'] = cmp.mapping(function()
163-
if luasnip.expand_or_locally_jumpable() then
164-
luasnip.expand_or_jump()
165-
end
166-
end, { 'i', 's' }),
167-
['<C-h>'] = cmp.mapping(function()
168-
if luasnip.locally_jumpable(-1) then
169-
luasnip.jump(-1)
170-
end
171-
end, { 'i', 's' }),
172-
},
173-
autocomplete = false,
174-
175-
---@diagnostic disable-next-line: missing-fields
176-
formatting = {
177-
format = lspkind.cmp_format {
178-
mode = 'symbol',
179-
menu = {
180-
nvim_lsp = '[LSP]',
181-
nvim_lsp_signature_help = '[sig]',
182-
luasnip = '[snip]',
183-
buffer = '[buf]',
184-
path = '[path]',
185-
spell = '[spell]',
186-
pandoc_references = '[ref]',
187-
tags = '[tag]',
188-
treesitter = '[TS]',
189-
calc = '[calc]',
190-
latex_symbols = '[tex]',
191-
emoji = '[emoji]',
192-
},
193-
},
194-
},
195-
},
196-
signature = { enabled = true },
197-
appearance = {
198-
use_nvim_cmp_as_default = false,
199-
}
200-
}
201-
},
202-
203-
-- { -- completion
204-
-- 'hrsh7th/nvim-cmp',
205-
-- enabled = false,
206-
-- event = 'InsertEnter',
207-
-- dependencies = {
208-
-- 'hrsh7th/cmp-nvim-lsp',
209-
-- 'jmbuhr/cmp-nvim-lsp-signature-help',
210-
-- 'hrsh7th/cmp-buffer',
211-
-- 'hrsh7th/cmp-path',
212-
-- 'hrsh7th/cmp-calc',
213-
-- 'hrsh7th/cmp-emoji',
214-
-- 'saadparwaiz1/cmp_luasnip',
215-
-- 'f3fora/cmp-spell',
216-
-- 'ray-x/cmp-treesitter',
217-
-- 'kdheepak/cmp-latex-symbols',
218-
-- 'jmbuhr/cmp-pandoc-references',
219-
-- 'L3MON4D3/LuaSnip',
220-
-- 'rafamadriz/friendly-snippets',
221-
-- 'onsails/lspkind-nvim',
222-
-- },
223-
-- config = function()
224-
-- local cmp = require 'cmp'
225-
-- local luasnip = require 'luasnip'
226-
-- local lspkind = require 'lspkind'
227-
--
228-
-- local has_words_before = function()
229-
-- local line, col = unpack(vim.api.nvim_win_get_cursor(0))
230-
-- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
231-
-- end
232-
--
233-
-- cmp.setup {
234-
-- snippet = {
235-
-- expand = function(args)
236-
-- luasnip.lsp_expand(args.body)
237-
-- end,
238-
-- },
239-
-- completion = { completeopt = 'menu,menuone,noinsert' },
240-
-- mapping = {
241-
-- ['<C-f>'] = cmp.mapping.scroll_docs(-4),
242-
-- ['<C-d>'] = cmp.mapping.scroll_docs(4),
243-
--
244-
-- ['<C-n>'] = cmp.mapping(function(fallback)
245-
-- if luasnip.expand_or_jumpable() then
246-
-- luasnip.expand_or_jump()
247-
-- fallback()
248-
-- end
249-
-- end, { 'i', 's' }),
250-
-- ['<C-p>'] = cmp.mapping(function(fallback)
251-
-- if luasnip.jumpable(-1) then
252-
-- luasnip.jump(-1)
253-
-- else
254-
-- fallback()
255-
-- end
256-
-- end, { 'i', 's' }),
257-
-- ['<C-e>'] = cmp.mapping.abort(),
258-
-- ['<c-y>'] = cmp.mapping.confirm {
259-
-- select = true,
260-
-- },
261-
-- ['<CR>'] = cmp.mapping.confirm {
262-
-- select = true,
263-
-- },
264-
--
265-
-- ['<Tab>'] = cmp.mapping(function(fallback)
266-
-- if cmp.visible() then
267-
-- cmp.select_next_item()
268-
-- elseif has_words_before() then
269-
-- cmp.complete()
270-
-- else
271-
-- fallback()
272-
-- end
273-
-- end, { 'i', 's' }),
274-
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
275-
-- if cmp.visible() then
276-
-- cmp.select_prev_item()
277-
-- else
278-
-- fallback()
279-
-- end
280-
-- end, { 'i', 's' }),
281-
--
282-
-- ['<C-l>'] = cmp.mapping(function()
283-
-- if luasnip.expand_or_locally_jumpable() then
284-
-- luasnip.expand_or_jump()
285-
-- end
286-
-- end, { 'i', 's' }),
287-
-- ['<C-h>'] = cmp.mapping(function()
288-
-- if luasnip.locally_jumpable(-1) then
289-
-- luasnip.jump(-1)
290-
-- end
291-
-- end, { 'i', 's' }),
292-
-- },
293-
-- autocomplete = false,
294-
--
295-
-- ---@diagnostic disable-next-line: missing-fields
296-
-- formatting = {
297-
-- format = lspkind.cmp_format {
298-
-- mode = 'symbol',
299-
-- menu = {
300-
-- nvim_lsp = '[LSP]',
301-
-- nvim_lsp_signature_help = '[sig]',
302-
-- luasnip = '[snip]',
303-
-- buffer = '[buf]',
304-
-- path = '[path]',
305-
-- spell = '[spell]',
306-
-- pandoc_references = '[ref]',
307-
-- tags = '[tag]',
308-
-- treesitter = '[TS]',
309-
-- calc = '[calc]',
310-
-- latex_symbols = '[tex]',
311-
-- emoji = '[emoji]',
312-
-- },
313-
-- },
314-
-- },
315-
-- sources = {
316-
-- { name = 'path' },
317-
-- { name = 'nvim_lsp_signature_help' },
318-
-- { name = 'nvim_lsp' },
319-
-- { name = 'luasnip', keyword_length = 3, max_item_count = 3 },
320-
-- { name = 'pandoc_references' },
321-
-- { name = 'buffer', keyword_length = 5, max_item_count = 3 },
322-
-- { name = 'spell' },
323-
-- { name = 'treesitter', keyword_length = 5, max_item_count = 3 },
324-
-- { name = 'calc' },
325-
-- { name = 'latex_symbols' },
326-
-- { name = 'emoji' },
327-
-- },
328-
-- view = {
329-
-- entries = 'native',
330-
-- },
331-
-- window = {
332-
-- documentation = {
333-
-- border = require('misc.style').border,
334-
-- },
335-
-- },
336-
-- }
337-
--
338-
-- -- for friendly snippets
339-
-- require('luasnip.loaders.from_vscode').lazy_load()
340-
-- -- for custom snippets
341-
-- require('luasnip.loaders.from_vscode').lazy_load { paths = { vim.fn.stdpath 'config' .. '/snips' } }
342-
-- -- link quarto and rmarkdown to markdown snippets
343-
-- luasnip.filetype_extend('quarto', { 'markdown' })
344-
-- luasnip.filetype_extend('rmarkdown', { 'markdown' })
345-
-- end,
346-
-- },
347-
--
34882
{ -- gh copilot
34983
'zbirenbaum/copilot.lua',
35084
enabled = true,

lua/plugins/quarto.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ return {
44
-- for complete functionality (language features)
55
'quarto-dev/quarto-nvim',
66
ft = { 'quarto' },
7-
dev = false,
7+
dev = true,
88
opts = {
99
codeRunner = {
1010
enabled = true,

0 commit comments

Comments
 (0)