From 56297902e9d0f7a14f6d4d88b24eaea7392f3c32 Mon Sep 17 00:00:00 2001 From: Andras Svraka Date: Thu, 16 Jan 2020 18:19:56 +0100 Subject: lib: add MSYS2 support to clipboard integration (#8542) --- lib/clipboard.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 2c93d1bb5..5bba11d16 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -24,7 +24,7 @@ function clipcopy() { else cat $file | pbcopy fi - elif [[ $OSTYPE == cygwin* ]]; then + elif [[ $OSTYPE == (cygwin|msys)* ]]; then if [[ -z $file ]]; then cat > /dev/clipboard else @@ -71,7 +71,7 @@ function clippaste() { emulate -L zsh if [[ $OSTYPE == darwin* ]]; then pbpaste - elif [[ $OSTYPE == cygwin* ]]; then + elif [[ $OSTYPE == (cygwin|msys)* ]]; then cat /dev/clipboard else if (( $+commands[xclip] )); then -- cgit v1.2.3-70-g09d2 From 1c300d3a76a786a83e8a70b7a399db94c8bcf5b7 Mon Sep 17 00:00:00 2001 From: Evan Chiu Date: Sun, 10 Apr 2016 17:32:37 -0700 Subject: lib: add git function to determine repository name (#4989) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4989 Co-authored-by: Marc Cornellà --- lib/git.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/git.zsh b/lib/git.zsh index 2054fe272..00cb00b19 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -199,3 +199,12 @@ function git_current_user_name() { function git_current_user_email() { command git config user.email 2>/dev/null } + +# Output the name of the root directory of the git repository +# Usage example: $(git_repo_name) +function git_repo_name() { + local repo_path + if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then + echo ${repo_path:t} + fi +} -- cgit v1.2.3-70-g09d2 From 17428f3c9a99c8d81e57bcf565d39011669e65ed Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 11 Feb 2020 20:16:43 +0100 Subject: lib: load bash completion functions automatically Fixes #8614 --- lib/completion.zsh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/completion.zsh b/lib/completion.zsh index c7db2eb7b..c932bc925 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -71,3 +71,6 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then zle -N expand-or-complete-with-dots bindkey "^I" expand-or-complete-with-dots fi + +# automatically load bash completion functions +autoload -Uz bashcompinit && bashcompinit -- cgit v1.2.3-70-g09d2