mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 02:36:07 +00:00
Now it is possible to rebase interactively from the log buffer with visual feedback. You can rebase one or many visually selected changes. Supported target modes are: `-o` / `-A` / `-B`. Limitation: - As of now you cannot rebase a whole branch (-b) from the log view. Bonus from this pr: - Now keymaps support different modes
49 lines
1.3 KiB
Lua
49 lines
1.3 KiB
Lua
local M = {}
|
|
local cmd = require("jj.cmd")
|
|
local picker = require("jj.picker")
|
|
local editor = require("jj.ui.editor")
|
|
local terminal = require("jj.ui.terminal")
|
|
|
|
--- Jujutsu plugin configuration
|
|
--- @class jj.Config
|
|
--- @field cmd? jj.cmd.opts Options for command module
|
|
--- @field picker? jj.picker.config Options for picker module
|
|
--- @field terminal? jj.ui.terminal.opts Options for the terminal
|
|
--- @field highlights? jj.highlights Options for the highlights
|
|
|
|
--- @class jj.highlights
|
|
--- @field editor? jj.ui.editor.highlights Highlight configuration for describe buffer
|
|
--- @field log? jj.cmd.log.highlights Highlight configuration for the log buffer
|
|
|
|
---@type jj.Config
|
|
M.config = {
|
|
picker = {
|
|
snacks = {},
|
|
},
|
|
highlights = {
|
|
editor = {
|
|
renamed = { fg = "#d29922", ctermfg = "Yellow" },
|
|
},
|
|
log = {
|
|
selected = { bg = "#3d2c52", ctermbg = "DarkMagenta" },
|
|
targeted = { fg = "#5a9e6f", ctermfg = "Green" },
|
|
},
|
|
},
|
|
}
|
|
|
|
--- Setup the plugin
|
|
--- @param opts jj.Config: Options to configure the plugin
|
|
function M.setup(opts)
|
|
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
|
|
|
|
-- Setup for sub-modules
|
|
picker.setup(opts and opts.picker or {})
|
|
editor.setup({ highlights = M.config.highlights.editor })
|
|
cmd.setup(opts and opts.cmd or {})
|
|
terminal.setup(opts and opts.terminal or {})
|
|
|
|
cmd.register_command()
|
|
end
|
|
|
|
return M
|