Skip to content

Commit

Permalink
Rename alias s/gsc/glc/
Browse files Browse the repository at this point in the history
Git Save Command to Git Last Command
  • Loading branch information
kachick committed Oct 19, 2023
1 parent bdeb877 commit d03a314
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions home-manager/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
shellAliases = {
# git alias cannot get the interactive feature, so aliasing in shell layer
# https://unix.stackexchange.com/questions/212872/how-to-get-last-n-commands-from-history#comment1125605_212873
gsc = "git commit -a -m \"\\`$(fc -ln -1 | grep -Po '(\\S.*)')\\`\"";
glc = "git commit -a -m \"\\`$(fc -ln -1 | grep -Po '(\\S.*)')\\`\"";
};

historySize = 100000;
historyFile = "${config.xdg.stateHome}/bash/history";
historyFileSize = 4200000;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
# NOTE: I didn't check it should have different globs as zsh or not, at least the sepelator is not same.
historyIgnore = [ "cd" "pushd" "popd" "z" "ls" "ll" "la" "rm" "rmdir" "git show" "exit" "gsc" ];
historyIgnore = [ "cd" "pushd" "popd" "z" "ls" "ll" "la" "rm" "rmdir" "git show" "exit" "glc" ];

# Extracting because embedded here requires complex escape with nix multiline.
initExtra = ''
Expand Down
2 changes: 1 addition & 1 deletion home-manager/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

# `alias` will show current aliases
shellAliases = {
gsc = "git commit -a -m \"`$(history --max 1)`\"";
glc = "git commit -a -m \"`$(history --max 1)`\"";
};

plugins = [{
Expand Down
2 changes: 1 addition & 1 deletion home-manager/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
shellAliases = {
# git alias cannot get the interactive feature, so aliasing in shell layer
# https://unix.stackexchange.com/questions/212872/how-to-get-last-n-commands-from-history#comment1125605_212873
gsc = "git commit -a -m \"\\`$(fc -ln -1)\\`\"";
glc = "git commit -a -m \"\\`$(fc -ln -1)\\`\"";
};

history = {
Expand Down

0 comments on commit d03a314

Please sign in to comment.