.zshrc 9.5 KB

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