diff options
author | admin <contact@optics-design.com> | 2025-06-16 00:10:41 +0200 |
---|---|---|
committer | admin <contact@optics-design.com> | 2025-06-16 00:10:41 +0200 |
commit | 7f1416d7c6774e10b529ec3604b5d67fbd7c583f (patch) | |
tree | 9defd05491b37505d92e29d1cfd8f21d125f96f2 /.zshrc |
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 70 |
1 files changed, 70 insertions, 0 deletions
@@ -0,0 +1,70 @@ +autoload -U colors && colors +# PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " +# PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%(4~|…/%2~|%~)%{$fg[red]%}]%{$reset_color%}$%b " +PS1="%B%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M%{$reset_color%}%b:%B%{$fg[magenta]%}%~%{$reset_color%}%b +%B%{$fg[yellow]%}$%{$reset_color%}%b " +# PS1="%{$fg[magenta]%}%~%{$reset_color%} +# %B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M%{$fg[red]%}]%{$reset_color%}$%b " +#History in cache directory +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.cache/zsh/history + +# Basic auto/tab complete: +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) # Include hidden files + +#bindkey -v +#export KEYTIMEOUT=1 +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +# Use vim keys in tab complete menu: +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -M menuselect '^?' backward-delete-char + +# Use lf to switch directories and bind it to ctrl-o + +lfcd () { + tmp="$(mktemp)" + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +bindkey -s '^o' 'lfcd\n' + +bindkey '^P' up-line-or-history +bindkey '^N' down-line-or-history +bindkey '^ ' autosuggest-accept +bindkey '^E' end-of-line +setopt NO_BEEP + +alias dict='dict_func' +alias in='nvim' +alias emacs='emacsclient -nw' +alias ls='ls --color=auto' +dict_func() { command dict "$1" | colorit; } +alias ytdl='noglob yt-dlp' +alias ncm='ncmpcpp' +alias news='newsboat' + +#WSL aliases +alias start='explorer.exe' +alias pwsh='pwsh.exe' +alias sup='powershell.exe -Command "scoop update *"' + +export GPG_TTY=$(tty) + +setopt autocd +eval "$(zoxide init zsh)" +alias j='z' +eval "$(mcfly init zsh)" |