-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc_darwin
221 lines (159 loc) · 8.76 KB
/
.zshrc_darwin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
####[ Oh-My-Zsh Configurations ]########################################################
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME=""
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Disable audo updates for ohmyzsh. This is taken care of by chezmoi.
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# MAYBE: Add `command-not-found` plugin.
plugins=(colored-man-pages copybuffer copypath copyfile bgnotify)
####[ Pre `compinit` ]##################################################################
#### These are configurations that have to be set before the `compinit` function is
#### called, which is done when sourcing the 'oh-my-zsh.sh' file.
## Zsh plugin for completions.
## This plugin is installed via chezmoi, specified in the '.chezmoiexternal.toml' file.
zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src"
[[ -d $zsh_completion ]] && fpath+=${zsh_completion}
# Rustup completions.
# $ rustup completions zsh > ~/.zfunc/_rustup
[[ -f ~/.zfunc/_rustup ]] && fpath+=~/.zfunc
####[ Source Oh-My-Zsh ]################################################################
source "$ZSH/oh-my-zsh.sh"
####[ Aliases ]#########################################################################
###
### [ Group 1 ]
###
## General aliases.
alias ic="cd ~/Library/Mobile\ Documents/com~apple~CloudDocs"
alias edisk="cd /Volumes && ll"
alias zls="eza"
alias rmdsstore="find . -name '*.DS_Store' -type f -delete"
alias code="open -a 'Visual Studio Code.app' ."
alias formatc="find . -name '*.cs' -type f -exec clang-format --style='file:$HOME/Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
alias deletelocalbranches="git branch | grep -v 'main' | xargs git branch -D"
## Update based aliases.
alias updatebrew="brew update && brew upgrade && brew autoremove && brew cleanup && brew doctor"
###
### [ Group 2 ]
###
### Due to the number of commands that I find to be useful, I've created aliases
### containing some of these commands. They are specifically commands that I don't
### often use, but are useful to have on hand. Having these aliases allows me to see
### a list of these commands, without having to commit them to memory.
###
alias lt="echo -e \"
####[ Installed Commands ]##############################################################
bandwhich - Terminal bandwidth utilization tool.
bat - A cat(1) clone with wings.
cheat - Allows you to create and view interactive cheatsheets on the command-line.
codespell - Check code for common misspellings.
duf - Disk Usage/Free Utility - a better 'df' alternative.
fzf - A command-line fuzzy finder.
ncdu - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
pstree - List processes as a tree.
tmux - Terminal multiplexer.
####[[ Grouped Commands ]]##############################################################
lt_conversion - List of programs used for converting the formats of videos, images, etc.
lt_git - List of programs used for git related commands.
####[ Keyboard Combinations ]###########################################################
Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
\""
alias lt_conversion="echo -e \"
####[ Image and Video Formatters ]######################################################
ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
magick - Convert between image formats as well as resize an image, blur, crop,
despeckle, dither, draw on, flip, join, re-sample, and much more.
\""
alias lt_git="echo -e \"
####[ Git Related Commands ]############################################################
lazygit - Simple terminal UI for git commands.
git open - Opens the GitHub page for a repo/branch in your browser.
\""
####[ Environmental Variables ]#########################################################
# 1Password auth socket.
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
# Path purpose:
# /usr/local/opt/curl/bin: ...
# /usr/local/sbin: ???
# /usr/local/opt/openjdk@17/bin: Prefered java version.
# /usr/local/opt/node@18/bin: Prefered node version.
# /usr/local/opt/ruby/bin: Prefered ruby version.
export PATH="/usr/local/opt/curl/bin:/usr/local/sbin:/usr/local/opt/openjdk@17/bin:/usr/local/opt/node@18/bin:/usr/local/opt/ruby/bin:$PATH"
# Modifies the colors of files and directories when using `ls`.
export LSCOLORS="exgxfxDxcxegDaabagacaD"
## Version of LSCOLORS compatible with zsh and GNU based commands.
## You can find more information about LS_COLORS and why it's needed in addition to
## LSCOLORS, here: https://github.com/ohmyzsh/ohmyzsh/issues/6060#issuecomment-327934559
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"
## Set default editor.
if hash nvim 2>/dev/null; then
export EDITOR=nvim
export VISUAL=$EDITOR
fi
# Node Version Manager (NVM) configurations.
export NVM_DIR="$HOME/.nvm"
####[ Sourced Files ]###################################################################
## Load NVM.
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
## Zsh plugin for syntax highlighting.
## This plugin is installed via chezmoi, specified in the '.chezmoiexternal.toml' file.
zsh_syntax_highlighting="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[[ -f $zsh_syntax_highlighting ]] && source "$zsh_syntax_highlighting"
## Zsh plugin for autosuggestions.
## This plugin is installed via chezmoi, specified in the '.chezmoiexternal.toml' file.
zsh_autosuggestions="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
[[ -f $zsh_autosuggestions ]] && source "$zsh_autosuggestions"
## Zsh plugin for fzf-tab.
## This plugin is installed via chezmoi, specified in the '.chezmoiexternal.toml' file.
fzf_tab="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab/fzf-tab.plugin.zsh"
[[ -f $fzf_tab ]] && hash fzf 2>/dev/null && source "$fzf_tab"
## Source the plugins.sh file for the `op` command.
[[ -f $HOME/.config/op/plugins.sh ]] \
&& source "$HOME/.config/op/plugins.sh"
####[ Zsh Style Configurations ]########################################################
# Disable sort when completing `git checkout`.
zstyle ':completion:*:git-checkout:*' sort false
# Set descriptions format to enable group support.
# NOTE: Don't use escape sequences here, fzf-tab will ignore them.
zstyle ':completion:*:descriptions' format '[%d]'
# Set list-colors to enable filename colorizing.
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
## Preview directory's content with `eza` when completing `cd`.
hash eza 2>/dev/null \
&& zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# Switch group using `<` and `>`.
zstyle ':fzf-tab:*' switch-group '<' '>'
####[ End of File Configurations ]######################################################
#### These are configurations that are specified to be placed at the end of the file, by
#### the developer/documentation.
# Initialize Starship prompt, if it is installed and $ZSH_THEME is not set.
hash starship 2>/dev/null \
&& [[ -z $ZSH_THEME ]] \
&& eval "$(starship init zsh)"
####[ Others ]##########################################################################
#### These are generally configurations set up by setup scripts or other programs.