From f7afcd5df6c8dbedd06e048b2e78819e6089d17e Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Sat, 12 Mar 2022 18:44:52 +0200 Subject: [PATCH] Optmize and add some aliass --- .zshrc | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.zshrc b/.zshrc index 1b0d66f..a8e8da0 100644 --- a/.zshrc +++ b/.zshrc @@ -1,12 +1,3 @@ -source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme -source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - USE_POWERLINE="true" setopt correct # Auto corect mistakes setopt nobeep # No beep @@ -34,6 +25,32 @@ zstyle ':completion:*' accept-exact '*(N)' zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache +## Plugins section: Enable fish style features +source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. +# Initialization code that may require console input (password prompts, [y/n] +# confirmations, etc.) must go above this block; everything else may go below. +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + + +# Offer to install missing package if command is not found +if [[ -r /usr/share/zsh/functions/command-not-found.zsh ]]; then + source /usr/share/zsh/functions/command-not-found.zsh + export PKGFILE_PROMPT_INSTALL_MISSING=1 +fi + +# Use syntax highlighting +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# Use history substring search +source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh + +# Key bindings section # vi mode bindkey -v export KEYTIMEOUT=1 @@ -82,11 +99,6 @@ bindkey -s '^o' 'lfcd\n' autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line -## Plugins section: Enable fish style features -# Use syntax highlighting -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -# Use history substring search -source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh # bind UP and DOWN arrow keys to history substring search zmodload zsh/terminfo bindkey "$terminfo[kcuu1]" history-substring-search-up @@ -94,16 +106,12 @@ bindkey "$terminfo[kcud1]" history-substring-search-down bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down -# Offer to install missing package if command is not found -if [[ -r /usr/share/zsh/functions/command-not-found.zsh ]]; then - source /usr/share/zsh/functions/command-not-found.zsh - export PKGFILE_PROMPT_INSTALL_MISSING=1 -fi - # Aliases alias jshell=/usr/lib/jvm/java-17-openjdk/bin/jshell +alias Data='/media/Data' +alias Work='/media/Work_files' +alias University='/media/University' export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +