summaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc70
1 files changed, 70 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
new file mode 100644
index 0000000..583421c
--- /dev/null
+++ b/.zshrc
@@ -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)"
Back to https://optics-design.com