Skip to content

Commit

Permalink
pack(jj): Add lazyjj
Browse files Browse the repository at this point in the history
  • Loading branch information
Cretezy committed May 24, 2024
1 parent 8730395 commit 2c13138
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/astrocommunity/pack/jj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ This plugin pack does the following:
- `<Leader>jd` for files with changes, like `jj diff`
- `<Leader>jc` for files with conflicts, like `jj resolve --list`
- Adds syntax highlighting for `.jjdescription` files (for use with `jj describe`) with [vim-jjdescription](https://github.com/avm99963/vim-jjdescription)
- Adds a [lazyjj](https://github.com/Cretezy/lazyjj) (TUI for jj) terminal with `<Leader>jl`
19 changes: 19 additions & 0 deletions lua/astrocommunity/pack/jj/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,23 @@ return {
},
},
{ "avm99963/vim-jjdescription" },
{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
["<Leader>jl"] = {
function()
local astro = require "astrocore"
local worktree = astro.file_worktree()
local flags = worktree and ("--path '%s'"):format(worktree.toplevel, worktree.gitdir) or ""
astro.toggle_term_cmd("lazyjj " .. flags)
end,
desc = "lazyjj",
},
},
},
},
},
}

0 comments on commit 2c13138

Please sign in to comment.