1
0
Fork 0

some plugins

This commit is contained in:
zymon 2024-09-08 18:27:11 +02:00
parent 2d3a785a76
commit 59bae3ef87
2 changed files with 134 additions and 2 deletions

View file

@ -1 +1,133 @@
return {}
return {
{ -- display undo tree for a file
"https://github.com/mbbill/undotree",
cmd = "UndotreeToggle",
keys = {
{ "<leader>ut", "<cmd>UndotreeToggle<cr>", desc = "undo tree" },
},
},
{ -- markview.nvim
"https://github.com/OXY2DEV/markview.nvim",
ft = 'markdown',
keys = {
{ -- toggle markview rendering
"<localleader>t",
"<cmd>Markview toggle<cr>",
desc = "Toggle markdown rendering",
ft = "markdown"
},
},
opts = {
modes = { "n", "i", "no", "c" },
hybrid_modes = { "i" },
callbacks = {
on_enable = function (_, win)
vim.wo[win].conceallevel = 2;
vim.wo[win].concealcursor = "nc";
end
}
},
},
{ -- repl integration
"https://github.com/Vigemus/iron.nvim",
keys = {
{ "<leader>rs", "<cmd>IronRepl<cr>", desc = "Show/start REPL" },
{ "<leader>rh", "<cmd>IronHide<cr>", desc = "Hide REPL" },
{ "<leader>rf", "<cmd>IronFocus<cr>", desc = "Focus REPL" },
{ "<leader>rr", "<cmd>IronRestart<cr>", desc = "Restart REPL" },
{ "<leader>rq", function() require("iron").core.close_repl(vim.bo.filetype) end, desc = "Quit REPL" },
},
opts = {
config = {
-- Whether a repl should be discarded or not
scratch_repl = true,
-- Your repl definitions come here
repl_definition = {
sh = {
-- Can be a table or a function that
-- returns a table (see below)
command = {"zsh"}
},
julia = {
command = {"julia", "--project", "--threads", "4"},
},
},
repl_open_cmd = "vertical botright 80 split", -- require("iron").view.split.vertical.botright(100),
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
keymaps = {
send_motion = "<leader>ss",
visual_send = "<leader>ss",
send_file = "<space>sf",
send_line = "<space>sl",
send_until_cursor = "<space>su",
-- send_mark = "<space>sm",
mark_motion = "<space>mc",
mark_visual = "<space>mc",
remove_mark = "<space>md",
cr = "<space>s<cr>",
interrupt = "<space>s<space>",
clear = "<space>cl",
},
-- If the highlight is on, you can change how it looks
-- For the available options, check nvim_set_hl
highlight = {
italic = false,
},
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
},
config = function (_, opts)
local iron = require("iron.core")
iron.setup(opts)
IronSendCell = function(next_cell)
-- source: https://github.com/Vigemus/iron.nvim/issues/236#issuecomment-1317674256
local iron_core = require('iron.core')
local marks = require('iron.marks')
local cell_pattern = "^\\s*##" -- cell delimiter pattern
local cell_start = vim.fn.search(cell_pattern, 'bcnW')
local cell_end = vim.fn.search(cell_pattern, 'nW')
local lines = vim.api.nvim_buf_get_lines(0, cell_start, cell_end-1, 0)
-- ignore blank lines
local b_lines = {}
for _, line in ipairs(lines) do
if line:gsub("^%s*(.-)%s*$", "%1") ~= '' then
table.insert(b_lines, line)
end
end
if #b_lines == 0 then return end
if cell_start == 0 then
cell_start = 1 -- if first cell, then start from first line
end
if cell_end == 0 then
cell_end = vim.fn.line('$') -- set to last line
end
marks.set{ from_line=cell_start, from_col=0, to_line=cell_end, to_col=-1 }
marks.winrestview()
iron_core.send(nil, b_lines)
if next_cell == true then
vim.fn.cursor(cell_end+1, 0) -- move to next cell start
end
end
vim.keymap.set('n', '<space>sc', function () IronSendCell(false) end)
vim.keymap.set('n', '<space>sC', function () IronSendCell(true) end)
vim.cmd("nmap <leader>sp <leader>ssap")
end
},
{ -- neodev
"https://github.com/folke/lazydev.nvim",
ft = "lua",
},
{ -- A better user experience for interacting with and manipulating marks
"https://github.com/chentoast/marks.nvim",
event = "BufReadPost",
config = true,
},
}

View file

@ -157,7 +157,7 @@ return {
-- "neocmake",
"dockerls",
"elixirls",
"fennel_ls",
-- "fennel_ls",
"fortls",
"html",
"biome", -- js + json