summaryrefslogtreecommitdiff
path: root/config/essentials/zsh/.zshrc
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-01 12:07:35 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-01 12:07:35 +0200
commitdad6249cae8d5d66e0a6b174ed30d78dbbb3a064 (patch)
tree28fc4a4c2501cf5bb35bfe9984ab19e256f64763 /config/essentials/zsh/.zshrc
parent70c673a75bf98b1db7b637c9a6d4bd1e336c33d4 (diff)
parenta6d421ed5d752ad4ce945c8de07ecb1e3d16037f (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'config/essentials/zsh/.zshrc')
-rw-r--r--config/essentials/zsh/.zshrc38
1 files changed, 20 insertions, 18 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc
index 1260bb0..9b6fa48 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
@@ -137,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