Skip to content

Commit

Permalink
molten
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuhr committed Dec 20, 2024
1 parent aa6b518 commit ce71177
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 41 deletions.
23 changes: 5 additions & 18 deletions lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ return {
'jmbuhr/cmp-pandoc-references',
dev = false,
ft = { 'quarto', 'markdown', 'rmarkdown' },
config = function()
-- vim.api.nvim_create_autocmd('FileType', {
-- pattern = { "markdown", "quarto", "rmarkdown" },
-- callback = function()
-- require('cmp-pandoc-references.lsp').start()
-- end
-- })
end
},
{ 'hrsh7th/cmp-emoji' },
{ 'kdheepak/cmp-latex-symbols' },
Expand All @@ -59,21 +51,16 @@ return {

sources = {
completion = {
enabled_providers = { "lsp", "path", "snippets", "buffer", "lazydev", "references", "emoji", "symbols" },
enabled_providers = { "lsp", "path", "snippets", "buffer", "lazydev" },
},
providers = {
-- dont show LuaLS require statements when lazydev has items
lsp = { fallback_for = { "lazydev" } },
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
references = {
name = "pandoc_references",
module = "blink.compat.source",
-- opts = {
-- impersonate_nvim_cmp = true,
-- enable_events = true,
-- debug = true,
-- }
},
-- references = {
-- name = "pandoc_references",
-- module = "blink.compat.source",
-- },
emoji = { name = "emoji", module = "blink.compat.source" },
symbols = { name = "symbols", module = "blink.compat.source" },
},
Expand Down
10 changes: 5 additions & 5 deletions lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ return {
-- Add additional languages here.
-- See `:h lspconfig-all` for the configuration.
-- Like e.g. Haskell:
lspconfig.hls.setup {
capabilities = capabilities,
flags = lsp_flags,
filetypes = { 'haskell', 'lhaskell', 'cabal' },
}
-- lspconfig.hls.setup {
-- capabilities = capabilities,
-- flags = lsp_flags,
-- filetypes = { 'haskell', 'lhaskell', 'cabal' },
-- }

lspconfig.clangd.setup {
capabilities = capabilities,
Expand Down
44 changes: 30 additions & 14 deletions 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 Expand Up @@ -128,23 +128,39 @@ return {
{
'benlubas/molten-nvim',
dev = false,
enabled = false,
enabled = true,
version = "^1.0.0", -- use version <2.0.0 to avoid breaking changes
build = ':UpdateRemotePlugins',
init = function()
vim.g.molten_image_provider = 'image.nvim'
vim.g.molten_output_win_max_height = 20
-- vim.g.molten_output_win_max_height = 20
vim.g.molten_auto_open_output = true
vim.g.molten_auto_open_html_in_browser = true
vim.g.molten_tick_rate = 200
end,
config = function()
local init = function()
local quarto_cfg = require'quarto.config'.config
quarto_cfg.codeRunner.default_method = "molten"
vim.cmd[[MoltenInit]]
end
local deinit = function()
local quarto_cfg = require'quarto.config'.config
quarto_cfg.codeRunner.default_method = "slime"
vim.cmd[[MoltenDeinit]]
end
vim.keymap.set("n", "<localleader>mi", init,
{ silent = true, desc = "Initialize molten" })
vim.keymap.set("n", "<localleader>md", deinit,
{ silent = true, desc = "Stop molten" })
vim.keymap.set("n", "<localleader>mp", ":MoltenImagePopup<CR>",
{ silent = true, desc = "molten image popup" })
vim.keymap.set("n", "<localleader>mb", ":MoltenOpenInBrowser<CR>",
{ silent = true, desc = "molten open in browser" })
vim.keymap.set("n", "<localleader>mh", ":MoltenHideOutput<CR>",
{ silent = true, desc = "hide output" })
vim.keymap.set("n", "<localleader>ms", ":noautocmd MoltenEnterOutput<CR>",
{ silent = true, desc = "show/enter output" })
end,
keys = {
{ '<leader>mi', ':MoltenInit<cr>', desc = '[m]olten [i]nit' },
{ '<leader>md', ':MoltenDeinit<cr>', desc = '[m]olten [d]einit' },
{
'<leader>mv',
':<C-u>MoltenEvaluateVisual<cr>',
mode = 'v',
desc = 'molten eval visual',
},
{ '<leader>mr', ':MoltenReevaluateCell<cr>', desc = 'molten re-eval cell' },
},
},
}
8 changes: 4 additions & 4 deletions lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ return {
window_overlap_clear_enabled = true,
tmux_show_only_in_active_window = true,
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', 'scrollview', 'scrollview_sign' },
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 30,
max_width = 100,
max_height = 14,
max_height_window_percentage = math.huge,
max_width_window_percentage = math.huge,
kitty_method = 'normal',
}

Expand Down

0 comments on commit ce71177

Please sign in to comment.