aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.config/zsh')
-rw-r--r--dotfiles/.config/zsh/.zshrc8
-rw-r--r--dotfiles/.config/zsh/shortcuts14
2 files changed, 15 insertions, 7 deletions
diff --git a/dotfiles/.config/zsh/.zshrc b/dotfiles/.config/zsh/.zshrc
index 5684477..327c685 100644
--- a/dotfiles/.config/zsh/.zshrc
+++ b/dotfiles/.config/zsh/.zshrc
@@ -7,12 +7,10 @@ precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
if [ "$USER" = "root" ]; then
- # Make it so that we display root's user@host on the left and colored red so
- # that it is quite clear that we are under root.
- PROMPT=$'\n''%{%}%B%~ ${reset_color}%F{yellow}${vcs_info_msg_0_}%f'$'\n''%F{red}%n%f@%F{red}%m%f %F{green}→%f '
+ # Display root's user colored red so that 'tis quite clear when we are root.
+ PROMPT=$'\n''%F{red}%n@%F{red}%m:%f%B%~ ${reset_color}%F{yellow}${vcs_info_msg_0_}%f'$'\n''%F{green}└%*#%f '
else
- PROMPT=$'\n''%{%}%B%~ ${reset_color}%F{yellow}${vcs_info_msg_0_}%f'$'\n''%F{green}→%f '
- RPROMPT='%{%} %n%f@%F{red}%m%f'
+ PROMPT=$'\n''%{%}%n@%F{red}%m:%f%B%~ ${reset_color}%F{yellow}${vcs_info_msg_0_}%f'$'\n''%F{green}└%*→%f '
fi
zstyle ':vcs_info:git:*' formats ' %b'
diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts
index 63343ce..77ef9bf 100644
--- a/dotfiles/.config/zsh/shortcuts
+++ b/dotfiles/.config/zsh/shortcuts
@@ -55,7 +55,7 @@ bindkey '^F' fzf-file-widget
bindkey '^A' fzf-cd-widget
# Function for changing working dir after exiting lf
-lfcd () {
+lfcd() {
tmp="$(mktemp)"
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
@@ -86,13 +86,23 @@ alias YT="youtube-viewer"
alias starwars="telnet towel.blinkenlights.nl"
# git
-gitcc () {
+gitcc() {
git clone "$(wl-paste --no-newline)"
}
+gitdel() {
+ git branch -D $2
+ git push -d $1 $2
+}
+
# Audio
alias mute="lmc mute"
alias vu="lmc up 5"
alias vd="lmc down 5"
+# Split tunneling with network namespaces
+fnetexec() {
+ sudo -E ip netns exec freenet sudo -E -u \#$(id -u) -g \#$(id -g) "$@";
+}
+
[ -f "$XDG_CONFIG_HOME/zsh/private" ] && . "$XDG_CONFIG_HOME/zsh/private"