Not for normies
moving config to .oh-my-zsh/dotfile-config
2 files changed, +124 -151
+121-0oh-my-zsh/dotfile-config.sh
| @@ -0,0 +1,121 @@ | ||
| 1 | +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| 2 | +# Initialization code that may require console input (password prompts, [y/n] | |
| 3 | +# confirmations, etc.) must go above this block; everything else may go below. | |
| 4 | +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| 5 | + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| 6 | +fi | |
| 7 | + | |
| 8 | +# If you come from bash you might have to change your $PATH. | |
| 9 | +# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| 10 | + | |
| 11 | +export ZSH="$HOME/.oh-my-zsh" | |
| 12 | + | |
| 13 | +ZSH_THEME="powerlevel10k/powerlevel10k" | |
| 14 | + | |
| 15 | +plugins=( | |
| 16 | + git | |
| 17 | + archlinux | |
| 18 | + zsh-autosuggestions | |
| 19 | + zsh-syntax-highlighting | |
| 20 | + fuzzy-funcs | |
| 21 | +) | |
| 22 | + | |
| 23 | +source $ZSH/oh-my-zsh.sh | |
| 24 | + | |
| 25 | +# Check archlinux plugin commands here | |
| 26 | +# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/archlinux | |
| 27 | + | |
| 28 | +# Display Pokemon-colorscripts | |
| 29 | +# Project page: https://gitlab.com/phoneybadger/pokemon-colorscripts#on-other-distros-and-macos | |
| 30 | +#pokemon-colorscripts --no-title -s -r #without fastfetch | |
| 31 | +#pokemon-colorscripts --no-title -s -r | fastfetch -c $HOME/.config/fastfetch/config-pokemon.jsonc --logo-type file-raw --logo-height 10 --logo-width 5 --logo - | |
| 32 | + | |
| 33 | +# fastfetch. Will be disabled if above colorscript was chosen to install | |
| 34 | +# fastfetch -c $HOME/.config/fastfetch/config-compact.jsonc | |
| 35 | + | |
| 36 | +# Set-up icons for files/directories in terminal using lsd | |
| 37 | +alias ls='lsd' | |
| 38 | +alias l='ls -l' | |
| 39 | +alias la='ls -a' | |
| 40 | +alias lla='ls -la' | |
| 41 | +alias lt='ls --tree' | |
| 42 | + | |
| 43 | +# Set-up FZF key bindings (CTRL R for fuzzy history finder) | |
| 44 | +source <(fzf --zsh) | |
| 45 | + | |
| 46 | +HISTFILE=~/.zsh_history | |
| 47 | +HISTSIZE=10000 | |
| 48 | +SAVEHIST=10000 | |
| 49 | +setopt appendhistory | |
| 50 | + | |
| 51 | +# neovim takeover | |
| 52 | +export EDITOR=nvim | |
| 53 | +alias vim=nvim | |
| 54 | +alias v=nvim | |
| 55 | +alias nv=nvim | |
| 56 | +alias vi=nvim | |
| 57 | + | |
| 58 | +# readonly vim -> ex: ps aux | vr | |
| 59 | +alias vr="nvim -R -M" | |
| 60 | + | |
| 61 | +# add go bin to path | |
| 62 | +export PATH=$PATH:$(go env GOPATH)/bin | |
| 63 | + | |
| 64 | +# prevent cargo build from destroying computer | |
| 65 | +export CARGO_BUILD_JOBS=20 | |
| 66 | + | |
| 67 | +# simpler ipython alias | |
| 68 | +alias py=ipython | |
| 69 | + | |
| 70 | + | |
| 71 | +alias tm='tmux attach || tmux' | |
| 72 | +alias src='clear && exec' | |
| 73 | + | |
| 74 | +alias dcu='docker compose build && docker compose down --remove-orphans && docker compose up -d && docker compose logs -f' | |
| 75 | + | |
| 76 | +# Add gem to environment | |
| 77 | +export PATH="$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin" | |
| 78 | + | |
| 79 | +# Add mason to environment path | |
| 80 | +export PATH="$PATH:$HOME/.local/share/nvim/mason/bin" | |
| 81 | + | |
| 82 | +# Copy last command | |
| 83 | +alias copylast='fc -ln -1 | wl-copy' | |
| 84 | + | |
| 85 | +# Source .env file | |
| 86 | +dot() { | |
| 87 | + set -a | |
| 88 | + local file="${1:-.env}" | |
| 89 | + [ -f "$file" ] && source "$file" | |
| 90 | + set +a | |
| 91 | +} | |
| 92 | + | |
| 93 | +# Make a tmux popup that reloads when the input files from stdin change | |
| 94 | +twatch() { | |
| 95 | + cat - | entr -r sh -c "tmux popup -C; tmux popup -w 95% -h 95% -d $(pwd) \"$1 2>&1\"" | |
| 96 | +} | |
| 97 | + | |
| 98 | +# Watch results of command based on input files given through stdin | |
| 99 | +vwatch() { | |
| 100 | + cat - | entr -r sh -c "tmux popup -C; tmux popup -B -w 95% -h 95% -d \"$(pwd)\" -E \"$1 2>&1 | nvim -R -M\"" | |
| 101 | +} | |
| 102 | + | |
| 103 | +# Watch results of command and pipe into jqp | |
| 104 | +jwatch() { | |
| 105 | + cat - | entr -r sh -c "tmux popup -C; tmux popup -w 95% -h 95% -d $(pwd) -EE \"$1 2>&1 | jqp\"" | |
| 106 | +} | |
| 107 | + | |
| 108 | +numsum() { | |
| 109 | + local total=0 | |
| 110 | + for n in "$@"; do | |
| 111 | + (( total += n )) | |
| 112 | + done | |
| 113 | + echo "$total" | |
| 114 | +} | |
| 115 | + | |
| 116 | +source $HOME/.config/broot/launcher/bash/br | |
| 117 | + | |
| 118 | +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. | |
| 119 | +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh | |
| 120 | + | |
| 121 | +eval "$(zoxide init zsh)" |
+3-151zshrc
| @@ -1,153 +1,5 @@ | ||
| 1 | -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| 2 | -# Initialization code that may require console input (password prompts, [y/n] | |
| 3 | -# confirmations, etc.) must go above this block; everything else may go below. | |
| 4 | -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| 5 | - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| 6 | -fi | |
| 1 | +# Includes dotfile contributions | |
| 2 | +source ~/.oh-my-zsh/dotfile-config.sh | |
| 7 | 3 | |
| 8 | -# If you come from bash you might have to change your $PATH. | |
| 9 | -# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| 4 | +## All custom configs are below | |
| 10 | 5 | |
| 11 | -export ZSH="$HOME/.oh-my-zsh" | |
| 12 | - | |
| 13 | -ZSH_THEME="powerlevel10k/powerlevel10k" | |
| 14 | - | |
| 15 | -plugins=( | |
| 16 | - git | |
| 17 | - archlinux | |
| 18 | - zsh-autosuggestions | |
| 19 | - zsh-syntax-highlighting | |
| 20 | - fuzzy-funcs | |
| 21 | -) | |
| 22 | - | |
| 23 | -source $ZSH/oh-my-zsh.sh | |
| 24 | - | |
| 25 | -# Check archlinux plugin commands here | |
| 26 | -# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/archlinux | |
| 27 | - | |
| 28 | -# Display Pokemon-colorscripts | |
| 29 | -# Project page: https://gitlab.com/phoneybadger/pokemon-colorscripts#on-other-distros-and-macos | |
| 30 | -#pokemon-colorscripts --no-title -s -r #without fastfetch | |
| 31 | -#pokemon-colorscripts --no-title -s -r | fastfetch -c $HOME/.config/fastfetch/config-pokemon.jsonc --logo-type file-raw --logo-height 10 --logo-width 5 --logo - | |
| 32 | - | |
| 33 | -# fastfetch. Will be disabled if above colorscript was chosen to install | |
| 34 | -# fastfetch -c $HOME/.config/fastfetch/config-compact.jsonc | |
| 35 | - | |
| 36 | -# Set-up icons for files/directories in terminal using lsd | |
| 37 | -alias ls='lsd' | |
| 38 | -alias l='ls -l' | |
| 39 | -alias la='ls -a' | |
| 40 | -alias lla='ls -la' | |
| 41 | -alias lt='ls --tree' | |
| 42 | - | |
| 43 | -# Set-up FZF key bindings (CTRL R for fuzzy history finder) | |
| 44 | -source <(fzf --zsh) | |
| 45 | - | |
| 46 | -HISTFILE=~/.zsh_history | |
| 47 | -HISTSIZE=10000 | |
| 48 | -SAVEHIST=10000 | |
| 49 | -setopt appendhistory | |
| 50 | - | |
| 51 | -# neovim takeover | |
| 52 | -export EDITOR=nvim | |
| 53 | -alias vim=nvim | |
| 54 | -alias v=nvim | |
| 55 | -alias nv=nvim | |
| 56 | -alias vi=nvim | |
| 57 | - | |
| 58 | -# readonly vim -> ex: ps aux | vr | |
| 59 | -alias vr="nvim -R -M" | |
| 60 | - | |
| 61 | -# add go bin to path | |
| 62 | -export PATH=$PATH:$(go env GOPATH)/bin | |
| 63 | - | |
| 64 | -# prevent cargo build from destroying computer | |
| 65 | -export CARGO_BUILD_JOBS=20 | |
| 66 | - | |
| 67 | -# >>> conda initialize >>> | |
| 68 | -# !! Contents within this block are managed by 'conda init' !! | |
| 69 | -__conda_setup="$('/home/huncho/miniforge3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" | |
| 70 | -if [ $? -eq 0 ]; then | |
| 71 | - eval "$__conda_setup" | |
| 72 | -else | |
| 73 | - if [ -f "/home/huncho/miniforge3/etc/profile.d/conda.sh" ]; then | |
| 74 | - . "/home/huncho/miniforge3/etc/profile.d/conda.sh" | |
| 75 | - else | |
| 76 | - export PATH="/home/huncho/miniforge3/bin:$PATH" | |
| 77 | - fi | |
| 78 | -fi | |
| 79 | -unset __conda_setup | |
| 80 | -# <<< conda initialize <<< | |
| 81 | - | |
| 82 | - | |
| 83 | -# >>> mamba initialize >>> | |
| 84 | -# !! Contents within this block are managed by 'mamba shell init' !! | |
| 85 | -export MAMBA_EXE='/home/huncho/miniforge3/bin/mamba'; | |
| 86 | -export MAMBA_ROOT_PREFIX='/home/huncho/miniforge3'; | |
| 87 | -__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" | |
| 88 | -if [ $? -eq 0 ]; then | |
| 89 | - eval "$__mamba_setup" | |
| 90 | -else | |
| 91 | - alias mamba="$MAMBA_EXE" # Fallback on help from mamba activate | |
| 92 | -fi | |
| 93 | -unset __mamba_setup | |
| 94 | -# <<< mamba initialize <<< | |
| 95 | - | |
| 96 | -# simpler ipython alias | |
| 97 | -alias py=ipython | |
| 98 | - | |
| 99 | -export NVM_DIR="$HOME/.nvm" | |
| 100 | -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| 101 | -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| 102 | - | |
| 103 | -alias tm='tmux attach || tmux' | |
| 104 | -alias src='clear && exec' | |
| 105 | - | |
| 106 | -alias dcu='docker compose build && docker compose down --remove-orphans && docker compose up -d && docker compose logs -f' | |
| 107 | - | |
| 108 | -# Add gem to environment | |
| 109 | -export PATH="$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin" | |
| 110 | - | |
| 111 | -# Add mason to environment path | |
| 112 | -export PATH="$PATH:$HOME/.local/share/nvim/mason/bin" | |
| 113 | - | |
| 114 | -# Copy last command | |
| 115 | -alias copylast='fc -ln -1 | wl-copy' | |
| 116 | - | |
| 117 | -# Source .env file | |
| 118 | -dot() { | |
| 119 | - set -a | |
| 120 | - local file="${1:-.env}" | |
| 121 | - [ -f "$file" ] && source "$file" | |
| 122 | - set +a | |
| 123 | -} | |
| 124 | - | |
| 125 | -# Make a tmux popup that reloads when the input files from stdin change | |
| 126 | -twatch() { | |
| 127 | - cat - | entr -r sh -c "tmux popup -C; tmux popup -w 95% -h 95% -d $(pwd) \"$1 2>&1\"" | |
| 128 | -} | |
| 129 | - | |
| 130 | -# Watch results of command based on input files given through stdin | |
| 131 | -vwatch() { | |
| 132 | - cat - | entr -r sh -c "tmux popup -C; tmux popup -B -w 95% -h 95% -d \"$(pwd)\" -E \"$1 2>&1 | nvim -R -M\"" | |
| 133 | -} | |
| 134 | - | |
| 135 | -# Watch results of command and pipe into jqp | |
| 136 | -jwatch() { | |
| 137 | - cat - | entr -r sh -c "tmux popup -C; tmux popup -w 95% -h 95% -d $(pwd) -EE \"$1 2>&1 | jqp\"" | |
| 138 | -} | |
| 139 | - | |
| 140 | -numsum() { | |
| 141 | - local total=0 | |
| 142 | - for n in "$@"; do | |
| 143 | - (( total += n )) | |
| 144 | - done | |
| 145 | - echo "$total" | |
| 146 | -} | |
| 147 | - | |
| 148 | -source $HOME/.config/broot/launcher/bash/br | |
| 149 | - | |
| 150 | -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. | |
| 151 | -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh | |
| 152 | - | |
| 153 | -eval "$(zoxide init zsh)" |