irongit
dotfiles/oh-my-zsh/dotfile-config.sh
121 lines3.2 KBBourne Again Shell (bash)
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.
4if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
6fi
7
8# If you come from bash you might have to change your $PATH.
9# export PATH=$HOME/bin:/usr/local/bin:$PATH
10
11export ZSH="$HOME/.oh-my-zsh"
12
13ZSH_THEME="powerlevel10k/powerlevel10k"
14
15plugins=(
16 git
17 archlinux
18 zsh-autosuggestions
19 zsh-syntax-highlighting
20 fuzzy-funcs
21)
22
23source $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
37alias ls='lsd'
38alias l='ls -l'
39alias la='ls -a'
40alias lla='ls -la'
41alias lt='ls --tree'
42
43# Set-up FZF key bindings (CTRL R for fuzzy history finder)
44source <(fzf --zsh)
45
46HISTFILE=~/.zsh_history
47HISTSIZE=10000
48SAVEHIST=10000
49setopt appendhistory
50
51# neovim takeover
52export EDITOR=nvim
53alias vim=nvim
54alias v=nvim
55alias nv=nvim
56alias vi=nvim
57
58# readonly vim -> ex: ps aux | vr
59alias vr="nvim -R -M"
60
61# add go bin to path
62export PATH=$PATH:$(go env GOPATH)/bin
63
64# prevent cargo build from destroying computer
65export CARGO_BUILD_JOBS=20
66
67# simpler ipython alias
68alias py=ipython
69
70
71alias tm='tmux attach || tmux'
72alias src='clear && exec zsh'
73
74alias dcu='docker compose build && docker compose down --remove-orphans && docker compose up -d && docker compose logs -f'
75
76# Add gem to environment
77export PATH="$PATH:$HOME/.local/share/gem/ruby/3.4.0/bin"
78
79# Add mason to environment path
80export PATH="$PATH:$HOME/.local/share/nvim/mason/bin"
81
82# Copy last command
83alias copylast='fc -ln -1 | wl-copy'
84
85# Source .env file
86dot() {
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
94twatch() {
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
99vwatch() {
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
104jwatch() {
105 cat - | entr -r sh -c "tmux popup -C; tmux popup -w 95% -h 95% -d $(pwd) -EE \"$1 2>&1 | jqp\""
106}
107
108numsum() {
109 local total=0
110 for n in "$@"; do
111 (( total += n ))
112 done
113 echo "$total"
114}
115
116source $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
121eval "$(zoxide init zsh)"