Skip to content

Commit

Permalink
Misc changes (#304)
Browse files Browse the repository at this point in the history
* Enable rounded corners for zellij

* Set default zellij layout to compact

* Setup infrastructure to create globally available custom layouts for zellij

* Update some git aliases

* Update some gh aliases

* Set helix as default editor

* Remove alias for bat

* Improve helix config

- Setup different cursor shapes for different modes to identify them more easily
- Disable mouse related stuff
- Setup ruler
- Disable movement keys when in insert modes

* Fix gh alias
  • Loading branch information
francishamel authored Sep 8, 2024
1 parent 57f4a31 commit 1b86b5b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 19 deletions.
8 changes: 2 additions & 6 deletions home-manager/modules/bat.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{ pkgs, ... }:
{ ... }:

{
programs = {
bat.enable = true;

zsh.shellAliases."cat" = "${pkgs.bat}/bin/bat";
};
programs.bat.enable = true;
}
10 changes: 6 additions & 4 deletions home-manager/modules/git.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{ config, pkgs, ... }:
{ config, ... }:

{
programs.git = {
userName = "Francis Hamel";
userEmail = "[email protected]";
aliases = {
ca = "commit --amend";
ca = "commit --amend --no-edit";
cae = "commit --amend";
cf = "commit --fixup";
fp = "fetch --prune";
pfwl = "push --force-with-lease";
ri = "rebase --interactive";
};
enable = true;
extraConfig = {
core.editor = "${pkgs.vscode}/bin/code --wait";
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
pull.rebase = true;
Expand All @@ -30,11 +30,13 @@
gitCredentialHelper.enable = false;
settings = {
aliases = {
"ic" = "issue create --web";
"id" = "issue develop $1 --checkout";
"il" = "issue list";
"prc" = "pr create --web --assignee @me";
"prv" = "pr view --web";
"rc" = "repo clone $1 ${config.home.homeDirectory}/src/$1";
};
editor = "${pkgs.vscode}/bin/code --wait";
git_protocol = "ssh";
};
};
Expand Down
29 changes: 26 additions & 3 deletions home-manager/modules/helix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ in
{
programs.helix = {
enable = true;
defaultEditor = true;
languages = {
language = [
{
Expand All @@ -28,9 +29,31 @@ in
];
};
settings = {
editor.line-number = "relative";
keys.normal = {
"C-y" = lib.mkIf config.programs.yazi.enable ":sh ${pkgs.zellij}/bin/zellij run -f -n yazi-picker -x 10% -y 10% --width 80% --height 80% -- ${yaziPicker}/bin/yazi-picker";
editor = {
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
line-number = "relative";
middle-click-paste = false;
mouse = false;
rulers = [ 120 ];
};
keys = {
normal = {
"C-y" = lib.mkIf config.programs.yazi.enable ":sh ${pkgs.zellij}/bin/zellij run -f -n yazi-picker -x 10% -y 10% --width 80% --height 80% -- ${yaziPicker}/bin/yazi-picker";
};
insert = {
up = "no_op";
down = "no_op";
left = "no_op";
right = "no_op";
pageup = "no_op";
pagedown = "no_op";
home = "no_op";
end = "no_op";
};
};
};
};
Expand Down
6 changes: 0 additions & 6 deletions home-manager/modules/vscode.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,4 @@
"workbench.startupEditor" = "none";
};
};

programs.zsh = {
initExtra = ''
EDITOR="${pkgs.vscode}/bin/code --wait"
'';
};
}
7 changes: 7 additions & 0 deletions home-manager/modules/zellij.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
enable = true;
enableZshIntegration = true;
settings = {
default_layout = "compact";
on_force_close = "quit";
ui.pane_frames.rounded_corners = true;
};
};

xdg.configFile."zellij/layouts" = {
recursive = true;
source = ./zellij/layouts;
};
}
Empty file.

0 comments on commit 1b86b5b

Please sign in to comment.