1
- # ###[ Oh-My-Zsh Configurations ]########################################################
1
+ # ###[ Oh-My-Zsh Configurations ]############################################################
2
2
3
3
4
4
# Path to your oh-my-zsh installation.
@@ -43,9 +43,9 @@ HIST_STAMPS="yyyy-mm-dd"
43
43
plugins=(colored-man-pages command-not-found) # Server
44
44
45
45
46
- # ###[ Pre `compinit` ]##################################################################
47
- # ### These are configurations that have to be set before the `compinit` function is
48
- # ### called, which is done when sourcing the 'oh-my-zsh.sh' file.
46
+ # ###[ Pre `compinit` ]######################################################################
47
+ # ### These are configurations that have to be set before the `compinit` function is called,
48
+ # ### which is done when sourcing the 'oh-my-zsh.sh' file.
49
49
50
50
51
51
# # Zsh plugin for completions.
@@ -58,86 +58,149 @@ zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completio
58
58
[[ -f ~ /.zfunc/_rustup ]] && fpath+=~ /.zfunc
59
59
60
60
61
- # ###[ Source Oh-My-Zsh ]################################################################
62
-
63
-
64
- source " $ZSH /oh-my-zsh.sh"
65
-
66
-
67
- # ###[ Aliases ]#########################################################################
68
-
61
+ # ###[ Resource File - Functions ]###########################################################
62
+
63
+
64
+ # ###
65
+ # Perform the update, upgrade, and cleanup of packages managed by the Apt Package Manager.
66
+ apt_update_and_cleanup () {
67
+ echo " [INFO] Executing: $ sudo apt update"
68
+ sudo apt update
69
+ echo " [INFO] Executing: $ sudo apt upgrade -y"
70
+ sudo apt upgrade -y
71
+ echo " [INFO] Executing: $ sudo apt autoremove -y"
72
+ sudo apt autoremove -y
73
+ echo " [INFO] Executing: $ sudo apt autoclean"
74
+ sudo apt autoclean
75
+ }
76
+
77
+ # ###
78
+ # Perform the update, upgrade, and cleanup of packages managed by Pacman. Additionally, GRUB
79
+ # configurations are updated to include snapshot changes.
80
+ pacman_update_and_cleanup () {
81
+ echo " [INFO] Executing: $ sudo pacman -Syu"
82
+ sudo pacman -Syu
83
+ echo " [INFO] Executing: $ yay && yay -Yc"
84
+ yay && yay -Yc
85
+ echo " [INFO] Executing: $ sudo pkgfile -u"
86
+ sudo pkgfile -u
87
+ echo " [INFO] Executing: $ UpdateGrubConfigs"
88
+ sudo grub-mkconfig -o /boot/grub/grub.cfg
89
+ }
69
90
70
91
# ##
71
- # ## [ Group 1 ]
92
+ # ## [ Alias Related Functions ]
72
93
# ##
73
94
74
- # # General aliases.
75
- alias zls=" eza"
76
- alias formatc=" find . -name '*.cs' -type f -exec clang-format --style='file:$HOME /Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
77
- alias update-grub-config=" sudo grub-mkconfig -o /boot/grub/grub.cfg"
78
- alias deletelocalbranches=" git branch | grep -v 'main' | xargs git branch -D"
79
- hash xdg-open 2> /dev/null && alias open=" xdg-open"
80
-
81
- # # Update based aliases.
82
- alias updateapt=" sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean"
83
- alias updatepacman=" sudo pacman -Syu && yay && yay -Yc && sudo pkgfile -u && update-grub-config"
84
-
85
- # # Systemd aliases.
86
- alias start-bluetooth=" sudo systemctl start bluetooth.service"
87
- alias stop-bluetooth=" sudo systemctl stop bluetooth.service"
88
- alias start-firewalld=" sudo systemctl start firewalld.service"
89
- alias stop-firewalld=" sudo systemctl stop firewalld.service"
90
- alias start-docker=" sudo systemctl start docker.service containerd.service"
91
- alias stop-docker=" sudo systemctl stop docker.socket docker.service containerd.service"
92
-
93
- # ##
94
- # ## [ Group 2 ]
95
- # ##
96
- # ## Due to the number of commands that I find to be useful, I've created aliases
97
- # ## containing some of these commands. They are specifically commands that I don't
98
- # ## often use, but are useful to have on hand. Having these aliases allows me to see
99
- # ## a list of these commands, without having to commit them to memory.
100
- # ##
101
-
102
- alias lt=" echo -e \"
103
- ####[ Installed Commands ]##############################################################
95
+ # ###
96
+ # List of Aliases
97
+ alias_lt () {
98
+ cat << EOF
99
+ ####[ Installed Commands ]######################################################
104
100
105
101
bandwhich - Terminal bandwidth utilization tool.
106
102
bat - A cat(1) clone with wings.
107
- cheat - Allows you to create and view interactive cheatsheets on the command-line.
103
+ cheat - Allows you to create and view interactive cheatsheets on the
104
+ command-line.
108
105
codespell - Check code for common misspellings.
109
106
duf - Disk Usage/Free Utility - a better 'df' alternative.
110
107
fzf - A command-line fuzzy finder.
111
- ncdu - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
108
+ ncdu - ncdu (NCurses Disk Usage) is a curses-based version of the
109
+ well-known 'du'.
112
110
pstree - List processes as a tree.
113
111
tmux - Terminal multiplexer.
114
112
115
- ####[[ Grouped Commands ]]##############################################################
113
+ ###
114
+ ### [ Grouped Commands ]
115
+ ###
116
116
117
- lt_conversion - List of programs used for converting the formats of videos, images, etc.
117
+ lt_conversion - List of programs used for converting the formats of videos,
118
+ images, etc.
118
119
lt_git - List of programs used for git related commands.
119
120
120
121
121
- ####[ Keyboard Combinations ]###########################################################
122
+ ####[ Keyboard Combinations ]###################################################
122
123
123
124
Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
124
- \" "
125
- alias lt_conversion=" echo -e \"
126
- ####[ Image and Video Formatters ]######################################################
125
+ EOF
126
+ }
127
+
128
+ # ###
129
+ # Image and Video Formatters
130
+ alias_lt_conversion () {
131
+ cat << EOF
132
+ ####[ Image and Video Formatters ]##############################################
127
133
128
- ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
134
+ ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia
135
+ content.
129
136
magick - Convert between image formats as well as resize an image, blur, crop,
130
137
despeckle, dither, draw on, flip, join, re-sample, and much more.
131
- \" "
132
- alias lt_git=" echo -e \"
133
- ####[ Git Related Commands ]############################################################
138
+ EOF
139
+ }
140
+
141
+ # ###
142
+ # Git Related Commands
143
+ alias_lt_git () {
144
+ cat << EOF
145
+ ####[ Git Related Commands ]####################################################
134
146
135
147
lazygit - Simple terminal UI for git commands.
136
148
git open - Opens the GitHub page for a repo/branch in your browser.
137
- \" "
149
+ EOF
150
+ }
138
151
139
152
140
- # ###[ Environmental Variables ]#########################################################
153
+ # ###[ Source Oh-My-Zsh ]####################################################################
154
+
155
+
156
+ source " $ZSH /oh-my-zsh.sh"
157
+
158
+
159
+ # ###[ Aliases ]#############################################################################
160
+
161
+
162
+ # ##
163
+ # ## [ Group 1 ]
164
+ # ##
165
+
166
+ # # General aliases.
167
+ alias zls=" eza"
168
+ hash xdg-open 2> /dev/null && alias open=" xdg-open"
169
+
170
+ # # Configuration related aliases.
171
+ alias update_grub_config=" sudo grub-mkconfig -o /boot/grub/grub.cfg"
172
+
173
+ # # File action related aliases.
174
+ alias format_csharp_code=" find . -name '*.cs' -type f -exec clang-format --style='file:$HOME /Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
175
+ alias delete_local_git_branches=" git branch | grep -v 'main' | xargs git branch -D"
176
+
177
+ # # Update based aliases.
178
+ alias update_apt=" apt_update_and_cleanup"
179
+ alias update_pacman=" pacman_update_and_cleanup"
180
+
181
+ # # Systemd aliases.
182
+ alias start_bluetooth=" sudo systemctl start bluetooth.service"
183
+ alias stop_bluetooth=" sudo systemctl stop bluetooth.service"
184
+ alias start_firewalld=" sudo systemctl start firewalld.service"
185
+ alias stop_firewalld=" sudo systemctl stop firewalld.service"
186
+ alias start_docker=" sudo systemctl start docker.service containerd.service"
187
+ alias stop_docker=" sudo systemctl stop docker.socket docker.service containerd.service"
188
+
189
+ # ##
190
+ # ## [ Group 2 ]
191
+ # ##
192
+ # ## Due to the number of commands that I find to be useful, I've created aliases containing
193
+ # ## some of these commands. They are specifically commands that I don't often use, but are
194
+ # ## useful to have on hand. Having these aliases allows me to see a list of these commands,
195
+ # ## without having to commit them to memory.
196
+ # ##
197
+
198
+ alias lt=" alias_lt"
199
+ alias lt_conversion=" alias_lt_conversion"
200
+ alias lt_git=" alias_lt_git"
201
+
202
+
203
+ # ###[ Environmental Variables ]#############################################################
141
204
142
205
143
206
# 1Password auth socket.
166
229
export NVM_DIR=" $HOME /.nvm"
167
230
168
231
169
- # ###[ Sourced Files ]###################################################################
232
+ # ###[ Sourced Files ]#######################################################################
170
233
171
234
172
235
# # Load NVM.
@@ -186,18 +249,19 @@ zsh_autosuggestions="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggesti
186
249
# # Zsh plugin for fzf-tab.
187
250
# # This plugin is installed via chezmoi, specified in the '.chezmoiexternal.toml' file.
188
251
fzf_tab=" ${ZSH_CUSTOM:- ~/ .oh-my-zsh/ custom} /plugins/fzf-tab/fzf-tab.plugin.zsh"
189
- [[ -f $fzf_tab ]] && hash fzf 2> /dev/null && source " $fzf_tab "
252
+ [[ -f $fzf_tab ]] \
253
+ && hash fzf 2> /dev/null \
254
+ && source " $fzf_tab "
190
255
191
256
# # Source the plugins.sh file for the `op` command.
192
- [[ -f $HOME /.config/op/plugins.sh ]] \
193
- && source " $HOME /.config/op/plugins.sh"
257
+ [[ -f $HOME /.config/op/plugins.sh ]] && source " $HOME /.config/op/plugins.sh"
194
258
195
259
# # Make the 'command-not-found' functionality available.
196
260
[[ -f /usr/share/doc/pkgfile/command-not-found.zsh ]] \
197
261
&& source /usr/share/doc/pkgfile/command-not-found.zsh
198
262
199
263
200
- # ###[ Zsh Style Configurations ]########################################################
264
+ # ###[ Zsh Style Configurations ]############################################################
201
265
202
266
203
267
# Disable sort when completing `git checkout`.
@@ -214,9 +278,9 @@ hash eza 2>/dev/null \
214
278
zstyle ' :fzf-tab:*' switch-group ' <' ' >'
215
279
216
280
217
- # ###[ End of File Configurations ]######################################################
218
- # ### These are configurations that are specified to be placed at the end of the file, by
219
- # ### the developer/documentation.
281
+ # ###[ End of File Configurations ]##########################################################
282
+ # ### These are configurations that are specified to be placed at the end of the file, by the
283
+ # ### developer/documentation.
220
284
221
285
222
286
# Initialize Starship prompt, if it is installed and $ZSH_THEME is not set.
@@ -225,6 +289,5 @@ hash starship 2>/dev/null \
225
289
&& eval " $( starship init zsh) "
226
290
227
291
228
- # ###[ Others ]##########################################################################
292
+ # ###[ Others ]##############################################################################
229
293
# ### These are generally configurations set up by setup scripts or other programs.
230
-
0 commit comments