├── .prettierrc ├── home ├── .czrc ├── .config │ ├── husky │ │ └── init.sh │ ├── ghostty │ │ └── config │ └── gh │ │ └── config.yml ├── .gitignore ├── .vimrc ├── .gitconfig └── .zshrc ├── .gitmodules ├── custom └── README.md ├── bin ├── password ├── git-upstream ├── gz ├── git-fork ├── n ├── emptytrash ├── nyan └── git-cleanup ├── scripts ├── zgen ├── projects ├── update └── bootstrap ├── .gitignore ├── lib ├── smartdots.zsh ├── lscolors.zsh └── aliases.zsh ├── install ├── .editorconfig ├── install.conf.yaml ├── Brewfile └── README.md /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /home/.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "cz-conventional-changelog" 3 | } 4 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dotbot"] 2 | path = dotbot 3 | url = https://github.com/anishathalye/dotbot 4 | ignore = dirty 5 | -------------------------------------------------------------------------------- /custom/README.md: -------------------------------------------------------------------------------- 1 | # Custom setup 2 | 3 | Files from this directory will be loaded automatically. 4 | They will not be included into repository and will not be overridden after update. 5 | -------------------------------------------------------------------------------- /bin/password: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Generate a random password of a given lenght 4 | 5 | length="${1:-16}" 6 | openssl rand -base64 $length | rev | cut -b 2- | rev | pbcopy 7 | pbpaste 8 | -------------------------------------------------------------------------------- /bin/git-upstream: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Sync branch with upstream 4 | # USAGE: git-upstream [branch] 5 | 6 | branch=${1-master} 7 | git fetch upstream 8 | git co origin $branch 9 | git merge upstream/$branch 10 | -------------------------------------------------------------------------------- /scripts/zgen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | URL=https://github.com/tarjoilija/zgen.git 4 | REPO="$HOME/.zgen" 5 | 6 | if [ ! -d "$REPO" ]; then 7 | git clone "$URL" "$REPO" 8 | else 9 | cd "$REPO" || exit 10 | git pull 11 | fi 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Backup folder 2 | backup 3 | 4 | # Custom files (*sh includes sh, bash, zsh) 5 | custom/**/*.*sh 6 | 7 | # Home Configs 8 | home/.config/* 9 | !home/.config/gh/config.yml 10 | !home/.config/ghostty 11 | !home/.config/husky 12 | 13 | -------------------------------------------------------------------------------- /bin/gz: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Get gzipped file size 4 | # USAGE: gz 5 | 6 | origsize=$(wc -c < $1) 7 | gzipsize=$(gzip -c "$1" | wc -c) 8 | ratio=$(echo $(( $gzipsize * 100 / $origsize ))) 9 | echo "Original: $origsize bytes" 10 | echo "Gzipped: $gzipsize bytes ($ratio%)" 11 | -------------------------------------------------------------------------------- /scripts/projects: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$(uname)" != "Darwin" ]; then 4 | echo "Skipping Projects scaffolding on non-MacOS platform" 5 | exit 0 6 | fi 7 | 8 | mkdir -p ~/Projects/Repos 9 | mkdir -p ~/Projects/Forks 10 | mkdir -p ~/Projects/Job 11 | mkdir -p ~/Projects/Playground 12 | -------------------------------------------------------------------------------- /home/.config/husky/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Source NVM 4 | export NVM_DIR="$HOME/.nvm" 5 | [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm 6 | 7 | # Source Homebrew (Yarn specifically) 8 | export HOMEBREW_PREFIX="/opt/homebrew" 9 | export PATH="$HOMEBREW_PREFIX/bin:$PATH" 10 | -------------------------------------------------------------------------------- /bin/git-fork: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Add remote upsteam 4 | # USAGE: git-fork 5 | 6 | user=$1 7 | if [[ "$user" == "" ]] 8 | then 9 | echo "Usage: git-fork " 10 | else 11 | repo=$(basename "$(pwd)") 12 | git remote add upstream "https://github.com/$user/$repo.git" 13 | fi 14 | -------------------------------------------------------------------------------- /bin/n: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Runs given command using binary in node_modules/.bin of the current project 4 | # https://github.com/ai/environment 5 | 6 | if [[ -d $(npm bin) ]]; then 7 | PROG="$1" 8 | shift 9 | "$(npm bin)/$PROG" "$@" 10 | else 11 | echo 'No node_modules in any dir of current path' 1>&2 12 | exit 1 13 | fi 14 | -------------------------------------------------------------------------------- /bin/emptytrash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Empty the Trash on all mounted volumes and the main HDD 4 | # Also, clear Apple’s System Logs to improve shell startup speed 5 | # 6 | # Author: Artem Sapegin, sapegin.me 7 | # License: MIT 8 | # https://github.com/sapegin/dotfiles 9 | 10 | sudo rm -rfv /Volumes/*/.Trashes 11 | sudo rm -rfv "$HOME"/.Trash 12 | sudo rm -rfv /private/var/log/asl/*.asl 13 | -------------------------------------------------------------------------------- /lib/smartdots.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Quick change directories 4 | # Expands .... -> ../../../ 5 | # 6 | # Author: Denys Dovhan, denysdovhan.com 7 | # License: MIT 8 | # https://github.com/denysdovhan/dotfiles 9 | 10 | smartdots() { 11 | if [[ $LBUFFER = *.. ]]; then 12 | LBUFFER+=/.. 13 | else 14 | LBUFFER+=. 15 | fi 16 | } 17 | zle -N smartdots 18 | bindkey . smartdots 19 | -------------------------------------------------------------------------------- /home/.config/ghostty/config: -------------------------------------------------------------------------------- 1 | theme = TokyoNight Night 2 | font-size = 16 3 | font-family = "FiraCode Nerd Font Mono" 4 | cursor-style = block 5 | cursor-style-blink = true 6 | window-height = 25 7 | window-width = 80 8 | shell-integration-features = sudo, no-cursor 9 | 10 | keybind = ctrl+h=goto_split:left 11 | keybind = ctrl+j=goto_split:down 12 | keybind = ctrl+k=goto_split:up 13 | keybind = ctrl+l=goto_split:right 14 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | CONFIG="install.conf.yaml" 6 | DOTBOT_DIR="dotbot" 7 | 8 | DOTBOT_BIN="bin/dotbot" 9 | BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 10 | 11 | cd "${BASEDIR}" 12 | git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive 13 | git submodule update --init --recursive "${DOTBOT_DIR}" 14 | 15 | "${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 2 | # https://editorconfig.org 3 | 4 | # top-most EditorConfig file 5 | root = true 6 | 7 | # Unix-style newlines with a newline ending every file 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | insert_final_newline = true 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.{zsh,sh,bash,js,json}] 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | # 4 space indentation 20 | [*.py] 21 | trim_trailing_whitespace = true 22 | insert_final_newline = true 23 | -------------------------------------------------------------------------------- /home/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Python files 2 | *.pyc 3 | 4 | # Folder view configuration files 5 | .DS_Store 6 | desktop.ini 7 | 8 | # Thumbnail cache files 9 | Thumbs.db 10 | 11 | # Installed NPM modules 12 | node_modules 13 | npm-debug.log 14 | yarn-error.log 15 | 16 | # Installed Bower packages 17 | bower_components 18 | 19 | # Editor`s configs 20 | *.sublime-* 21 | .tern-project 22 | 23 | # Ignore Westorm files 24 | .idea 25 | 26 | # VSCode: Todo extension files 27 | # https://marketplace.visualstudio.com/items/?itemName=fabiospampinato.vscode-todo-plus 28 | TODO 29 | *.todo 30 | -------------------------------------------------------------------------------- /bin/nyan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Print nyan cat 4 | # https://github.com/steckel/Git-Nyan-Graph/blob/master/nyan.sh 5 | # USAGE: nyan 6 | 7 | e='\033' 8 | RESET="${e}[0m" 9 | BOLD="${e}[1m" 10 | CYAN="${e}[0;96m" 11 | RED="${e}[0;91m" 12 | YELLOW="${e}[0;93m" 13 | GREEN="${e}[0;92m" 14 | 15 | echo 16 | echo -en "$RED"'-_-_-_-_-_-_-_' 17 | echo -e "$RESET"$BOLD',------,'"$RESET" 18 | echo -en "$YELLOW"'_-_-_-_-_-_-_-' 19 | echo -e "$RESET"$BOLD'| /\_/\\'"$RESET" 20 | echo -en "$GREEN"'-_-_-_-_-_-_-' 21 | echo -e "$RESET"$BOLD'~|__( ^ .^)'"$RESET" 22 | echo -en "$CYAN"'-_-_-_-_-_-_-_-' 23 | echo -e "$RESET"$BOLD'"" ""'"$RESET" 24 | echo 25 | -------------------------------------------------------------------------------- /install.conf.yaml: -------------------------------------------------------------------------------- 1 | - defaults: 2 | shell: 3 | stdout: true 4 | stderr: true 5 | 6 | - clean: ['~'] 7 | 8 | - link: 9 | ~/: 10 | glob: true 11 | path: home/.* 12 | create: true 13 | relink: true 14 | force: true 15 | 16 | - create: 17 | - ~/.config 18 | 19 | - shell: 20 | - description: Installing submodules 21 | command: git submodule update --init --recursive 22 | 23 | - description: Installing zgen 24 | command: ./scripts/zgen 25 | 26 | - description: Scaffolding Project folders 27 | command: ./scripts/projects 28 | 29 | - description: Run ./scripts/bootstrap to bootstrap new machine 30 | command: echo "bash $DOTFILES/scripts/bootstrap" 31 | -------------------------------------------------------------------------------- /home/.config/gh/config.yml: -------------------------------------------------------------------------------- 1 | # What protocol to use when performing git operations. Supported values: ssh, https 2 | git_protocol: https 3 | # What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment. 4 | editor: 5 | # When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled 6 | prompt: enabled 7 | # A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager. 8 | pager: 9 | # Aliases allow you to create nicknames for gh commands 10 | aliases: 11 | co: pr checkout 12 | prv: pr view -w 13 | prc: pr create 14 | # The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport. 15 | http_unix_socket: 16 | # What web browser gh should use when opening URLs. If blank, will refer to environment. 17 | browser: 18 | version: "1" 19 | -------------------------------------------------------------------------------- /lib/lscolors.zsh: -------------------------------------------------------------------------------- 1 | # LSCOLORS 2 | # Online editor: https://geoff.greer.fm/lscolors/ 3 | export LSCOLORS="Gxfxcxdxbxegedabagacab" 4 | export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:ow=0;41:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:*.patch=00;34:*.o=00;32:*.so=01;35:*.ko=01;31:*.la=00;33' 5 | # Zsh to use the same colors as ls 6 | # Link: http://superuser.com/a/707567 7 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 8 | -------------------------------------------------------------------------------- /bin/git-cleanup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Removes old Git branches and does other cleanup 4 | # 5 | # Usage: 6 | # git-cleanup [--force] 7 | # 8 | # See explanation here: http://erikaybar.name/git-deleting-old-local-branches/ 9 | # 10 | # Author: Artem Sapegin, sapegin.me 11 | # License: MIT 12 | # https://github.com/sapegin/dotfiles 13 | 14 | # Exit on any failed command 15 | set -e 16 | 17 | CYAN="$(tput setaf 6)" 18 | UNDERLINE="$(tput sgr 0 1)" 19 | NOCOLOR="$(tput sgr0)" 20 | 21 | function header() { echo -e "\n$UNDERLINE$CYAN$1$NOCOLOR\n"; } 22 | 23 | function branches() { 24 | git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' 25 | } 26 | 27 | if [[ "$1" != "--force" ]]; then 28 | branches 29 | exit 1 30 | fi 31 | 32 | # Delete all unreachable objects from the object database 33 | header "Deleting unreachable objects..." 34 | git prune 35 | 36 | # Delete all stale remote-tracking branches, these branches have already been 37 | # removed from the remote repository, but are still locally available in "remotes/". 38 | header "Deleting stale remote-tracking branches..." 39 | git remote prune origin 40 | echo "Done." 41 | 42 | # Delete branches for which remote branches were removed 43 | header "Deleting branches with no longer existing remote branches..." 44 | branches | xargs git branch -D 45 | -------------------------------------------------------------------------------- /home/.vimrc: -------------------------------------------------------------------------------- 1 | 2 | " Set to show line numbers 3 | set number 4 | 5 | " Enable syntax highlighting 6 | syntax on 7 | 8 | " Escape on kj keybinding 9 | :imap kj 10 | 11 | " Set how many lines of history VIM should remember 12 | set history=500 13 | 14 | " :W sudo saves the file 15 | command W w !sudo tee % > /dev/null 16 | 17 | " Enable wildmeny for command line completions 18 | " Hit after : and see what will happen 19 | set wildmenu 20 | 21 | " Always show current position 22 | set ruler 23 | " Heigh of command bar 24 | set cmdheight=2 25 | 26 | "A buffer becomes hidden when it is abandoned 27 | set hid 28 | 29 | " Ignore case when searching 30 | set ignorecase 31 | 32 | " When searching try to be smart about cases 33 | " If a pattern contains an uppercase letter, it is case sensitive. 34 | set smartcase 35 | 36 | " Highlight search results 37 | set hlsearch 38 | 39 | " Makes search act like search in modern browsers 40 | " Highlight possible results when typing 41 | set incsearch 42 | 43 | " Show matching brackets when text indicator is over them 44 | set showmatch 45 | 46 | " Set utf8 as standard encoding and en_US as the standard language 47 | set encoding=utf8 48 | 49 | " Use spaces instead of tabs 50 | set expandtab 51 | 52 | " Be smart when using tabs ;) 53 | set smarttab 54 | 55 | " 1 tab == 2 spaces 56 | set shiftwidth=2 57 | set tabstop=2 58 | 59 | set ai "Auto indent 60 | set si "Smart indent 61 | set wrap "Wrap lines 62 | 63 | " Always show the status line 64 | set laststatus=2 65 | 66 | 67 | " Format the status line 68 | set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l\ \ Column:\ %c 69 | 70 | " Returns true if paste mode is enabled 71 | function! HasPaste() 72 | if &paste 73 | return 'PASTE MODE ' 74 | endif 75 | return '' 76 | endfunction 77 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | # Homebrew Bundle 2 | # https://github.com/Homebrew/homebrew-bundle 3 | 4 | # ------------------------------------------------------------------------------ 5 | # CLI Tools 6 | # ------------------------------------------------------------------------------ 7 | brew "git" 8 | brew "zsh" 9 | brew "zsh-completions" 10 | brew "nvim" 11 | brew "node" 12 | brew "coreutils" 13 | brew "nvm" 14 | brew "tree" 15 | brew "eza" 16 | brew "zoxide" 17 | brew "fzf" 18 | brew "wget" 19 | brew "yarn" 20 | brew "tldr" 21 | brew "mas" 22 | brew "gh" 23 | brew "terminal-notifier" 24 | brew "wifi-password" 25 | brew "speedtest" 26 | brew "bat" 27 | brew "trash-it" 28 | brew "youtube-dl" 29 | brew "watchman" # Watching files for Jest 30 | brew "codex" 31 | brew "gemini-cli" 32 | 33 | # ------------------------------------------------------------------------------ 34 | # Taps 35 | # ------------------------------------------------------------------------------ 36 | tap "homebrew/cask-fonts" 37 | 38 | # ------------------------------------------------------------------------------ 39 | # Cask 40 | # ------------------------------------------------------------------------------ 41 | 42 | # Fonts 43 | cask "font-fira-code" 44 | cask "font-fira-code-nerd-font" 45 | cask "font-hasklug-nerd-font" 46 | 47 | # Utils 48 | cask "raycast" 49 | cask "ukrainian-typographic-keyboard" 50 | cask "gpg-suite" 51 | cask "openvpn-connect" 52 | 53 | # Media 54 | cask "transmission" 55 | cask "handbrake" 56 | cask "vlc" 57 | cask "obs" 58 | 59 | # Development 60 | cask "multipass" 61 | cask "iterm2" 62 | cask "visual-studio-code" 63 | cask "github" 64 | cask "ghostty" 65 | 66 | # Desktop applications 67 | cask "telegram" 68 | cask "google-chrome" 69 | cask "firefox" 70 | cask "brave-browser" 71 | cask "slack" 72 | cask "steam" 73 | cask "spotify" 74 | cask "notion" 75 | cask "discord" 76 | 77 | # Quick Look plugins 78 | cask "qlcolorcode" # https://github.com/anthonygelibert/QLColorCode 79 | cask "qlstephen" # https://github.com/whomwah/qlstephen 80 | cask "quicklook-json" # https://github.com/sindresorhus/quick-look-plugins 81 | cask "qlimagesize" # https://github.com/Nyx0uf/qlImageSize 82 | cask "webpquicklook" # https://github.com/dchest/webp-quicklook 83 | 84 | # ------------------------------------------------------------------------------ 85 | # App Store applications 86 | # ------------------------------------------------------------------------------ 87 | mas "Home Assistant", id: 1099568401 88 | mas "Bitwarden", id: 1352778147 89 | mas "Spark", id: 1176895641 90 | mas "Unsplash Wallpapers", id: 12848638472 91 | mas "NordVPN", id: 905953485 92 | mas "The Unarchiver", id: 425424353 93 | mas "Pandan", id: 1569600264 94 | -------------------------------------------------------------------------------- /scripts/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Get System Updates, update NPM packages and dotfiles 4 | # Source: https://github.com/sapegin/dotfiles/blob/master/setup/update.sh 5 | 6 | trap on_error SIGTERM 7 | 8 | e='\033' 9 | RESET="${e}[0m" 10 | BOLD="${e}[1m" 11 | CYAN="${e}[0;96m" 12 | RED="${e}[0;91m" 13 | YELLOW="${e}[0;93m" 14 | GREEN="${e}[0;92m" 15 | 16 | _exists() { 17 | command -v "$1" > /dev/null 2>&1 18 | } 19 | 20 | # Success reporter 21 | info() { 22 | echo -e "${CYAN}${*}${RESET}" 23 | } 24 | 25 | # Error reporter 26 | error() { 27 | echo -e "${RED}${*}${RESET}" 28 | } 29 | 30 | # Success reporter 31 | success() { 32 | echo -e "${GREEN}${*}${RESET}" 33 | } 34 | 35 | # End section 36 | finish() { 37 | success "Done!" 38 | echo 39 | sleep 1 40 | } 41 | 42 | # Set directory 43 | export DOTFILES=${1:-"$HOME/.dotfiles"} 44 | 45 | on_start() { 46 | info ' __ __ ____ _ __ ' 47 | info ' ____/ /____ / /_ / __/(_)/ /___ _____ ' 48 | info ' / __ // __ \ / __// /_ / // // _ \ / ___/ ' 49 | info ' _ / /_/ // /_/ // /_ / __// // // __/(__ ) ' 50 | info ' (_)\__,_/ \____/ \__//_/ /_//_/ \___//____/ ' 51 | info ' ' 52 | info ' by @denysdovhan ' 53 | info ' ' 54 | } 55 | 56 | update_dotfiles() { 57 | info "Updating dotfiles..." 58 | 59 | cd "$DOTFILES" || exit 60 | git pull origin master 61 | ./install --except shell 62 | cd - > /dev/null 2>&1 || exit 63 | 64 | info "Updating Zsh plugins..." 65 | zgen selfupdate 66 | zgen update 67 | 68 | finish 69 | } 70 | 71 | update_brew() { 72 | if ! _exists brew; then 73 | return 74 | fi 75 | 76 | info "Updating Homebrew..." 77 | 78 | brew update 79 | brew upgrade 80 | brew cleanup 81 | 82 | finish 83 | } 84 | 85 | update_apt() { 86 | if ! _exists apt; then 87 | return 88 | fi 89 | 90 | info "Updating Ubuntu and installed packages..." 91 | 92 | sudo apt update 93 | sudo apt upgrade -y 94 | sudo apt autoremove -y 95 | sudo apt autoclean -y 96 | 97 | finish 98 | } 99 | 100 | on_finish() { 101 | success "Done!" 102 | success "Happy Coding!" 103 | echo 104 | echo -ne "$RED"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 105 | echo -e "$RESET""$BOLD"',------,'"$RESET" 106 | echo -ne "$YELLOW"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 107 | echo -e "$RESET""$BOLD"'| /\_/\\'"$RESET" 108 | echo -ne "$GREEN"'-_-_-_-_-_-_-_-_-_-_-_-_-_-' 109 | echo -e "$RESET""$BOLD"'~|__( ^ .^)'"$RESET" 110 | echo -ne "$CYAN"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 111 | echo -e "$RESET""$BOLD"'"" ""'"$RESET" 112 | echo 113 | } 114 | 115 | on_error() { 116 | error "Wow... Something serious happened!" 117 | error "Though, I don't know what really happened :(" 118 | exit 1 119 | } 120 | 121 | main() { 122 | echo "Before we proceed, please type your sudo password:" 123 | sudo -v 124 | 125 | on_start "$*" 126 | update_dotfiles "$*" 127 | update_brew "$*" 128 | update_apt_get "$*" 129 | on_finish "$*" 130 | } 131 | 132 | main "$*" 133 | -------------------------------------------------------------------------------- /lib/aliases.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # Aliases 3 | # 4 | 5 | # Enable aliases to be sudo’ed 6 | # http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo 7 | alias sudo='sudo ' 8 | 9 | _exists() { 10 | command -v $1 > /dev/null 2>&1 11 | } 12 | 13 | # Just bcoz clr shorter than clear 14 | alias clr='clear' 15 | 16 | # Go to the /home/$USER (~) directory and clears window of your terminal 17 | alias q="~ && clear" 18 | 19 | # Folders Shortcuts 20 | [ -d ~/Downloads ] && alias dl='cd ~/Downloads' 21 | [ -d ~/Desktop ] && alias dt='cd ~/Desktop' 22 | [ -d ~/Projects ] && alias pj='cd ~/Projects' 23 | [ -d ~/Projects/Forks ] && alias pjf='cd ~/Projects/Forks' 24 | [ -d ~/Projects/Job ] && alias pjj='cd ~/Projects/Job' 25 | [ -d ~/Projects/Playground ] && alias pjl='cd ~/Projects/Playground' 26 | [ -d ~/Projects/Repos ] && alias pjr='cd ~/Projects/Repos' 27 | 28 | # Commands Shortcuts 29 | alias e="$EDITOR" 30 | alias -- +x='chmod +x' 31 | alias x+='chmod +x' 32 | 33 | # Open aliases 34 | alias open='open_command' 35 | alias o='open' 36 | alias oo='open .' 37 | alias term='open -a iterm.app' 38 | 39 | # Run scripts 40 | alias update="source $DOTFILES/scripts/update" 41 | alias bootstrap="source $DOTFILES/scripts/bootstrap" 42 | 43 | # Quick jump to dotfiles 44 | alias dotfiles="cd $DOTFILES" 45 | 46 | # Quick reload of zsh environment 47 | alias reload="source $HOME/.zshrc" 48 | 49 | # My IP 50 | alias myip='ifconfig | sed -En "s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p"' 51 | 52 | # Show $PATH in readable view 53 | alias path='echo -e ${PATH//:/\\n}' 54 | 55 | # Download web page with all assets 56 | alias getpage='wget --no-clobber --page-requisites --html-extension --convert-links --no-host-directories' 57 | 58 | # Download file with original filename 59 | alias get="curl -O -L" 60 | 61 | # Yarn 62 | alias ybw="yarn build:watch" 63 | alias yba="yarn build:all" 64 | alias ytw="yarn test:watch" 65 | alias ytu="yarn test:unit": 66 | 67 | # Use tldr as help util 68 | if _exists tldr; then 69 | alias help="tldr" 70 | fi 71 | 72 | alias git-root='cd $(git rev-parse --show-toplevel)' 73 | alias cdgr='git-root' 74 | 75 | # Avoid stupidity with trash-cli: 76 | # https://github.com/sindresorhus/trash-cli 77 | # or use default rm -i 78 | if _exists trash; then 79 | alias rm='trash' 80 | fi 81 | 82 | # Better ls with icons, tree view and more 83 | # https://github.com/eza-community/eza 84 | if _exists eza; then 85 | unalias ls 86 | alias ls='eza --icons --header --git' 87 | alias lt='eza --icons --tree' 88 | unalias l 89 | alias l='ls -l' 90 | alias la='ls -lAh' 91 | fi 92 | 93 | # cat with syntax highlighting 94 | # https://github.com/sharkdp/bat 95 | if _exists bat; then 96 | # Run to list all themes: 97 | # bat --list-themes 98 | export BAT_THEME='base16' 99 | alias cat='bat' 100 | fi 101 | 102 | # cd with zsh-z capabilities 103 | # https://github.com/ajeetdsouza/zoxide 104 | if _exists zoxide; then 105 | alias cd='z' 106 | fi 107 | 108 | # Lazygit 109 | # https://github.com/jesseduffield/lazygit 110 | if _exists lazygit; then 111 | alias lg='lazygit' 112 | fi 113 | -------------------------------------------------------------------------------- /home/.gitconfig: -------------------------------------------------------------------------------- 1 | [init] 2 | defaultBranch = main 3 | 4 | [color] 5 | ui = auto 6 | 7 | [column] 8 | ui = auto 9 | 10 | [color "diff"] 11 | meta = white bold 12 | frag = cyan bold 13 | old = red bold 14 | new = green bold 15 | 16 | [core] 17 | editor = vim 18 | excludesfile = ~/.gitignore 19 | attributesfile = ~/.gitattributes 20 | ignorecase = false 21 | compression = 0 22 | 23 | [branch] 24 | sort = -committerdate 25 | 26 | [push] 27 | default = current 28 | autoSetupRemote = true 29 | 30 | [pull] 31 | rebase = false 32 | 33 | # Automatically resolve conflicts 34 | # https://x.com/dillon_mulroy/status/1982514256340983981 35 | [rerere] 36 | enabled = true 37 | 38 | [protocol "file"] 39 | allow = always 40 | 41 | [alias] 42 | a = add 43 | ua = reset HEAD 44 | b = branch 45 | c = commit 46 | m = merge 47 | mc = merge --continue 48 | co = checkout # Checkout 49 | cb = checkout -b # Checkout branch 50 | sw = switch # Change branch 51 | swc = switch -c # Create new branch 52 | ap = add -p # Patch mode for specified files 53 | ca = commit -a # Add all files and commit 54 | cm = commit -m # Commit message 55 | cam = commit -am # Add all files and commit with message 56 | s = status -sb # Short status with current branch 57 | 58 | # Checkout to the latest master/main 59 | master = !git checkout master && git pull --prune 60 | main = !git checkout main && git pull --prune 61 | 62 | # Checkout to the latest develop 63 | develop = !git checkout develop && git pull --prune 64 | 65 | # Merge latest master/main to current branch 66 | remaster = !git fetch origin master:master && git merge master 67 | remain = !git fetch origin main:main && git merge main 68 | 69 | # When doing "git git log" or some such, do not complain about "git" 70 | git = !git 71 | 72 | # Commits log with pretty format 73 | l = log --all --graph --decorate --oneline 74 | 75 | # Fully commits log with statistic 76 | ll = log --stat --abbrev-commit 77 | 78 | # Ignore files: append file to .gitnignore 79 | ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo `\n$2` >> .gitignore 80 | 81 | # Initialize, add all files and commit 82 | this = !git init && git add . && git commit -m 'Initial commit' 83 | 84 | # Amend last commit 85 | amend = commit --amend 86 | 87 | # Ammend last commit with its original message 88 | redo = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend 89 | 90 | # Reset index changes, but not the working tree 91 | undo = reset --mixed HEAD^ 92 | 93 | # Checkout to HEAD revision 94 | discard = checkout -- 95 | 96 | # List of contributors and how many commits each person has. 97 | contrib = shortlog -sn 98 | 99 | # See how many lines of code you have written today. 100 | today = diff --shortstat --since="0 day ago" 101 | 102 | # Pull data from remote and push local data 103 | sync = !git pull && git push 104 | 105 | # Lazygit 106 | lazy = !lazygit 107 | 108 | # URL shorthands 109 | [url "git@github.com:"] 110 | insteadOf = "gh:" 111 | pushInsteadOf = "github:" 112 | pushInsteadOf = "git://github.com/" # From GIT to SSH 113 | [url "git@gist.github.com:"] 114 | insteadOf = "gst:" 115 | pushInsteadOf = "gist:" 116 | pushInsteadOf = "git://gist.github.com/" # From GIT to SSH 117 | 118 | # Add LFS commands 119 | [filter "lfs"] 120 | required = true 121 | clean = git-lfs clean -- %f 122 | smudge = git-lfs smudge -- %f 123 | process = git-lfs filter-process 124 | 125 | # Include local settings from .gitlocal 126 | # Requires Git 1.7.10 127 | # Setup: 128 | # git config -f ~/.gitlocal user.email "your@email.com" 129 | # git config -f ~/.gitlocal user.name "Name Lastname" 130 | # Example .gitlocal: 131 | # [user] 132 | # name = Denys Dovhan 133 | # email = denysdovhan@gmail.com 134 | [include] 135 | path = ~/.gitlocal 136 | -------------------------------------------------------------------------------- /home/.zshrc: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.zshrc 3 | # 4 | # ------------------------------------------------------------------------------ 5 | # Environment 6 | # ------------------------------------------------------------------------------ 7 | 8 | # Export path to root of dotfiles repo 9 | export DOTFILES=${DOTFILES:="$HOME/.dotfiles"} 10 | 11 | # Locale 12 | export LC_ALL=en_US.UTF-8 13 | export LANG=en_US.UTF-8 14 | export LANGUAGE=en_US.UTF-8 15 | 16 | # Do not override files using `>`, but it's still possible using `>!` 17 | set -o noclobber 18 | 19 | # Extend $PATH without duplicates 20 | _extend_path() { 21 | [[ -d "$1" ]] || return 22 | 23 | if ! echo "$PATH" | tr ":" "\n" | grep -qx "$1" ; then 24 | export PATH="$1:$PATH" 25 | fi 26 | } 27 | 28 | # Add custom bin to $PATH 29 | _extend_path "$HOME/.local/bin" 30 | _extend_path "$DOTFILES/bin" 31 | _extend_path "$HOME/.npm-global/bin" 32 | _extend_path "$HOME/.rvm/bin" 33 | _extend_path "$HOME/.yarn/bin" 34 | _extend_path "$HOME/.config/yarn/global/node_modules/.bin" 35 | _extend_path "$HOME/.bun/bin" 36 | 37 | # Extend $NODE_PATH 38 | if [ -d ~/.npm-global ]; then 39 | export NODE_PATH="$NODE_PATH:$HOME/.npm-global/lib/node_modules" 40 | fi 41 | 42 | # Default pager 43 | export PAGER='less' 44 | 45 | # less options 46 | less_opts=( 47 | # Quit if entire file fits on first screen. 48 | -FX 49 | # Ignore case in searches that do not contain uppercase. 50 | --ignore-case 51 | # Allow ANSI colour escapes, but no other escapes. 52 | --RAW-CONTROL-CHARS 53 | # Quiet the terminal bell. (when trying to scroll past the end of the buffer) 54 | --quiet 55 | # Do not complain when we are on a dumb terminal. 56 | --dumb 57 | ) 58 | export LESS="${less_opts[*]}" 59 | 60 | # Default editor for local and remote sessions 61 | if [[ -n "$SSH_CONNECTION" ]]; then 62 | # on the server 63 | if command -v vim >/dev/null 2>&1; then 64 | export EDITOR='vim' 65 | else 66 | export EDITOR='vi' 67 | fi 68 | else 69 | export EDITOR='vim' 70 | fi 71 | 72 | # Better formatting for time command 73 | export TIMEFMT=$'\n================\nCPU\t%P\nuser\t%*U\nsystem\t%*S\ntotal\t%*E' 74 | 75 | # ------------------------------------------------------------------------------ 76 | # Oh My Zsh 77 | # ------------------------------------------------------------------------------ 78 | export ZSH_DISABLE_COMPFIX=true 79 | 80 | # Autoload node version when changing cwd 81 | zstyle ':omz:plugins:nvm' autoload true 82 | 83 | # Use passphase from macOS keychain 84 | if [[ "$OSTYPE" == "darwin"* ]]; then 85 | zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain 86 | fi 87 | 88 | # ------------------------------------------------------------------------------ 89 | # Dependencies 90 | # ------------------------------------------------------------------------------ 91 | 92 | # Spaceship project directory (for local development) 93 | SPACESHIP_PROJECT="$HOME/Projects/Repos/spaceship/spaceship-prompt" 94 | 95 | # Reset zgen on change 96 | export ZGEN_RESET_ON_CHANGE=( 97 | "${HOME}/.zshrc" 98 | "${DOTFILES}"/lib/*.zsh 99 | "${DOTFILES}"/custom/*.zsh 100 | ) 101 | # Load zgen 102 | source "${HOME}/.zgen/zgen.zsh" 103 | 104 | # Load zgen init script 105 | if ! zgen saved; then 106 | echo "Creating a zgen save" 107 | 108 | zgen oh-my-zsh 109 | 110 | # Oh-My-Zsh plugins 111 | zgen oh-my-zsh plugins/brew 112 | zgen oh-my-zsh plugins/git 113 | zgen oh-my-zsh plugins/history-substring-search 114 | zgen oh-my-zsh plugins/sudo 115 | zgen oh-my-zsh plugins/command-not-found 116 | zgen oh-my-zsh plugins/npm 117 | zgen oh-my-zsh plugins/yarn 118 | zgen oh-my-zsh plugins/nvm 119 | zgen oh-my-zsh plugins/fnm 120 | zgen oh-my-zsh plugins/extract 121 | zgen oh-my-zsh plugins/ssh-agent 122 | zgen oh-my-zsh plugins/gpg-agent 123 | zgen oh-my-zsh plugins/macos 124 | zgen oh-my-zsh plugins/bgnotify 125 | zgen oh-my-zsh plugins/vscode 126 | zgen oh-my-zsh plugins/gh 127 | zgen oh-my-zsh plugins/common-aliases 128 | zgen oh-my-zsh plugins/direnv 129 | zgen oh-my-zsh plugins/docker 130 | zgen oh-my-zsh plugins/docker-compose 131 | zgen oh-my-zsh plugins/node 132 | zgen oh-my-zsh plugins/deno 133 | zgen oh-my-zsh plugins/bun 134 | zgen oh-my-zsh plugins/tldr 135 | zgen oh-my-zsh plugins/fzf 136 | 137 | # Like cd but with z-zsh capabilities 138 | if command -v zoxide >/dev/null 2>&1; then 139 | zgen oh-my-zsh plugins/zoxide 140 | fi 141 | 142 | # Per-directory env vars 143 | if command -v direnv >/dev/null 2>&1; then 144 | zgen oh-my-zsh plugins/direnv 145 | fi 146 | 147 | # Custom plugins 148 | zgen load chriskempson/base16-shell 149 | zgen load djui/alias-tips 150 | zgen load hlissner/zsh-autopair 151 | zgen load zsh-users/zsh-syntax-highlighting 152 | zgen load zsh-users/zsh-autosuggestions 153 | zgen load Aloxaf/fzf-tab 154 | 155 | # Files 156 | zgen load $DOTFILES/lib 157 | zgen load $DOTFILES/custom 158 | 159 | # Load Spaceship prompt from remote 160 | if [[ ! -d "$SPACESHIP_PROJECT" ]]; then 161 | zgen load spaceship-prompt/spaceship-prompt spaceship 162 | fi 163 | 164 | # Completions 165 | zgen load zsh-users/zsh-completions src 166 | 167 | # Save all to init script 168 | zgen save 169 | fi 170 | 171 | # Load Spaceship form local project 172 | if [[ -d "$SPACESHIP_PROJECT" ]]; then 173 | source "$SPACESHIP_PROJECT/spaceship.zsh" 174 | fi 175 | 176 | # ------------------------------------------------------------------------------ 177 | # Load additional zsh files 178 | # ------------------------------------------------------------------------------ 179 | 180 | # OpenAI Codex CLI completions 181 | if _exists codex; then 182 | eval "$(codex completion zsh)" 183 | fi 184 | 185 | # ------------------------------------------------------------------------------ 186 | # Overrides 187 | # ------------------------------------------------------------------------------ 188 | 189 | # Source local configuration 190 | if [[ -f "$HOME/.zshlocal" ]]; then 191 | source "$HOME/.zshlocal" 192 | fi 193 | 194 | # ------------------------------------------------------------------------------ 195 | 196 | -------------------------------------------------------------------------------- /scripts/bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Dotfiles and bootstrap installer 4 | # Installs git, clones repository and symlinks dotfiles to your home directory 5 | 6 | set -e 7 | trap on_error SIGTERM 8 | 9 | e='\033' 10 | RESET="${e}[0m" 11 | BOLD="${e}[1m" 12 | CYAN="${e}[0;96m" 13 | RED="${e}[0;91m" 14 | YELLOW="${e}[0;93m" 15 | GREEN="${e}[0;92m" 16 | 17 | _exists() { 18 | command -v "$1" > /dev/null 2>&1 19 | } 20 | 21 | # Success reporter 22 | info() { 23 | echo -e "${CYAN}${*}${RESET}" 24 | } 25 | 26 | # Error reporter 27 | error() { 28 | echo -e "${RED}${*}${RESET}" 29 | } 30 | 31 | # Success reporter 32 | success() { 33 | echo -e "${GREEN}${*}${RESET}" 34 | } 35 | 36 | # End section 37 | finish() { 38 | success "Done!" 39 | echo 40 | sleep 1 41 | } 42 | 43 | # Set directory 44 | export DOTFILES=${1:-"$HOME/.dotfiles"} 45 | GITHUB_REPO_URL_BASE="https://github.com/denysdovhan/dotfiles" 46 | HOMEBREW_INSTALLER_URL="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" 47 | 48 | on_start() { 49 | info " __ __ ____ _ __ " 50 | info " ____/ /____ / /_ / __/(_)/ /___ _____" 51 | info " / __ // __ \ / __// /_ / // // _ \ / ___/" 52 | info " _ / /_/ // /_/ // /_ / __// // // __/(__ ) " 53 | info " (_)\__,_/ \____/ \__//_/ /_//_/ \___//____/ " 54 | info " " 55 | info " by @denysdovhan " 56 | info " " 57 | 58 | info "This script will guide you through installing git, zsh and dofiles itself." 59 | echo "It will not install anything without your direct agreement!" 60 | echo 61 | read -p "Do you want to proceed with installation? [y/N] " -n 1 answer 62 | echo 63 | if [ "${answer}" != "y" ]; then 64 | exit 65 | fi 66 | } 67 | 68 | install_homebrew() { 69 | info "Trying to detect installed Homebrew..." 70 | 71 | if ! _exists brew; then 72 | echo "Seems like you don't have Homebrew installed!" 73 | read -p "Do you agree to proceed with Homebrew installation? [y/N] " -n 1 answer 74 | echo 75 | if [ "${answer}" != "y" ]; then 76 | return 77 | fi 78 | 79 | info "Installing Homebrew..." 80 | bash -c "$(curl -fsSL ${HOMEBREW_INSTALLER_URL})" 81 | else 82 | success "You already have Homebrew installed. Skipping..." 83 | fi 84 | 85 | finish 86 | } 87 | 88 | install_git() { 89 | info "Trying to detect installed Git..." 90 | 91 | if ! _exists git; then 92 | echo "Seems like you don't have Git installed!" 93 | read -p "Do you agree to proceed with Git installation? [y/N] " -n 1 answer 94 | echo 95 | if [ "${answer}" != "y" ]; then 96 | return 97 | fi 98 | 99 | info "Installing Git..." 100 | 101 | if [ "$(uname)" = "Darwin" ]; then 102 | brew install git 103 | elif [ "$(uname)" = "Linux" ]; then 104 | sudo apt install git 105 | else 106 | error "Error: Failed to install Git!" 107 | return 108 | fi 109 | else 110 | success "You already have Git installed. Skipping..." 111 | fi 112 | 113 | finish 114 | } 115 | 116 | install_zsh() { 117 | info "Trying to detect installed Zsh..." 118 | 119 | if ! _exists zsh; then 120 | echo "Seems like you don't have Zsh installed!" 121 | read -p "Do you agree to proceed with Zsh installation? [y/N] " -n 1 answer 122 | echo 123 | if [ "${answer}" != "y" ]; then 124 | return 125 | fi 126 | 127 | info "Installing Zsh..." 128 | 129 | if [ "$(uname)" = "Darwin" ]; then 130 | brew install zsh zsh-completions 131 | elif [ "$(uname)" = "Linux" ]; then 132 | sudo apt install zsh 133 | else 134 | error "Error: Failed to install Zsh!" 135 | return 136 | fi 137 | else 138 | success "You already have Zsh installed. Skipping..." 139 | fi 140 | 141 | if _exists zsh && [[ -z "$ZSH_VERSION" ]]; then 142 | info "Setting up Zsh as default shell..." 143 | 144 | echo "The script will ask you the password for sudo:" 145 | echo 146 | echo "1) When changing your default shell via chsh -s" 147 | echo 148 | 149 | chsh -s "$(command -v zsh)" || error "Error: Cannot set Zsh as default shell!" 150 | fi 151 | 152 | finish 153 | } 154 | 155 | install_software() { 156 | if [ "$(uname)" != "Darwin" ]; then 157 | return 158 | fi 159 | 160 | info "Installing software..." 161 | 162 | cd "$DOTFILES" 163 | 164 | # Homebrew Bundle 165 | if _exists brew; then 166 | brew bundle 167 | else 168 | error "Error: Brew is not available" 169 | fi 170 | 171 | cd - 172 | 173 | finish 174 | } 175 | 176 | install_npm() { 177 | # Do not instal npm on non-macOS machines 178 | if [ "$(uname)" != "Darwin" ]; then 179 | return 180 | fi 181 | 182 | info "Installing global npm packages..." 183 | 184 | packages=( 185 | commitizen 186 | npkill 187 | fkill-cli 188 | cz-conventional-changelog 189 | ) 190 | 191 | echo "Installing: ${packages[*]}" 192 | 193 | npm install -g "${packages[@]}" 194 | 195 | finish 196 | } 197 | 198 | on_finish() { 199 | echo 200 | success "Setup was successfully done!" 201 | success "Happy Coding!" 202 | echo 203 | echo -ne "$RED"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 204 | echo -e "$RESET""$BOLD"',------,'"$RESET" 205 | echo -ne "$YELLOW"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 206 | echo -e "$RESET""$BOLD"'| /\_/\\'"$RESET" 207 | echo -ne "$GREEN"'-_-_-_-_-_-_-_-_-_-_-_-_-_-' 208 | echo -e "$RESET""$BOLD"'~|__( ^ .^)'"$RESET" 209 | echo -ne "$CYAN"'-_-_-_-_-_-_-_-_-_-_-_-_-_-_' 210 | echo -e "$RESET""$BOLD"'"" ""'"$RESET" 211 | echo 212 | info "P.S: Don't forget to restart a terminal :)" 213 | echo 214 | } 215 | 216 | on_error() { 217 | echo 218 | error "Wow... Something serious happened!" 219 | error "Though, I don't know what really happened :(" 220 | error "In case, you want to help me fix this problem, raise an issue -> ${CYAN}${GITHUB_REPO_URL_BASE}issues/new${RESET}" 221 | echo 222 | exit 1 223 | } 224 | 225 | main() { 226 | on_start "$*" 227 | install_homebrew "$*" 228 | install_git "$*" 229 | install_zsh "$*" 230 | install_software "$*" 231 | install_npm "$*" 232 | on_finish "$*" 233 | } 234 | 235 | main "$*" 236 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Denys Dovhan’s dotfiles 2 | 3 |

4 | Spaceship with Hyper and One Dark 5 |

6 | 7 | There are tons of useful things in here: 8 | 9 | - The usefulness of [“Oh My ZSH!”](http://ohmyz.sh/) is already built–in. 10 | - [🚀⭐️ Spaceships](https://github.com/spaceship-prompt/spaceship-prompt) as a prompt. 11 | - 🐟 [Fish](https://fishshell.com/)-like autosuggestions. 12 | - Syntax highlighting of commands while they are typed. 13 | - Automatically closing and deleting of quotes and brackets when you type them. 14 | - Browser-like substring search for history. 15 | - [zgen](https://github.com/tarjoilija/zgen) for dependency management. 16 | - Useful [aliases](./lib/aliases.zsh). 17 | - Git config, global `.gitignore` file and aliases. 18 | - Dotfiles synchronization (`sync.py`) with backup. 19 | - Restoring old dotfiles (`restore.py`) from backup. 20 | - A lot of [useful bins](https://github.com/denysdovhan/dotfiles/tree/master/bin). 21 | - `update` script for updating dotfiles, npm, brew, gems, etc. 22 | 23 | Missing feature? 🍴 Fork this repo and make it better! 24 | 25 | ## Installation 26 | 27 | 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: 28 | 29 | Tell Git who you are using these commands: 30 | 31 | ```sh 32 | git config -f ~/.gitlocal user.email "email@yoursite.com" 33 | git config -f ~/.gitlocal user.name "Name Lastname" 34 | ``` 35 | 36 | Clone dotfiles repo: 37 | 38 | ```sh 39 | # Clone dotfiles repo 40 | git clone https://github.com/denysdovhan/dotfiles.git $HOME/.dotfiles 41 | 42 | # Go to the dotfiles directory 43 | cd $HOME/.dotfiles 44 | 45 | # Install dotfiles 46 | ./install 47 | ``` 48 | 49 | ## Updating 50 | 51 | Use single command to get latest updates: 52 | 53 | ``` 54 | update 55 | ``` 56 | 57 | This command will update dotfiles, their dependencies, `brew` or `apt-get` packages, global `npm` dependencies, `gem`s, `apm` plugins. 58 | 59 | ## Under the hood 60 | 61 | > **Note:** You may put your custom settings into `~/.zshlocal`. 62 | 63 | ### Projects tree 64 | 65 | I suggest you to organize project folder as follows: 66 | 67 | ``` 68 | ~/Projects 69 | ├── Forks # for GitHub fork 70 | ├── Job # for job projects 71 | ├── Playground # for short-term experiments 72 | └── Repos # for long-term projects 73 | ``` 74 | 75 | ### Aliases 76 | 77 | Aliases are gonna make your work fast and enjoyable. See code in `$DOTFILES/lib/aliases.zsh`. Here is what's included: 78 | 79 | - Aliases from Oh-My-Zsh. See [Oh-My-Zsh Cheatsheet](https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#commands) for more. 80 | - Easier navigation 81 | - **`..`** → `cd ..` 82 | - **`...`** → `cd ../..` 83 | - **`....`** → `cd ../../..` 84 | - **`.....`** → `cd ../../../..` 85 | - **`~`** → `cd ~` 86 | - **`-`** → `cd -` 87 | - Folders shortcuts 88 | - **`dl`** → `cd ~/Downloads` 89 | - **`dt`** → `cd ~/Desktop` 90 | - **`pj`** → `cd ~/Projects` 91 | - **`pjr`** → `cd ~/Projects/_Repos` 92 | - **`pjf`** → `cd ~/Projects/_Forks` 93 | - **`pl`** → `cd ~/Projects/_Playground/` 94 | - Commands Shortcuts 95 | - **`e`** → `$EDITOR` 96 | - **`+x`** → `chmod +x` 97 | - **`x+`** → `chmod +x` 98 | - **`ll`** → `ls -alF` 99 | - **`la`** → `ls -A` 100 | - **`l`** → `ls -CF` 101 | - Open 102 | - **`open `** — open file from terminal. 103 | - **`o `** — open file from terminal. 104 | - **`oo`** — open current folder. 105 | - Misc 106 | - **`update`** — get updates (Runs `$DOTFILES/scripts/update.zsh`). 107 | - **`dotfiles`** — jump quickly into dotfiles folder. 108 | - **`myip`** — my local IP address. 109 | - **`password`** — generate random password, copies it into clipboard and outputs it to terminal. 110 | - **`path`** — print $PATH in readable view. 111 | - **`getpage`** — download web page with all assets. 112 | - **`get`** — download file with original filename. 113 | 114 | ### Oh-My-Zsh plugins 115 | 116 | These OMZ plugins are included: 117 | 118 | - [`git`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git) — git aliases and functions. 119 | - [`npm`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/npm) — provides completion as well as adding many useful aliases. 120 | - [`yarn`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/yarn) — the same as for `npm`, but for `yarn` 121 | - [`nvm`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/nvm) — auto-sourcing `nvm`. 122 | - [`sudo`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sudo) — `[Esc] [Esc]` to re-run previous command with sudo. 123 | - [`ssh-agent`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/ssh-agent) — automatically starts ssh-agent to set up and load whichever credentials you want for ssh connections. 124 | - [`gpg-agent`](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/gpg-agent) — enables `gpg-agent` if it is not running. 125 | - More are listed in `.zshrc` (it's hard to keep the list updated). 126 | 127 | ### Bin 128 | 129 | Dotfiles also include some functions that will make your life easier. See code in [`bin/`](./bin). 130 | 131 | - `emptytrash` — empty the Trash on all mounted volumes and the main HDD. 132 | - `git-cleanup` — removes old Git branches and does other cleanup. 133 | - `git-fork` — add remote upsteam. 134 | - `git-upstream` — sync branch with upstream. 135 | - `gz` — get gzipped file size 136 | - `n` — runs given command using binary in `node_modules/.bin` of the current project. 137 | - `nyan` — print [nyan cat](https://www.youtube.com/watch?v=QH2-TGUlwu4). 138 | - `password` — generate a random password and copy it to the clipboard. 139 | 140 | ### Git 141 | 142 | > **Note:** Add your git user data and custom settings to `~/.gitlocal`. 143 | 144 | #### Configuration 145 | 146 | - UI color is `auto`. 147 | - Diff colors are: 148 | - `white bold` for meta information; 149 | - `cyan bold` for frag; 150 | - `red bold` for old lines; 151 | - `green bold` for new lines. 152 | - Default editor is [Vim](http://www.vim.org/) instead of [Vi](http://www.tutorialspoint.com/unix/unix-vi-editor.htm). 153 | - `push.default` set as `current`. 154 | - Automatic replacement `git://github.com/`, `gh:`, `github:` addresses as `git@github.com:` for GitHub. 155 | - Automatic replacement `git://gist.github.com/`, `gst:`, `gist:` addresses as `git@gist.github.com:` for Gists. 156 | - User custom settings gets from a `~/.gitlocal` file. 157 | 158 | #### Git Aliases 159 | 160 | - **`git a`** → `git add` — patch mode for specified files. 161 | - **`git ua`** → `git reset HEAD` — unstage files. 162 | - **`git b`** → `git branch` — list, create, or delete branches. 163 | - **`git c`** → `git commit` — record changes to the repository. 164 | - **`git co`** → `git checkout` — checkout a branch or paths to the working tree. 165 | - **`git ap`** → `git add -p` — add file contents to the index. 166 | - **`git ca`** → `git commit -a` — commit with automatically stage files that have been modified and deleted. 167 | - **`git cm`** → `git commit -m` — commit with commit message. 168 | - **`git cam`** → `git commit -am` — add all files and commit with message. 169 | - **`git s`** → `git status -sb` — short status with current branch. 170 | - **`git master`** — go to `master` branch and pull from remote. 171 | - **`git develop`** — go to `develop` branch and pull from remote. 172 | - **`git git`** — do not complain about `git git`. 173 | - **`git l`** — commits log with pretty single line format. 174 | - **`git ll`** — log with list of changed files for each commit. 175 | - **`git ignore`** — ignore files: append file to `.gitignore`. 176 | - **`git this`** — initialize, add all files and commit. 177 | - **`git amend`** — amend last commit. 178 | - **`git redo`** — amend last commit with its original message. 179 | - **`git undo`** → `reset --mixed HEAD^` — reset index changes, but not the working tree. 180 | - **`git discard`** → `checkout --` — discard changes. 181 | - **`git contrib`** — list of contributors and how many commits each person has. 182 | - **`git today`** — see how many lines of code you have written today. 183 | - **`git stat`** — how many lines of code in repo. 184 | - **`git sync`** — pull and push changes from/to remote. 185 | - **`git-root`** — go to repo root. 186 | - **`git-cleanup [--force]`** — removes old Git branches. 187 | - **`git-fork `** — add remote upstream. 188 | - **`git-upstream [branch]`** — sync branch with upstream (as default `master`). 189 | 190 | ## Resources 191 | 192 | Resources that I used to make these dotfiles better: 193 | 194 | - [GitHub ❤ ~/](http://dotfiles.github.com/) 195 | - [Mathias’s dotfiles](https://github.com/mathiasbynens/dotfiles) 196 | 197 | ## License 198 | 199 | MIT © [Denys Dovhan](https://denysdovhan.com) 200 | --------------------------------------------------------------------------------