Skip to content

My dot-files used (optionally) in my 'New Mac Setup' repository. Includes great aliases, functions, zsh config, and custom neofetch-inspired message of the day config.

License

Notifications You must be signed in to change notification settings

nathan-kennedy/dot-files

Repository files navigation

Dot-files for Zsh 💻

If you're looking for a souped up Zshell with lots of awesome tools and decorations, look no further. If you're not into oh-my-zsh because you think it's bloated and offers way more than you actually need, look no further. I don't have a snazzy name for any of this. These are just my dot files, but I did put in a bunch of work trying to do what oh-my-zsh does without using oh-my-zsh, because after initially using omz I was really disappointed. I spent quite a while making everything pretty only to realize my prompt tool over 4 seconds to load... Uh, no. So will the hours I spent doing everything manually make up for the seconds I'll save every time I load Zsh? Perhaps not, but maybe if enough people use these dot files then at some point the time saved will have been worth the effort. Enjoy! 😁

MotD (Includes quote of the day from zenquotes.io)

This took way longer than it should have, but I like the result, hope you do too. The terminal window needs to be pretty small width-wise before the formatting is broken so there shouldn't be any problems there. The quote of the day loads from the .zshrc file with a simple curl command. No API key is requited.'Jq' JSON parser (automatically installed with my 'new-mac-setup script) is a prerequisite to reading the API output though.👍

terminal screenshot with custom motd(neofetch inspired)

If my skull ascii is too much you could always change the .zshrc to load neofetch instead, or do what I do, use both. I have the motd set to load when I use the 'r' alias and I have neofetch set to load when I clear the screen with the 'c' alias. Of course, you can always <control>+l if you want neither.

terminal screenshot with neofetch displayed

Aliases

.. = back one directory
... = back two directories
.... = back three directories
..... = back four directories
...... = back five directories home = home directory root = root directory ave = ansible-vault encrypt
avd = ansible-vault decrypt
_ = sudo
ga = git add
gs = git status
gc = git commit -m
gp = git push origin master
rm = verbose remove w/ confirmation over 3 files
c = clear and load neofetch (for when skulls are too edgelord)
mkcd = make directory and cd into it
md = mkdir
rmd = rmdir (verbose)
del = unsafe remove (no confirmation and recursive deletion)
rms = save removal (verbose with confirmation for every file)
la = list all files including hidden (uses ls)
ls = list w/ colors (uses ls)
l = list w/ long format, all files including hidden, and human readable byte sizes (uses ls)
ll = list w/ long format and human readable byte sizes (uses lsd)
ld = list only directories (uses eza)
lf = list only files (uses eza)
brave = open Brave browser
logseq = open LogSeq app
chathistory = open chat history for aichat (chatGPT tool for command line)
speedtest = network speedtest check
pb = copy to clipboard via piping
notes = LogSeq git repository
repos = git repositories directory
trash = trash with Finder instead of system API
dnsflush = flush DNS cache (password needed)
r = clear && source ~/.zshrc
psmem = list computer processes by memory use with clean formatting
pscpu = list computer processes by cpu use with clean formatting
dusage = list disk usage for items in current directory with clean formatting
dust = enhance 'du' written in rust dustf = 'dust' for files only dustd = 'dust' for directories only greph = grep command line history
grepa = grep aliases
grep = standard grep with colors added
egrep = grep -E with colors and ignores common hidden file types
fgrep = grep -F with colors and ignores common hidden file types
zsh = load .zshrc and its source files: .motd.sh .functions.sh and .alias.sh in VS code

Functions

Git

acp = git automation - check for changes to commit, then git add -A, git commit -m, and git push origin {current branch}. No need to use quotes for commit message.

ImageMagick

orgimg = takes a directory and organizes all images into folders named with the file extension.
jpg2png = .jpg and .jpeg conversion to .png
jpg2webp = .jpg and .jpeg conversion to webp
png2jpg = .png conversion to .jpg
png2webp = .png conversion to .webp
webp2jpg = .webp conversion to .jpg
webp2png = .webp conversion to .png
pdf2jpg = .png conversion to .jpg
vector2png = .ai, .eps, or .svg conversion to .png
heic2jpg = Apple's latest HEIC image conversion to .jpg
optjpg = optimize all .jpg's in a directory
optpng = optimize all .png's in a directory

Miscellaneous

symlink = creates a backup of a directory and then creates a symlink of the directory with the original name makegif = creates an optimized gif from any segment of a full-length video. You can run it by calling 'makegif' and following the prompts or you can use it immediately by inputting all the correct arguments when you call the script. torrent = starts downloading a torrent with aria2. Usage: torrent

Searching the web

ddg: search Duck Duck Go. Usage: ddg
google: search google. Usage: google
youtube: search YouTube for specific terms. Usage: youtube
gmailsearch: search gmail for specific terms. Usage: gmailsearch

Starship prompt configuration file

I've set up the starship.toml config file to have the prompt look like the powerline prompt. I've set it up using iTerm2 so the colors may be broken on an other terminal app. Also 'magenta' wasn't working for some reason. Not sure if it's a bug with starship or with iTerm2. I got around it by hard-coding the color with a hex color.

prompt image

Dynamic icons! 🥹

prompt icons examples

You'll want these two lines at the bottom of your .zshrc:

export STARSHIP_CONFIG=~/path/to/starship.toml
eval "$(starship init zsh)"

If you're using my 'new-mac-setup' script, it will automatically retrieve my dot files and so the lines will be there but since my actual dot files are in this repo the 'path/to/starship.toml' is a symlink and you'll want to change that anyway. For reference my symlink is in ~/.config/starship/starship.toml.

Where's my minimalist prompt? 🧐

This is obviously overboard for some people. You can simply delete the sections you don't want from the 'format' block at the top of 'starship.toml'. You don't have to worry about deleting formatting and styling blocks lower in the file.

Example Delete these lines for a minimalist prompt with only the user name, directories, git branch & status, and last-command status:

lines to delete in starship.toml file for minimalist prompt

Result

mini prompt example

iTerm2 color presets file

The file, zsh-colors.itermcolors, is to load the colors I use into iTerm2. Feel free to use your own, but I figured I'd include this as well to avoid any legibility or contrast issues on your machine. The less tweaking the better right? Just import them from this 'color presets' menu in iTerm2 settings.

iTerm2 color palette import image

About

My dot-files used (optionally) in my 'New Mac Setup' repository. Includes great aliases, functions, zsh config, and custom neofetch-inspired message of the day config.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages