Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Jan 8, 2025
1 parent 65a16d5 commit ec33960
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 267 deletions.
1 change: 1 addition & 0 deletions lua/config/keymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ wk.add({
{ "<leader>qe", require('otter').export, desc = "[e]xport" },
{ "<leader>qh", ":QuartoHelp ", desc = "[h]elp" },
{ "<leader>qp", ":lua require'quarto'.quartoPreview()<cr>", desc = "[p]review" },
{ "<leader>qu", ":lua require'quarto'.quartoUpdatePreview()<cr>", desc = "[u]pdate preview" },
{ "<leader>qq", ":lua require'quarto'.quartoClosePreview()<cr>", desc = "[q]uiet preview" },
{ "<leader>qr", group = "[r]un" },
{ "<leader>qra", ":QuartoSendAll<cr>", desc = "run [a]ll" },
Expand Down
266 changes: 0 additions & 266 deletions lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 = {
['<C-f>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),

['<C-n>'] = cmp.mapping(function(fallback)
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
fallback()
end
end, { 'i', 's' }),
['<C-p>'] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
['<C-e>'] = cmp.mapping.abort(),
['<c-y>'] = cmp.mapping.confirm {
select = true,
},
['<CR>'] = cmp.mapping.confirm {
select = true,
},

['<Tab>'] = 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' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { 'i', 's' }),

['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = 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 = {
-- ['<C-f>'] = cmp.mapping.scroll_docs(-4),
-- ['<C-d>'] = cmp.mapping.scroll_docs(4),
--
-- ['<C-n>'] = cmp.mapping(function(fallback)
-- if luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- fallback()
-- end
-- end, { 'i', 's' }),
-- ['<C-p>'] = cmp.mapping(function(fallback)
-- if luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
-- ['<C-e>'] = cmp.mapping.abort(),
-- ['<c-y>'] = cmp.mapping.confirm {
-- select = true,
-- },
-- ['<CR>'] = cmp.mapping.confirm {
-- select = true,
-- },
--
-- ['<Tab>'] = 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' }),
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
--
-- ['<C-l>'] = cmp.mapping(function()
-- if luasnip.expand_or_locally_jumpable() then
-- luasnip.expand_or_jump()
-- end
-- end, { 'i', 's' }),
-- ['<C-h>'] = 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,
Expand Down
2 changes: 1 addition & 1 deletion lua/plugins/quarto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return {
-- for complete functionality (language features)
'quarto-dev/quarto-nvim',
ft = { 'quarto' },
dev = false,
dev = true,
opts = {
codeRunner = {
enabled = true,
Expand Down

0 comments on commit ec33960

Please sign in to comment.