mirror of
https://github.com/zoriya/flake.git
synced 2026-06-03 19:03:08 +00:00
Add cool git aliases
This commit is contained in:
@@ -27,6 +27,18 @@
|
|||||||
# # TODO: figure out a way to specify all repositories in ~/projects & ~/work at run time
|
# # TODO: figure out a way to specify all repositories in ~/projects & ~/work at run time
|
||||||
# repositories = [];
|
# repositories = [];
|
||||||
# };
|
# };
|
||||||
|
aliases = {
|
||||||
|
master =
|
||||||
|
#bash
|
||||||
|
''
|
||||||
|
!git symbolic-ref --short refs/remotes/$(git remote | head -n 1)/HEAD | sed 's@.*/@@'
|
||||||
|
'';
|
||||||
|
cleanup =
|
||||||
|
#bash
|
||||||
|
''
|
||||||
|
!git branch --merged | grep -vE "^([+*]|\s*($(git master))\s*$)" | xargs git branch --delete 2>/dev/null
|
||||||
|
'';
|
||||||
|
};
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
gpg.format = "ssh";
|
gpg.format = "ssh";
|
||||||
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
|
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
|
||||||
|
|||||||
+32
-28
@@ -249,35 +249,39 @@
|
|||||||
file = "share/oh-my-zsh/plugins/copyfile/copyfile.plugin.zsh";
|
file = "share/oh-my-zsh/plugins/copyfile/copyfile.plugin.zsh";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
initExtraFirst = ''
|
initExtraFirst =
|
||||||
# Create a new tmux session (with a random name) and attach.
|
#bash
|
||||||
if [[ -z "$TMUX" ]]; then
|
''
|
||||||
exec tmux -u new-session -s "#$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)"
|
# Create a new tmux session (with a random name) and attach.
|
||||||
elif [[ $SHLVL -eq 1 ]]; then
|
if [[ -z "$TMUX" ]]; then
|
||||||
session=$(tmux display-message -p "#S")
|
exec tmux -u new-session -s "#$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)"
|
||||||
# kill current sesion if we are quiting the only pane
|
elif [[ $SHLVL -eq 1 ]]; then
|
||||||
function __onExit {
|
session=$(tmux display-message -p "#S")
|
||||||
if [[ $(tmux list-panes -s -t $session | wc -l) == 1 ]]; then
|
# kill current sesion if we are quiting the only pane
|
||||||
tmux kill-session -t $session
|
function __onExit {
|
||||||
fi
|
if [[ $(tmux list-panes -s -t $session | wc -l) == 1 ]]; then
|
||||||
}
|
tmux kill-session -t $session
|
||||||
trap __onExit EXIT
|
fi
|
||||||
fi
|
}
|
||||||
'';
|
trap __onExit EXIT
|
||||||
|
fi
|
||||||
|
'';
|
||||||
initExtraBeforeCompInit = builtins.readFile ./comp.zsh;
|
initExtraBeforeCompInit = builtins.readFile ./comp.zsh;
|
||||||
completionInit = ''
|
completionInit =
|
||||||
# The globbing is a little complicated here:
|
#bash
|
||||||
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
|
''
|
||||||
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
|
# The globbing is a little complicated here:
|
||||||
# - '.' matches "regular files"
|
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
|
||||||
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.autoload -Uz compinit
|
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
|
||||||
autoload -Uz compinit
|
# - '.' matches "regular files"
|
||||||
if [[ -n $ZSH_CACHE_DIR/.zcompdump(#qN.mh+24) ]]; then
|
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.autoload -Uz compinit
|
||||||
compinit;
|
autoload -Uz compinit
|
||||||
else
|
if [[ -n $ZSH_CACHE_DIR/.zcompdump(#qN.mh+24) ]]; then
|
||||||
compinit -C;
|
compinit;
|
||||||
fi;
|
else
|
||||||
'';
|
compinit -C;
|
||||||
|
fi;
|
||||||
|
'';
|
||||||
initExtra = builtins.readFile ./init.zsh;
|
initExtra = builtins.readFile ./init.zsh;
|
||||||
|
|
||||||
envExtra = ''
|
envExtra = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user