.zshrc 9.6 KB

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