restore jj/jjui alongside git
This commit is contained in:
5
profiles/jjui.nix
Normal file
5
profiles/jjui.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
programs.jjui = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
60
profiles/jujutsu.nix
Normal file
60
profiles/jujutsu.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
name = "Christoph Schmatzler";
|
||||
email = "christoph@schmatzler.com";
|
||||
};
|
||||
git = {
|
||||
sign-on-push = true;
|
||||
subprocess = true;
|
||||
write-change-id-header = true;
|
||||
private-commits = "description(glob:'wip:*') | description(glob:'WIP:*') | description(exact:'')";
|
||||
};
|
||||
fsmonitor = {
|
||||
backend = "watchman";
|
||||
};
|
||||
ui = {
|
||||
default-command = "status";
|
||||
diff-formatter = ":git";
|
||||
pager = ["delta" "--pager" "less -FRX"];
|
||||
diff-editor = ["nvim" "-c" "DiffEditor $left $right $output"];
|
||||
movement = {
|
||||
edit = true;
|
||||
};
|
||||
};
|
||||
aliases = {
|
||||
n = ["new"];
|
||||
tug = ["bookmark" "move" "--from" "closest_bookmark(@-)" "--to" "@-"];
|
||||
stack = ["log" "-r" "stack()"];
|
||||
retrunk = ["rebase" "-d" "trunk()"];
|
||||
bm = ["bookmark"];
|
||||
gf = ["git" "fetch"];
|
||||
gp = ["git" "push"];
|
||||
};
|
||||
revset-aliases = {
|
||||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||||
"closest_pushable(to)" = "heads(::to & mutable() & ~description(exact:\"\") & (~empty() | merges()))";
|
||||
"mine()" = "author(\"christoph@schmatzler.com\")";
|
||||
"wip()" = "mine() ~ immutable()";
|
||||
"open()" = "mine() ~ ::trunk()";
|
||||
"current()" = "@:: & mutable()";
|
||||
"stack()" = "reachable(@, mutable())";
|
||||
};
|
||||
templates = {
|
||||
draft_commit_description = ''
|
||||
concat(
|
||||
coalesce(description, default_commit_description, "\n"),
|
||||
surround(
|
||||
"\nJJ: This commit contains the following changes:\n", "",
|
||||
indent("JJ: ", diff.stat(72)),
|
||||
),
|
||||
"\nJJ: ignore-rest\n",
|
||||
diff.git(),
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
./plugins/grug-far.nix
|
||||
./plugins/harpoon.nix
|
||||
./plugins/hunk.nix
|
||||
./plugins/jj-diffconflicts.nix
|
||||
./plugins/lsp.nix
|
||||
./plugins/mini.nix
|
||||
./plugins/oil.nix
|
||||
|
||||
@@ -118,15 +118,21 @@
|
||||
options.desc = "Visit paths (cwd)";
|
||||
}
|
||||
# g - git
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gc";
|
||||
action = ":JJDiffConflicts<CR>";
|
||||
options.desc = "Resolve conflicts";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>gg";
|
||||
action.__raw = ''
|
||||
function()
|
||||
require('toggleterm.terminal').Terminal:new({ cmd = 'lazygit', direction = 'float' }):toggle()
|
||||
end
|
||||
function()
|
||||
require('toggleterm.terminal').Terminal:new({ cmd = 'jjui', direction = 'float' }):toggle()
|
||||
end
|
||||
'';
|
||||
options.desc = "lazygit";
|
||||
options.desc = "jjui";
|
||||
}
|
||||
# l - lsp/formatter
|
||||
{
|
||||
|
||||
14
profiles/neovim/plugins/jj-diffconflicts.nix
Normal file
14
profiles/neovim/plugins/jj-diffconflicts.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{pkgs, ...}: {
|
||||
programs.nixvim.extraPlugins = [
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "jj-diffconflicts";
|
||||
src =
|
||||
pkgs.fetchFromGitHub {
|
||||
owner = "rafikdraoui";
|
||||
repo = "jj-diffconflicts";
|
||||
rev = "main";
|
||||
hash = "sha256-hvMXpslucywVYA9Sdxx6IcXQXYcYNWK8s9jr+KtStdI=";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -28,6 +28,8 @@ with pkgs;
|
||||
hledger
|
||||
htop
|
||||
hyperfine
|
||||
jj-ryu
|
||||
jj-starship
|
||||
jq
|
||||
killall
|
||||
lsof
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
settings = {
|
||||
add_newline = true;
|
||||
command_timeout = 2000;
|
||||
format = "$directory$git_branch$git_status$character";
|
||||
format = "$directory$git_branch$git_status$\{custom.scm}$character";
|
||||
character = {
|
||||
error_symbol = "[✗ ](bold #e64553)";
|
||||
success_symbol = "[❯](bold #40a02b)[❯](bold #df8e1d)[❯](bold #dc8a78)";
|
||||
@@ -37,6 +37,11 @@
|
||||
renamed = "mv:$count ";
|
||||
deleted = "del:$count ";
|
||||
};
|
||||
custom.scm = {
|
||||
when = "jj-starship detect";
|
||||
shell = ["jj-starship" "--strip-bookmark-prefix" "cschmatzler/" "--truncate-name" "20" "--bookmarks-display-limit" "1"];
|
||||
format = "$output ";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user