.zshrc 9.2 KB

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