There are tons of useful things in here:
- The usefulness of Oh My ZSH! is already builtβin.
- Spaceship as a prompt.
- Fish-like autosuggestion in Zsh.
- Syntax highlighting of commands while they are typed.
- Automatically closing and deleting of quotes and brackets when you type them.
- Browser-like substring search for history.
- zgen for dependency management.
- Lots of useful aliases.
- Modern CLI tools like
eza(smarterls),bat(smartercat),zoxide(smartercd). - Git config, global
.gitignorefile and aliases. - Homebrew bundle for bootstrapping a macOS workstation.
- A lot of useful bins.
updatescript for updating dotfiles, Zsh plugins, brew, and apt packages.
Missing feature? Fork this repo and make it better.
Dotfiles are installed by running one of the following commands in your terminal, just copy one of the following commands and execute in the terminal:
Tell Git who you are using these commands:
git config -f ~/.gitlocal user.email "email@yoursite.com"
git config -f ~/.gitlocal user.name "Name Lastname"Clone dotfiles repo:
# Clone dotfiles repo
git clone https://github.com/denysdovhan/dotfiles.git $HOME/.dotfiles
# Go to the dotfiles directory
cd $HOME/.dotfiles
# Install dotfiles
./installUse single command to get the latest updates:
updateThis command refreshes sudo, pulls the latest dotfiles, reruns ./install --except shell, updates zgen and Zsh plugins, and updates brew when available.
Note: You may put your custom settings into
~/.zshlocal.
I suggest you to organize project folder as follows:
~/Projects
βββ Forks # for GitHub fork
βββ Job # for job projects
βββ Playground # for short-term experiments
βββ Repos # for long-term projectsAliases are going to make your work fast and enjoyable. See code in $DOTFILES/lib/aliases.zsh. Here is what's included:
- Aliases from Oh-My-Zsh. See Oh-My-Zsh Cheatsheet for more.
- Easier navigation
..βcd .....βcd ../......βcd ../../.......βcd ../../../..~βcd ~-βcd -
- Folders shortcuts
dlβcd ~/Downloadsdtβcd ~/Desktoppjβcd ~/Projectspjrβcd ~/Projects/Repospjfβcd ~/Projects/Forkspjjβcd ~/Projects/Jobpjlβcd ~/Projects/Playground
- Commands Shortcuts
eβ$EDITOR+xβchmod +xx+βchmod +xreloadβ reload~/.zshrcclrβclear
- Open
open <FILE>β open file from terminal.o <FILE>β open file from terminal.ooβ open current folder.termβ open iTerm.
- Misc
updateβ get updates (Runs$DOTFILES/scripts/update).bootstrapβ run machine bootstrap (Runs$DOTFILES/scripts/bootstrap).dotfilesβ jump quickly into dotfiles folder.myipβ my local IP address.passwordβ generate random password, copies it into clipboard and outputs it to terminal.pathβ print $PATH in readable view.getpageβ download web page with all assets.getβ download file with original filename.git-rootβ jump to the current repo root.helpβ usetldrwhen available.lgβ openlazygitwhen available.
Depending on installed tools, ls uses eza, cat uses bat, cd uses zoxide, and rm uses trash.
These OMZ plugins are included:
brewβ Homebrew completions and helpers.gitβ git aliases and functions.history-substring-searchβ browser-like history search.npmβ provides completion as well as adding many useful aliases.yarnβ the same as fornpm, but foryarnnvmβ auto-sourcingnvm.fnmβfnmintegration.pyenvβpyenvintegration.ghβ GitHub CLI aliases and completions.sudoβ[Esc] [Esc]to re-run previous command with sudo.ssh-agentβ automatically starts ssh-agent to set up and load whichever credentials you want for ssh connections.gpg-agentβ enablesgpg-agentif it is not running.dockeranddocker-composeβ Docker helpers.fzf,direnv,bun,deno, and more.- More are listed in
.zshrc(it's hard to keep the list updated).
Dotfiles also include some functions that will make your life easier. See code in bin/.
emptytrashβ empty the Trash on all mounted volumes and the main HDD.git-cleanupβ removes old Git branches and does other cleanup.git-forkβ add remote upstream.git-upstreamβ sync branch with upstream.gzβ get gzipped file sizenβ runs given command using binary innode_modules/.binof the current project.nyanβ print nyan cat.passwordβ generate a random password and copy it to the clipboard.
Note: Add your git user data and custom settings to
~/.gitlocal.
- UI color is
auto. - Default branch is
main. - Diff colors are:
white boldfor meta information;cyan boldfor frag;red boldfor old lines;green boldfor new lines.
- Default editor is Vim instead of Vi.
push.defaultset ascurrent.pull.rebaseset totrue.push.autoSetupRemoteset totrue.rerereenabled for conflict resolution reuse.- Automatic replacement
git://github.com/,gh:,github:addresses asgit@github.com:for GitHub. - Automatic replacement
git://gist.github.com/,gst:,gist:addresses asgit@gist.github.com:for Gists. - User custom settings gets from a
~/.gitlocalfile.
git aβgit addβ patch mode for specified files.git uaβgit reset HEADβ unstage files.git bβgit branchβ list, create, or delete branches.git cβgit commitβ record changes to the repository.git mβgit mergeβ merge branches.git mcβgit merge --continueβ continue merge after resolving conflicts.git coβgit checkoutβ checkout a branch or paths to the working tree.git cbβgit checkout -bβ create and checkout branch.git swβgit switchβ switch branches.git swcβgit switch -cβ create and switch branch.git apβgit add -pβ add file contents to the index.git caβgit commit -aβ commit with automatically stage files that have been modified and deleted.git cmβgit commit -mβ commit with commit message.git camβgit commit -amβ add all files and commit with message.git sβgit status -sbβ short status with current branch.git mainβ go tomainbranch and pull from remote.git masterβ go tomasterbranch and pull from remote.git developβ go todevelopbranch and pull from remote.git remainβ fetch latestmainand merge it into the current branch.git remasterβ fetch latestmasterand merge it into the current branch.git gitβ do not complain aboutgit git.git lβ commits log with pretty single line format.git llβ log with list of changed files for each commit.git ignoreβ ignore files: append file to.gitignore.git thisβ initialize, add all files and commit.git amendβ amend last commit.git redoβ amend last commit with its original message.git undoβreset --mixed HEAD^β reset index changes, but not the working tree.git discardβcheckout --β discard changes.git contribβ list of contributors and how many commits each person has.git todayβ see how many lines of code you have written today.git syncβ pull and push changes from/to remote.git lazyβ openlazygit.git-rootβ go to repo root.git-cleanup [--force]β removes old Git branches.git-fork <original-author>β add remote upstream.git-upstream [branch]β sync branch with upstream (defaults tomaster).
Resources that I used to make these dotfiles better:
MIT Β© Denys Dovhan
