Add split options for jj pickers

This commit is contained in:
2026-04-15 20:18:22 +02:00
parent 4426bbe23e
commit 41e36c4807
6 changed files with 51 additions and 28 deletions
+21 -1
View File
@@ -132,6 +132,8 @@ Snacks.picker.jj_log = function(file)
["<a-e>"] = { "jj_edit", mode = { "i" } },
["<a-s>"] = { "jj_squash", mode = { "i" } },
["<a-i>"] = { "jj_squash_interactive", mode = { "i" } },
["<c-s>"] = { "jj_gsplit", mode = { "i" } },
["<c-v>"] = { "jj_gvsplit", mode = { "i" } },
},
},
},
@@ -148,6 +150,14 @@ Snacks.picker.jj_log = function(file)
picker:close()
vim.cmd(string.format("J squash -i -r %s", item.change_id))
end,
jj_gsplit = function(picker, item)
picker:close()
vim.cmd('Gsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. file))
end,
jj_gvsplit = function(picker, item)
picker:close()
vim.cmd('Gvsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. file))
end,
},
})
end
@@ -235,6 +245,8 @@ Snacks.picker.jj_show = function(ref)
input = {
keys = {
["<a-s>"] = { "jj_split", mode = { "i" } },
["<c-s>"] = { "jj_gsplit", mode = { "i" } },
["<c-v>"] = { "jj_gvsplit", mode = { "i" } },
},
},
},
@@ -248,7 +260,15 @@ Snacks.picker.jj_show = function(ref)
'J split "\'%s\'"',
table.concat(items, "' | '")
))
end
end,
jj_gsplit = function(picker, item)
picker:close()
vim.cmd('Gvsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file))
end,
jj_gvsplit = function(picker, item)
picker:close()
vim.cmd('Gsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file))
end,
},
})
end
+1 -24
View File
@@ -20,7 +20,7 @@ vim.lsp.enable({
"tailwindcss",
"sqls",
"qmlls",
"roslyn_ls", --we use roslyn.nvim plugin instead.
"roslyn_ls",
})
-- vim.api.nvim_create_autocmd("LspAttach", {
@@ -36,26 +36,3 @@ vim.lsp.on_type_formatting.enable()
vim.lsp.document_color.enable(true, nil, { style = "virtual" })
return {}
-- return {
-- -- see https://github.com/seblyng/roslyn.nvim/pull/178
-- {
-- "roslyn.nvim",
-- ft = { "cs", "vb" },
-- opts = {
-- broad_search = true,
-- },
-- after = function(plug)
-- vim.lsp.config("roslyn", {
-- cmd = {
-- 'Microsoft.CodeAnalysis.LanguageServer',
-- '--logLevel',
-- 'Information',
-- '--extensionLogDirectory',
-- vim.fs.joinpath(vim.uv.os_tmpdir(), 'roslyn_ls/logs'),
-- '--stdio',
-- },
-- })
-- require("roslyn").setup(plug.opts)
-- end,
-- },
-- }