nvim: add quarto-nvim
This commit is contained in:
parent
5612d97dc4
commit
9720cf47f7
2 changed files with 79 additions and 44 deletions
|
@ -141,10 +141,12 @@ M.cmp = function()
|
|||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'otter' },
|
||||
{ name = 'pandoc_references' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'treesitter' },
|
||||
{ name = 'calc' },
|
||||
-- { name = 'spell' },
|
||||
{ name = 'spell' },
|
||||
{ name = 'emoji' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'path' },
|
||||
|
@ -158,16 +160,18 @@ M.cmp = function()
|
|||
-- set a name for each source
|
||||
vim_item.kind = " " .. kind.kind
|
||||
vim_item.menu = ({
|
||||
path = "[path]",
|
||||
emoji = "[emoji]",
|
||||
nvim_lua = "[lua]",
|
||||
nvim_lsp = "[lsp]",
|
||||
treesitter = "[ts]",
|
||||
calc = "[calc]",
|
||||
spell = "[spell]",
|
||||
cmdline = "[cmd]",
|
||||
buffer = "[buf]",
|
||||
luasnip = "[snip]",
|
||||
path = "[path]",
|
||||
emoji = "[emoji]",
|
||||
nvim_lua = "[lua]",
|
||||
nvim_lsp = "[lsp]",
|
||||
treesitter = "[ts]",
|
||||
calc = "[calc]",
|
||||
spell = "[spell]",
|
||||
cmdline = "[cmd]",
|
||||
buffer = "[buf]",
|
||||
luasnip = "[snip]",
|
||||
pandoc_references = "[pandoc]",
|
||||
otter = "[quarto]",
|
||||
})[entry.source.name] or "unknown type"
|
||||
return vim_item
|
||||
end,
|
||||
|
@ -182,7 +186,7 @@ M.cmp = function()
|
|||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
}
|
||||
},
|
||||
}
|
||||
-- Thanks to iwataka on github for this bit
|
||||
local search_config = {
|
||||
|
@ -256,18 +260,19 @@ M.lspconfig = function()
|
|||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local lsp_servers = {
|
||||
-- 'lsp_name',
|
||||
'clangd',
|
||||
'bashls',
|
||||
'rust_analyzer',
|
||||
'dockerls',
|
||||
-- 'yamlls',
|
||||
'html',
|
||||
'clangd',
|
||||
'cssls',
|
||||
'dockerls',
|
||||
'eslint',
|
||||
'html',
|
||||
'jsonls',
|
||||
'kotlin_language_server',
|
||||
'marksman',
|
||||
'nil_ls',
|
||||
'nil_ls',
|
||||
'rust_analyzer',
|
||||
'yamlls',
|
||||
}
|
||||
for _, lsp in pairs(lsp_servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
|
|
|
@ -127,42 +127,24 @@ return require('packer').startup({function()
|
|||
end
|
||||
}
|
||||
}
|
||||
use { -- rust-tools: make nvim a better rust environment
|
||||
'simrat39/rust-tools.nvim',
|
||||
requires = {
|
||||
'mattn/webapi-vim', -- allow :RustPlay
|
||||
},
|
||||
config = function ()
|
||||
local rt = require("rust-tools")
|
||||
rt.setup({
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "K", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
use { -- cmp: completion menu
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
require('blake.lsp').cmp()
|
||||
end,
|
||||
requires = { -- (mostly) nvim-cmp sources (not required by cmp, but reqired by my configuration)
|
||||
'onsails/lspkind-nvim', -- icons for entries of the completion menu, required by config
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'ray-x/cmp-treesitter',
|
||||
'hrsh7th/cmp-calc',
|
||||
'f3fora/cmp-spell',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-calc',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
'hrsh7th/cmp-emoji',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-nvim-lua',
|
||||
'hrsh7th/cmp-path',
|
||||
'jc-doyle/cmp-pandoc-references',
|
||||
'onsails/lspkind-nvim', -- icons for entries of the completion menu, required by config
|
||||
'ray-x/cmp-treesitter',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
}
|
||||
use { -- luasnip: snippits plugin
|
||||
|
@ -376,6 +358,54 @@ return require('packer').startup({function()
|
|||
require('hop').setup { keys = 'etovxqpdygfblzhckisuran' }
|
||||
end
|
||||
}
|
||||
---- Language-specific packages
|
||||
use { -- rust-tools: make nvim a better rust environment
|
||||
'simrat39/rust-tools.nvim',
|
||||
requires = {
|
||||
'mattn/webapi-vim', -- allow :RustPlay
|
||||
},
|
||||
config = function ()
|
||||
local rt = require("rust-tools")
|
||||
rt.setup({
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "K", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
use { -- quarto-nvim: tools for writing with quarto
|
||||
'quarto-dev/quarto-nvim',
|
||||
requires = {
|
||||
'jmbuhr/otter.nvim', -- execute code in a terminal
|
||||
},
|
||||
config = function ()
|
||||
require'quarto'.setup({
|
||||
debug = false,
|
||||
closePreviewOnExit = true,
|
||||
lspFeatures = {
|
||||
enabled = true,
|
||||
languages = { 'bash' },
|
||||
chunks = 'curly', -- 'curly' or 'all'
|
||||
diagnostics = {
|
||||
enabled = true,
|
||||
triggers = { "BufWritePost" }
|
||||
},
|
||||
completion = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
hover = 'K',
|
||||
definition = 'gd',
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
-- Conveniences
|
||||
use { -- sort motion: (gs)
|
||||
|
|
Loading…
Add table
Reference in a new issue