From 67a44a5ff8406d96c5fb718d3855cb36119d4ea0 Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Mon, 27 Nov 2023 23:32:20 +0100 Subject: [PATCH] zsh --- zsh/.zshrc | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index de9141d..338b0d8 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,3 +1,4 @@ +# zmodload zsh/zprof # Start configuration added by Zim install {{{ # # User configuration sourced by interactive shells @@ -32,6 +33,8 @@ WORDCHARS=${WORDCHARS//[\/]} export ZIM_HOME=$HOME/.zim +export MPD_HOST=fsi-hase.fsmi.uni-karlsruhe.de + # -------------------- # Module configuration @@ -127,14 +130,15 @@ autoload compinit; compinit autoload -U +X bashcompinit && bashcompinit export FZF_DEFAULT_COMMAND='fd --type f' -source /usr/share/fzf/completion.zsh +source /usr/share/fzf-tab-completion/zsh/fzf-zsh-completion.sh source /usr/share/fzf/key-bindings.zsh alias pdfdiff="diffpdf" alias cb="xclip -sel clipboard" alias vi="nvim" alias vim="nvim" -alias ls="exa" +alias ls="eza" +alias lln="eza -l -snew --time-style relative" # GPG for SSH export GPG_TTY="$(tty)" @@ -212,3 +216,28 @@ function calc() { fi printf "\n" } + +bindkey "^[[H" beginning-of-line # wtf why is this suddenly broken? + +function ghcd() { + if [[ -d "/tmp/github/$@" ]]; then + pushd "/tmp/github/$@" + return + fi + + local repo=$(gh search repos "$@" | fzf --exit-0 | cut -f1) + local repo_path="/tmp/github/${repo:t}" + + [[ -z "$repo" ]] && return 1 + [[ ! -d /tmp/github ]] && mkdir /tmp/github + + if [[ -d "$repo_path" ]]; then + pushd "$repo_path" + return + fi + + gh repo clone "$repo" "$repo_path" \ + && pushd "$repo_path" +} +# zprof +