quarto config

This commit is contained in:
Andrei Stoica 2024-03-18 15:11:23 -04:00
parent 446ec92655
commit d509b8a159
3 changed files with 96 additions and 36 deletions

View File

@ -14,6 +14,7 @@ local servers = {
"rust_analyzer",
"pyright",
"grammarly",
"marksman",
}
for _, lsp in ipairs(servers) do
@ -29,5 +30,3 @@ lspconfig["clangd"].setup({
offsetEncoding = { "utf-16" },
},
})
--
-- lspconfig.pyright.setup { blabla}

View File

@ -2,17 +2,28 @@ local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"python",
"tsx",
"c",
"javascript",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"query",
"regex",
"vim",
"vimdoc",
"bash",
"html",
"css",
"javascript",
"yaml",
"julia",
"r",
},
indent = {
enable = true,
@ -41,7 +52,6 @@ M.mason = {
"jedi_language_server",
"docker_compose_language_service",
"dockerls",
},
@ -63,8 +73,8 @@ M.nvimtree = {
},
}
M.cmp = function (_, opts)
local cmp = require "cmp"
M.cmp = function(_, opts)
local cmp = require("cmp")
opts.experimental = {
ghost_text = true,
}
@ -73,20 +83,20 @@ M.cmp = function (_, opts)
{ name = "luasnip" },
{ name = "nvim_lua" },
{ name = "path" },
{ name = "buffer", keyword_length = 5},
{ name = "buffer", keyword_length = 5 },
})
opts.mapping = cmp.config.mapping {
opts.mapping = cmp.config.mapping({
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<C-y>"] = cmp.mapping.confirm {
["<C-y>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -111,10 +121,8 @@ M.cmp = function (_, opts)
"i",
"s",
}),
}
})
return opts
end
return M

View File

@ -47,6 +47,22 @@ local plugins = {
require("plugins.configs.lspconfig")
require("custom.configs.lspconfig")
end, -- Override to setup mason-lspconfig
opts = {
---@type lspconfig.options
servers = {
pyright = {},
r_language_server = {},
julials = {},
marksman = {
-- also needs:
-- $home/.config/marksman/config.toml :
-- [core]
-- markdown.file_extensions = ["md", "markdown", "qmd"]
filetypes = { "markdown", "quarto" },
root_dir = require("lspconfig.util").root_pattern(".git", ".marksman.toml", "_quarto.yml"),
},
},
},
},
-- override plugin configs
{
@ -113,25 +129,26 @@ local plugins = {
lazy = false,
},
{
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- ft = {
-- "BufReadPre ~/Notes/**.md",
-- "BufNewFile ~/Notes/**.md",
-- },
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
workspaces = {
{ name = "second-brain", path = "~/second-brain" },
},
new_notes_location = "notes_subdir",
daily_notes = { folder = "notes/dailies" },
},
},
-- Disable nvchad plugins
{
"epwalsh/obsidian.nvim",
version = "*", -- recommended, use latest release instead of latest commit
lazy = true,
ft = "markdown",
-- ft = {
-- "BufReadPre ~/Notes/**.md",
-- "BufNewFile ~/Notes/**.md",
-- },
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
workspaces = {
{ name = "second-brain", path = "~/second-brain" },
},
new_notes_location = "notes_subdir",
daily_notes = { folder = "notes/dailies" },
},
},
-- Disable nvchad plugins
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
@ -142,7 +159,43 @@ local plugins = {
-- refer to the configuration section below
},
},
{
"quarto-dev/quarto-nvim",
opts = {
lspFeatures = {
languages = { "r", "python", "julia", "bash", "html", "lua" },
},
},
ft = "quarto",
keys = {
{ "<leader>qa", ":QuartoActivate<cr>", desc = "quarto activate" },
{ "<leader>qp", ":lua require'quarto'.quartoPreview()<cr>", desc = "quarto preview" },
{ "<leader>qq", ":lua require'quarto'.quartoClosePreview()<cr>", desc = "quarto close" },
{ "<leader>qh", ":QuartoHelp ", desc = "quarto help" },
{ "<leader>qe", ":lua require'otter'.export()<cr>", desc = "quarto export" },
{ "<leader>qE", ":lua require'otter'.export(true)<cr>", desc = "quarto export overwrite" },
{ "<leader>qrr", ":QuartoSendAbove<cr>", desc = "quarto run to cursor" },
{ "<leader>qra", ":QuartoSendAll<cr>", desc = "quarto run all" },
{ "<leader><cr>", ":SlimeSend<cr>", desc = "send code chunk" },
{ "<c-cr>", ":SlimeSend<cr>", desc = "send code chunk" },
{ "<c-cr>", "<esc>:SlimeSend<cr>i", mode = "i", desc = "send code chunk" },
{ "<c-cr>", "<Plug>SlimeRegionSend<cr>", mode = "v", desc = "send code chunk" },
{ "<cr>", "<Plug>SlimeRegionSend<cr>", mode = "v", desc = "send code chunk" },
{ "<leader>ctr", ":split term://R<cr>", desc = "terminal: R" },
{ "<leader>cti", ":split term://ipython<cr>", desc = "terminal: ipython" },
{ "<leader>ctp", ":split term://python<cr>", desc = "terminal: python" },
{ "<leader>ctj", ":split term://julia<cr>", desc = "terminal: julia" },
},
},
{
"jmbuhr/otter.nvim",
opts = {
buffers = {
set_filetype = true,
},
},
},
-- Disable nvchad plugins
{