home: zed and lazygit config

This commit is contained in:
Joakim Repomaa
2025-03-30 20:13:24 +03:00
parent 9bac7b2da9
commit e44dba355a
2 changed files with 38 additions and 6 deletions

View File

@@ -220,9 +220,10 @@
branchLogCmd = "git log {{branchName}} --first-parent --color=always --pretty=format:'%Cgreen%h%Creset %Cblue%aN%Creset %C(cyan)%<(14)%ar%Creset %s' --abbrev-commit"; branchLogCmd = "git log {{branchName}} --first-parent --color=always --pretty=format:'%Cgreen%h%Creset %Cblue%aN%Creset %C(cyan)%<(14)%ar%Creset %s' --abbrev-commit";
}; };
os = { os = {
edit = "$EDITOR {{filename}}"; edit = "\${EDITOR} -- {{filename}}";
editAtLine = "$EDITOR {{filename}}:{{line}}"; editAtLine = "\${EDITOR} -- {{filename}}:{{line}}";
editAtLineAndWait = "$EDITOR --wait {{filename}}:{{line}}"; editAtLineAndWait = "\${EDITOR} --wait -- {{filename}}:{{line}}";
openDirInEditor = "\${EDITOR} -- {{dir}}";
}; };
promptToReturnFromSubprocess = false; promptToReturnFromSubprocess = false;
keybinding = { keybinding = {
@@ -246,6 +247,21 @@
gh pr view --web gh pr view --web
''; '';
} }
{
key = "N";
context = "localBranches";
prompts = [
{
type = "input";
title = "New Branch Name:";
key = "BranchName";
initialValue = "{{.SelectedLocalBranch.Name}}_review";
}
];
command = ''
git checkout -b {{.Form.BranchName | quote}}
'';
}
]; ];
}; };
}; };

View File

@@ -123,6 +123,12 @@ in
buffer_font_size = 16; buffer_font_size = 16;
ui_font_size = 17; ui_font_size = 17;
relative_line_numbers = true; relative_line_numbers = true;
file_types = {
JSONC = [
"tsconfig.json"
"tsconfig.*.json"
];
};
}; };
userKeymaps = [ userKeymaps = [
{ {
@@ -176,10 +182,20 @@ in
} }
]; ];
userTasks = with pkgs; [ userTasks = [
{ {
label = "lazygit"; label = "lazygit";
command = "${lib.getExe lazygit} -p $ZED_WORKTREE_ROOT"; command = lib.getExe config.programs.lazygit.package;
env = {
EDITOR = lib.getExe cfg.package;
};
args = [
"-p"
"$ZED_WORKTREE_ROOT"
];
reveal = "always";
allow_concurrent_runs = true;
use_new_terminal = false;
hide = "on_success"; hide = "on_success";
} }
]; ];
@@ -188,7 +204,7 @@ in
xdg.configFile."zed/tasks.json".text = builtins.toJSON cfg.userTasks; xdg.configFile."zed/tasks.json".text = builtins.toJSON cfg.userTasks;
home.sessionVariables = lib.mkIf cfg.defaultEditor { home.sessionVariables = lib.mkIf cfg.defaultEditor {
EDITOR = lib.getExe pkgs.zed-editor; EDITOR = lib.getExe cfg.package;
}; };
}; };
} }