.zshrc 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. # For ranger, htop and other console progs in Qtile ---------------------------
  2. unset COLUMNS
  3. unset LINES
  4. ###############################################################################
  5. # EXPORTs
  6. ###############################################################################
  7. export HOME=$(echo /home/$USER)
  8. export ZSH="$HOME/.oh-my-zsh"
  9. export GHCUP_INSTALL_BASE_PREFIX="$HOME/.config" # for GHCUP
  10. export GOPATH="$HOME/go"
  11. # export
  12. PATH=$PATH:$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.config/vifm/scripts:$HOME/Programs/AppImageApplications:$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin:$HOME/Programs/Android_SDK/platform-tools:$GOPATH/bin
  13. export EDITOR="vim" # vim is either a link to nvim or just vim
  14. export VISUAL="gvim" # gvim is either a link to nvim-qt or just gvim
  15. export TERM="xterm-256color"
  16. export TERMINAL="alacritty"
  17. export BROWSER="brave"
  18. export MANPAGER="bat man -p'" # $MANPAGER use batcat to read mans
  19. # export MANPAGER="sh -c 'col -bx | bat -l man -p'" # $MANPAGER use batcat to read mans
  20. export RANGER_LOAD_DEFAULT_RC=FALSE # to avoid loading ranger's config twice
  21. export ANDROID_SDK="$HOME/Programs/Android_SDK"
  22. export XDG_CONFIG_HOME="$HOME/.config"
  23. export XDG_DATA_HOME="$HOME/.local/share"
  24. # export XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share/applications:/var/lib/flatpak/exports/share/applications"
  25. export XDG_CACHE_HOME="$HOME/.cache"
  26. # export LIBVA_DRIVERS_PATH="/usr/lib/xorg/modules/drivers"
  27. # export LIBVA_DRIVER_NAME="vdpau"
  28. export LIBVA_DRIVER_NAME="nvidia"
  29. # export VDPAU_DRIVER="nvidia"
  30. # export LIBVA_DRIVERS_PATH="/usr/lib/dri/"
  31. # export LIBVA_DRIVER_NAME="vdpau"
  32. # export VDPAU_DRIVER="nvidia"
  33. # # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
  34. # # Initialization code that may require console input (password prompts, [y/n]
  35. # # confirmations, etc.) must go above this block; everything else may go below.
  36. # if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  37. # source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
  38. # fi
  39. ###############################################################################
  40. # AUTOCOMPLETE AND HIGHLIGHT COLORS
  41. ###############################################################################
  42. ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#7d7d7d"
  43. # Set name of the theme to load --- if set to "random", it will
  44. # load a random theme each time oh-my-zsh is loaded, in which case,
  45. # to know which specific one was loaded, run: echo $RANDOM_THEME
  46. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  47. # ZSH_THEME="bira"
  48. ZSH_THEME="bira_my"
  49. # ZSH_THEME="powerlevel10k/powerlevel10k"
  50. # Set list of themes to pick from when loading at random
  51. # Setting this variable when ZSH_THEME=random will cause zsh to load
  52. # a theme from this variable instead of looking in $ZSH/themes/
  53. # If set to an empty array, this variable will have no effect.
  54. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  55. # Uncomment the following line to use case-sensitive completion.
  56. # CASE_SENSITIVE="true"
  57. # Uncomment the following line to use hyphen-insensitive completion.
  58. # Case-sensitive completion must be off. _ and - will be interchangeable.
  59. # HYPHEN_INSENSITIVE="true"
  60. # Uncomment the following line to disable bi-weekly auto-update checks.
  61. # DISABLE_AUTO_UPDATE="true"
  62. # Uncomment the following line to automatically update without prompting.
  63. # DISABLE_UPDATE_PROMPT="true"
  64. # Uncomment the following line to change how often to auto-update (in days).
  65. # export UPDATE_ZSH_DAYS=13
  66. # Uncomment the following line if pasting URLs and other text is messed up.
  67. # DISABLE_MAGIC_FUNCTIONS="true"
  68. # Uncomment the following line to disable colors in ls.
  69. # DISABLE_LS_COLORS="true"
  70. # Uncomment the following line to disable auto-setting terminal title.
  71. # DISABLE_AUTO_TITLE="true"
  72. # Uncomment the following line to enable command auto-correction.
  73. # ENABLE_CORRECTION="true"
  74. # Uncomment the following line to display red dots whilst waiting for completion.
  75. # COMPLETION_WAITING_DOTS="true"
  76. # Uncomment the following line if you want to disable marking untracked files
  77. # under VCS as dirty. This makes repository status check for large repositories
  78. # much, much faster.
  79. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  80. # Uncomment the following line if you want to change the command execution time
  81. # stamp shown in the history command output.
  82. # You can set one of the optional three formats:
  83. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  84. # or set a custom format using the strftime function format specifications,
  85. # see 'man strftime' for details.
  86. # HIST_STAMPS="mm/dd/yyyy"
  87. # Would you like to use another custom folder than $ZSH/custom?
  88. # ZSH_CUSTOM=/path/to/new-custom-folder
  89. ###############################################################################
  90. # PLUGINS
  91. ###############################################################################
  92. # Which plugins would you like to load?
  93. # Standard plugins can be found in $ZSH/plugins/
  94. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  95. # Example format: plugins=(rails git textmate ruby lighthouse)
  96. # Add wisely, as too many plugins slow down shell startup.
  97. plugins=(git asdf)
  98. # plugins=(zsh-autosuggestions)
  99. # plugins=(zsh-syntax-highlighting)
  100. # User configuration
  101. # export MANPATH="/usr/local/man:$MANPATH"
  102. # You may need to manually set your language environment
  103. # export LANG=en_US.UTF-8
  104. # Preferred editor for local and remote sessions
  105. # if [[ -n $SSH_CONNECTION ]]; then
  106. # export EDITOR='vim'
  107. # else
  108. # export EDITOR='mvim'
  109. # fi
  110. # Compilation flags
  111. # export ARCHFLAGS="-arch x86_64"
  112. ###############################################################################
  113. # ALIASes
  114. ###############################################################################
  115. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  116. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  117. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  118. # For a full list of active aliases, run `alias`.
  119. # alias ls='ls --color=auto'
  120. # alias ll='ls -l'
  121. # alias ll='ls -lh'
  122. # alias la='ls -la'
  123. # alias la='ls -lah'
  124. # alias lf='ls -lFh'
  125. alias lse='exa -g --color=always --group-directories-first'
  126. alias lle='lse -l'
  127. alias ls='lsd --group-dirs=first'
  128. alias ll='lsd --blocks=permission,links,user,group,size,date,name --group-dirs=first --date="+%d %b %H:%M"'
  129. alias la='ll -a'
  130. # alias bat='bat --theme gruvbox-dark' # theme moved to the .config/bat/config
  131. alias grep='grep --color=auto'
  132. alias fgrep='fgrep --color=auto'
  133. alias egrep='egrep --color=auto'
  134. alias ifconfig=/sbin/ifconfig
  135. # confirm before overwriting something ----------------------------------------
  136. alias cp="cp -i"
  137. alias mv='mv -i'
  138. alias rm='rm -i'
  139. # switch between shells -------------------------------------------------------
  140. alias tobash="sudo chsh $USER -s /usr/bin/env bash && echo 'Now log out.'"
  141. alias tozsh="sudo chsh $USER -s /usr/bin/env zsh && echo 'Now log out.'"
  142. alias tofish="sudo chsh $USER -s /usr/bin/env fish && echo 'Now log out.'"
  143. # navigation ------------------------------------------------------------------
  144. alias ..='cd ..'
  145. alias ...='cd ../..'
  146. alias .3='cd ../../..'
  147. alias .4='cd ../../../..'
  148. alias .5='cd ../../../../..'
  149. # get top process eating memory -----------------------------------------------
  150. alias psmem='ps auxf | sort -nr -k 4'
  151. alias psmem10='ps auxf | sort -nr -k 4 | head -10'
  152. # get top process eating cpu --------------------------------------------------
  153. alias pscpu='ps auxf | sort -nr -k 3'
  154. alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
  155. # git -------------------------------------------------------------------------
  156. alias config='/usr/bin/git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME'
  157. # run some programs -----------------------------------------------------------
  158. alias v='vim'
  159. alias f='ranger'
  160. alias vf='vifm'
  161. alias emacs="emacsclient -c -a 'emacs'"
  162. ###############################################################################
  163. # PROMPT
  164. ###############################################################################
  165. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
  166. # [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
  167. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
  168. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
  169. ###############################################################################
  170. # Source
  171. ###############################################################################
  172. source $ZSH/oh-my-zsh.sh
  173. # Load ; should be last.
  174. # source $HOME/powerlevel10k/powerlevel10k.zsh-theme
  175. # source /usr/share/autojump/autojump.zsh 2>/dev/null
  176. # source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
  177. source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
  178. # # Syntax-highlighting like in fish
  179. # source $ZSH/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  180. # source $ZSH/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
  181. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  182. # source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
  183. # source ~/.git-completion.zsh
  184. # source ~/.git-prompt.sh
  185. # # asdf manager ----------------------------------------------------------------
  186. # source $HOME/.asdf/asdf.sh
  187. # source $HOME/.asdf/completions/asdf.bash
  188. # Fuzzy finder ----------------------------------------------------------------
  189. [ -f ~/.fzf.bash ] && source ~/.fzf.bash
  190. # # broot -----------------------------------------------------------------------
  191. # source /home/alexander/.config/broot/launcher/bash/br
  192. # Run neofetch ----------------------------------------------------------------
  193. neofetch