From 1ddd9d746234a1cfae92bc296a499a09751291dc Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 28 Sep 2023 15:23:20 +0200 Subject: don't use plugins anymore --- config/essentials/zsh/.zshrc | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 1260bb0..50d1bfa 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -25,24 +25,9 @@ zle -N add-surround surround zle -N change-surround surround compinit -if grep -qi "debian\|ubuntu" /usr/lib/os-release /etc/os-release 2>/dev/null -then - sfiles=( - /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh - /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - ) -else - sfiles=( - /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh - /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh) -fi -sfiles+=( - ~/.config/zsh/functions.zsh - ~/.config/zsh/aliases.sh -) -for f in "${sfiles[@]}"; do - test -f "$f" && source "$f" -done +# Source files +. $ZDOTDIR/functions.zsh +. $ZDOTDIR/aliases.sh bindkey -v bindkey -a cs change-surround -- cgit v1.2.3 From 25c1f50842cb643b95c8ac38eb1f4aa4cac4d0da Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 28 Sep 2023 15:23:34 +0200 Subject: added dotnet completion --- config/essentials/zsh/.zshrc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 50d1bfa..9b6fa48 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -122,6 +122,23 @@ parse_git_status() { git status --short 2> /dev/null | head -n1 | awk '{print $1 " "}' } +# Completion +_dotnet_zsh_complete() +{ + local completions=("$(dotnet complete "$words")") + + # If the completion list is empty, just continue with filename selection + if [ -z "$completions" ] + then + _arguments '*::arguments: _normal' + return + fi + + # This is not a variable assignment, don't remove spaces! + _values = "${(ps:\n:)completions}" +} +compdef _dotnet_zsh_complete dotnet + export REPORTTIME=2 export TIMEFMT="-> %*E" # override built-in time command -- cgit v1.2.3 From d9b55a1b4ce254afce95ec836d819d19da5b0d6e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 5 Oct 2023 16:23:54 +0200 Subject: changed parse_branch and added it to supd --- bin/extra/supd | 7 +++++-- config/essentials/zsh/.zshrc | 11 +++-------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/bin/extra/supd b/bin/extra/supd index 83a606b..4975b94 100755 --- a/bin/extra/supd +++ b/bin/extra/supd @@ -19,8 +19,11 @@ check () printf 'Up to date.' || printf 'Couldn'\''t update.' printf ' ' - printf '%s\n' "$(git status --short 2> /dev/null | - awk 'NR==1 {print $1}')" + printf '%s %s\n' "$(git status --short 2> /dev/null | + awk 'NR==1 {print $1}')" "$(git branch -v 2>/dev/null | + grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' | + sed 's/ahead/↑/;s/behind/↓/;s/\*//')" + done } diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 9b6fa48..2499c45 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -106,14 +106,9 @@ RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(par setopt prompt_subst parse_git_remote() { - b="$(git branch -v 2>/dev/null | grep "^*" | cut -f2 -d'[' | cut -f1 -d' ')" - if [ "$b" = "behind" ] - then - printf "↓ " - elif [ "$b" = "ahead" ] - then - printf "↑ " - fi + git branch -v 2>/dev/null | + grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' | + sed 's/ahead/↑/;s/behind/↓/;s/\*//' } parse_git_branch() { git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null -- cgit v1.2.3 From 171ea6ca8655a7e1831e6b89af70147246c376cf Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 8 Oct 2023 17:07:20 +0200 Subject: added space after sign --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 2499c45..d324e19 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -108,7 +108,7 @@ setopt prompt_subst parse_git_remote() { git branch -v 2>/dev/null | grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' | - sed 's/ahead/↑/;s/behind/↓/;s/\*//' + sed 's/ahead/↑ /;s/behind/↓ /;s/\*//' } parse_git_branch() { git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null -- cgit v1.2.3 From 6434a2b0c1a0fc6bd9d63d437243d8c5fd45ac34 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 9 Oct 2023 21:20:44 +0200 Subject: readded plugins and removed slow line --- config/essentials/zsh/.zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index d324e19..5e1e838 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -18,7 +18,6 @@ zle -N edit-command-line zstyle ':compinstall' filename '/home/aluc/.zshrc' zstyle ':completion:*' menu select autoload -Uz compinit -compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION autoload -Uz surround zle -N delete-surround surround zle -N add-surround surround @@ -28,6 +27,8 @@ compinit # Source files . $ZDOTDIR/functions.zsh . $ZDOTDIR/aliases.sh +. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +. /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh bindkey -v bindkey -a cs change-surround -- cgit v1.2.3 From e819980da0b92c3981ecb697e999d7cec633ab76 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 10 Oct 2023 18:32:07 +0200 Subject: fixed: plugins not working on debian --- config/essentials/zsh/.zshrc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 5e1e838..4212db7 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -27,8 +27,18 @@ compinit # Source files . $ZDOTDIR/functions.zsh . $ZDOTDIR/aliases.sh -. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -. /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +local PLUGPATH +for file in /etc/os-release /usr/lib/os-release +do [ -f "$file" ] && . "$file" && break +done +case "${ID:=unknown}" in + debian|ubuntu) PLUGPATH=/usr/share/ ;; + *) PLUGPATH=/usr/share/zsh/plugins ;; +esac +echo $PLUGPATH +. $PLUGPATH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +. $PLUGPATH/zsh-autosuggestions/zsh-autosuggestions.zsh bindkey -v bindkey -a cs change-surround -- cgit v1.2.3 From 34bb4516d35f0d9c65f028f8e2ea0cda079fdf02 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 10 Oct 2023 18:32:34 +0200 Subject: fix: useless echo --- config/essentials/zsh/.zshrc | 1 - 1 file changed, 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 4212db7..414a7d7 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -36,7 +36,6 @@ case "${ID:=unknown}" in debian|ubuntu) PLUGPATH=/usr/share/ ;; *) PLUGPATH=/usr/share/zsh/plugins ;; esac -echo $PLUGPATH . $PLUGPATH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh . $PLUGPATH/zsh-autosuggestions/zsh-autosuggestions.zsh -- cgit v1.2.3