diff --git a/.gitattributes b/.gitattributes index 723eb67..856dac2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,26 +17,32 @@ OWNERS text *.DOCX diff=astextplain # Shell -*.sh eol=lf +*.sh eol=lf +*.zsh eol=lf +*.awk eol=lf +*.aliases eol=lf # Git *.gitattributes eol=lf linguist-language=gitattributes *.gitignore eol=lf *.gitkeep eol=lf +*.gitmodules eol=lf .gitattributes export-ignore .gitignore export-ignore .gitkeep export-ignore +.gitmodules export-ignore # configs .editorconfig eol=lf +.tmux.conf eol=lf # markdown *.md text diff=markdown eol=lf # vim -*.vim eol=lf -.vimrc eol=lf -.gvimrc eol=lf +*.vim eol=lf +.vimrc eol=lf +.vimrc.settings eol=lf # yaml *.yaml eol=lf @@ -58,6 +64,9 @@ OWNERS text .ruby-version eol=lf Gemfile eol=lf +# homebrew +Brewfile eol=lf + # python *.py diff=python eol=lf *.py3 diff=python eol=lf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d61e466 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,7 @@ +# https://git-scm.com/docs/gitmodules +[submodule ".oh-my-zsh"] + path = .oh-my-zsh + url = http://github.com/robbyrussell/oh-my-zsh.git +[submodule ".vim/bundle/Vundle.vim"] + path = .vim/bundle/Vundle.vim + url = https://github.com/VundleVim/Vundle.vim.git diff --git a/README.md b/README.md index 0aa3e8a..e5ef5ab 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ## macOS -This repo depends on the [Homesick](https://github.com/technicalpickles/homesick) & [Homebrew](https://github.com/Homebrew/brew) projects to manage system dotfiles. +This git repo depends on the [Homebrew](https://github.com/Homebrew/brew), [Homesick](https://github.com/technicalpickles/homesick) & [Spaceship Prompt](https://github.com/spaceship-prompt/spaceship-prompt) projects to manage system dotfiles. ### Required: Ruby -[Homebrew - Ruby](https://www.ruby-lang.org/en/documentation/installation/) +###### [Homebrew - Ruby](https://www.ruby-lang.org/en/documentation/installation/) ``` brew install ruby @@ -24,7 +24,7 @@ brew install ruby --- -### Post-configurations +## Git submodules #### Set up VundleVim @@ -46,37 +46,29 @@ export ZSH="${HOME}/.oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` -#### Set up Spaceship (Theme) +## Post-configurations -###### [zsh - Spaceship](https://github.com/spaceship-prompt/spaceship-prompt) +#### Theme - Set up Spaceship + +###### [Spaceship Prompt](https://github.com/spaceship-prompt/spaceship-prompt) ``` brew install spaceship ``` -#### Set up Nerd Fonts (Fonts) +#### Fonts - Set up Nerd Fonts -###### [zsh - Nerd Fonts](https://github.com/ryanoasis/nerd-fonts) +###### [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts) ``` brew tap homebrew/cask-fonts brew install --cask font-hack-nerd-font ``` -#### Set up coreutils - -###### [homebrew - coreutils](https://formulae.brew.sh/formula/coreutils) - -``` -brew install coreutils -``` - -#### Set up pre-commit +#### Homebrew -###### [homebrew - pre-commit](https://pre-commit.com/#installation) +###### [Brewfile](home/Brewfile) ``` -brew install pre-commit +brew bundle ``` - ---- diff --git a/home/.config/spaceship/spaceship.zsh b/home/.config/spaceship/spaceship.zsh index d0249ba..fa27263 100644 --- a/home/.config/spaceship/spaceship.zsh +++ b/home/.config/spaceship/spaceship.zsh @@ -8,8 +8,9 @@ ## Time SPACESHIP_TIME_SHOW=true +SPACESHIP_TIME_PREFIX="·" SPACESHIP_TIME_SUFFIX="|" -SPACESHIP_TIME_FORMAT='%W%t' +SPACESHIP_TIME_FORMAT='%W %t' SPACESHIP_TIME_COLOR='white' ## Prompt (Char) diff --git a/home/.gemrc b/home/.gemrc index 882316e..a746897 100644 --- a/home/.gemrc +++ b/home/.gemrc @@ -1 +1,11 @@ +--- gem: --no-rdoc --no-ri +--- +gem: --no-ri --no-rdoc +:verbose: false +:backtrace: false +:bulk_threshold: 1000 +:update_sources: true +:sources: + - https://rubygems.org + - https://gems.rubyforge.org diff --git a/home/.gitconfig b/home/.gitconfig index f87352c..ec40907 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -2,21 +2,22 @@ # https://git-scm.com/docs/git-config ; core variables [core] - whitespace = trailing-space,space-before-tab - editor = vim - filemode = false + whitespace = trailing-space,space-before-tab,cr-at-eol + editor = vim + filemode = false ; template # git config --global init.templateDir ~/.git-template # pre-commit init-templatedir ~/.git-template [init] - templatedir = "~/.git-template" + templatedir = "~/.git-template" + defaultBranch = main ; color [color] - ui = auto + ui = auto showBranch = auto - status = auto + status = auto ; Defaults [pull] @@ -36,6 +37,8 @@ ; Aliases [alias] + br = branch + co = checkout gconf = config --global -e hash = rev-parse HEAD ghist = log --pretty=format:'%C(dim cyan)%G?%C(reset) %C(yellow)%h%C(reset) - %C(green)(%cr)%C(reset) %C(bold white)%an%C(reset) %s %C(bold blue)%d%C(reset)' --graph --date-order --date=relative --abbrev-commit @@ -46,11 +49,15 @@ ; user [user] - name = "[name]" - email = email@email.com + name = "full name" + email = email@email.com + username = "username" ; credential # Cache credentials in memory for a short period of time [credential] #credential.helper=osxkeychain helper = cache --timeout 7200 + +# [url "git@github.com:"] +# insteadOf = https://github.com/ diff --git a/home/.sh/brew-helper.zsh b/home/.sh/brew-helper.zsh index ea701a1..f9c90ec 100755 --- a/home/.sh/brew-helper.zsh +++ b/home/.sh/brew-helper.zsh @@ -4,15 +4,17 @@ # Doc: https://docs.brew.sh/Installation#macos-requirements # Command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -# Ask for the administrator password upfront. +# Ask for the administrator password upfront sudo -v + +## Settings # HOMEBREW_PREFIX=/usr/local # HOMEBREW_CELLAR=/usr/local/Cellar # HOMEBREW_REPOSITORY=/usr/local/Homebrew # export HOMEBREW_PREFIX HOMEBREW_CELLAR HOMEBREW_REPOSITORY HOMEBREW_CASK_OPTS export HOMEBREW_CASK_OPTS="--appdir=~/Applications" -# Info +## Info # sudo xcode-select --install # brew --env # brew cat dos2unix @@ -21,22 +23,25 @@ export HOMEBREW_CASK_OPTS="--appdir=~/Applications" ## Permission issues # sudo chown -R $(whoami) $(brew --prefix)/* +## Brew # Check for brew (Homebrew) if command -v brew 1>/dev/null 2>&1; then - ## Update & upgrade + # Update & upgrade brew update && brew upgrade - # Install brew packages + # Install core packages brew install -sq coreutils # Install GNU core utilities brew install -sq wget # Install GNU wget brew install -sq findutils # Install GNU find, locate, updatedb, and xargs, g-prefixed brew install -sq gnupg # Install GNU gpg (GnuPG) brew install -sq tree # Install GNU tree - brew install -sq pre-commit # Install pre-commit package manager (https://pre-commit.com/#install) + brew install -sq dos2unix # Install GNU dos2unix - ## Create symlinks - #sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum + # Install other packages + brew install -sq tmux # Install tmux + brew install -sq jq # Install jq + brew install -sq pre-commit # Install pre-commit package manager (https://pre-commit.com/#install) - ## Remove outdated versions + # Remove outdated versions brew cleanup fi diff --git a/home/.sh/nerd-fonts.zsh b/home/.sh/nerd-fonts.zsh index 6c3af88..fd918bf 100755 --- a/home/.sh/nerd-fonts.zsh +++ b/home/.sh/nerd-fonts.zsh @@ -2,6 +2,8 @@ # shellcheck disable=all # https://github.com/ryanoasis/nerd-fonts # https://github.com/ryanoasis/nerd-fonts#option-4-homebrew-fonts + +## Brew # Check for brew (Homebrew) if command -v brew 1>/dev/null 2>&1; then # Install brew packages diff --git a/home/.sh/oh-my-zsh-helper.zsh b/home/.sh/oh-my-zsh-helper.zsh index e7cbd4b..6838d57 100755 --- a/home/.sh/oh-my-zsh-helper.zsh +++ b/home/.sh/oh-my-zsh-helper.zsh @@ -2,6 +2,4 @@ # shellcheck disable=all # https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh typeset -r ZSH="${HOME}/.oh-my-zsh" -export ZSH - -sh -c "$(curl -fsSL 'https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh')" +export ZSH && sh -c "$(curl -fsSL 'https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh')" diff --git a/home/.sh/powerline-fonts.zsh b/home/.sh/powerline-fonts.zsh index 398363a..e660494 100755 --- a/home/.sh/powerline-fonts.zsh +++ b/home/.sh/powerline-fonts.zsh @@ -2,4 +2,4 @@ # shellcheck disable=all # https://github.com/powerline/fonts # https://powerline.readthedocs.io/en/master/installation.html#pip-installation -pip3 install --user powerline-status \ No newline at end of file +pip3 install --user powerline-status diff --git a/home/.sh/spaceship.zsh b/home/.sh/spaceship.zsh new file mode 100644 index 0000000..a514d6d --- /dev/null +++ b/home/.sh/spaceship.zsh @@ -0,0 +1,11 @@ +#!/bin/zsh +# shellcheck disable=all +# https://github.com/spaceship-prompt/spaceship-prompt + +## Brew +# Check for brew (Homebrew) +if command -v brew 1>/dev/null 2>&1; then + # Themes & Fonts + brew install -sq spaceship # Theme, https://github.com/spaceship-prompt/spaceship-prompt + brew install -sq font-hack-nerd-font # Fonts, https://github.com/ryanoasis/nerd-fonts +fi diff --git a/home/.sh/vscode-helper.zsh b/home/.sh/vscode-helper.zsh index 22a1e8f..8a0b29d 100755 --- a/home/.sh/vscode-helper.zsh +++ b/home/.sh/vscode-helper.zsh @@ -4,6 +4,7 @@ # https://code.visualstudio.com/download # https://code.visualstudio.com/docs/setup/mac +## Settings, .zprofile # Adding Visual Studio Code (code) to .zprofile typeset -r ZPROFILE="${HOME}/.zprofile" typeset -r vscode_app_path='/Applications/Visual Studio Code.app/Contents/Resources/app/bin' @@ -16,6 +17,7 @@ EOF source "${ZPROFILE}" fi +## Extensions # code --list-extensions # code --install-extension vscode-icons-team.vscode-icons@11.19.0 # @installed diff --git a/home/.zshrc b/home/.zshrc index 4de8db8..0351c2b 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -1,9 +1,24 @@ # .zshrc # shellcheck disable=all # https://zsh.sourceforge.io/Guide/zshguide02.html -LANG=en_US.UTF-8 -LC_ALL=en_US.UTF-8 -export LANG LC_ALL + +# ## Locale +# LANG=en_US.UTF-8 +# LC_ALL=en_US.UTF-8 +# export LANG LC_ALL + +## Completion +# Rebuild: rm -f ~/.zcompdump && compinit +autoload -Uz compinit +compinit +COMPLETION_WAITING_DOTS="%F{blue}…%f" +export COMPLETION_WAITING_DOTS + +## History +# zstyle -L, zstyle :completion:history-words: +zstyle ':completion:*:history-words' menu yes # activate menu +zstyle ':completion:*:history-words' remove-all-dups yes # ignore duplicate entries +setopt EXTENDED_HISTORY ## Colors # man ls | grep -A 50 'LSCOLORS' @@ -13,39 +28,31 @@ LSCOLORS=Gxfxcxdxbxegedabagacad zstyle ':completion:*' list-colors "${(s.:.)LSCOLORS}" export CLICOLOR COLORTERM LSCOLORS -## Completion -autoload -U compinit -compinit -COMPLETION_WAITING_DOTS="%F{blue}…%f" -export COMPLETION_WAITING_DOTS - ## ZSH w/.oh-my-zsh # https://github.com/ohmyzsh/ohmyzsh ZSH="${HOME}/.oh-my-zsh" -zstyle ':omz:update' mode reminder # Set omz update reminder -#ZSH_THEME="spaceship" # Set theme to load. (agnoster, rkj-repos, ys) -source $(brew --prefix)/opt/spaceship/spaceship.zsh # (brew install spaceship), https://github.com/spaceship-prompt/spaceship-prompt +zstyle ':omz:update' mode reminder # Set omz update reminder export ZSH ## Plugins # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) plugins=(git macos brew ssh-agent tmux) -# Load SSH identities +## Load SSH identities # id_rsa gitlab_priv gitlab_work github_priv github_work zstyle ':omz:plugins:ssh-agent' identities id_rsa +## Source # Start oh-my-zsh source "${ZSH}/oh-my-zsh.sh" - -# Source other configs +# Aliases source "${HOME}/.aliases" -## History -# zstyle -L, zstyle :completion:history-words: -zstyle ':completion:*:history-words' menu yes # activate menu -zstyle ':completion:*:history-words' remove-all-dups yes # ignore duplicate entries -setopt EXTENDED_HISTORY +## Themes +#ZSH_THEME="spaceship" # Set theme to load. (agnoster, rkj-repos) +source $(brew --prefix)/opt/spaceship/spaceship.zsh # (brew install spaceship), https://github.com/spaceship-prompt/spaceship-prompt + +## Additional Configurations # ## Python, pyenv # if command -v pyenv 1>/dev/null 2>&1; then diff --git a/home/Brewfile b/home/Brewfile index a0b5531..07c3cef 100644 --- a/home/Brewfile +++ b/home/Brewfile @@ -1,22 +1,29 @@ # Brewfile # https://github.com/Homebrew/homebrew-bundle -# tap "homebrew/cask" + +## Taps +tap "homebrew/core" tap "homebrew/cask-fonts" +## Settings # set arguments for all 'brew install --cask' commands cask_args appdir: "~/Applications", require_sha: true -# Install brew packages -brew "coreutils" # Install GNU core utilities -brew "wget" # Install GNU wget -brew "findutils" # Install GNU find, locate, updatedb, and xargs, g-prefixed -brew "gnupg" if OS.mac? # Install GNU gpg (GnuPG) -brew "tree" # Install GNU tree +## Brew +# Install core packages +brew "coreutils" +brew "wget" +brew "findutils" +brew "gnupg" if OS.mac? +brew "tree" +brew "dos2unix" -# Others +# Install other packages #brew "mysql@5.6", restart_service: true, link: true, conflicts_with: ["mysql"] # MySQL 5.6 +brew "tmux" +brew "jq" brew "pre-commit" # Install pre-commit package manager (https://pre-commit.com/#install) # Themes & Fonts brew "spaceship" # Theme, https://github.com/spaceship-prompt/spaceship-prompt -brew "font-hack-nerd-font" # Fonts, https://github.com/ryanoasis/nerd-fonts \ No newline at end of file +cask "font-hack-nerd-font" # Fonts, https://github.com/ryanoasis/nerd-fonts