From 9284f1b22fe553db752fda2a538024d09617cdf3 Mon Sep 17 00:00:00 2001 From: Nicholas Houle <181gaming@gmail.com> Date: Tue, 25 Oct 2022 12:54:20 -0700 Subject: [PATCH 1/3] dotfiles | Minor additions and orginization changes --- home/.config/spaceship/spaceship.zsh | 5 ++-- home/.sh/brew-helper.zsh | 7 +++++- home/.zshrc | 35 ++++++++++++++++------------ home/Brewfile | 15 +++++++----- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/home/.config/spaceship/spaceship.zsh b/home/.config/spaceship/spaceship.zsh index d0249ba..7f31c0c 100644 --- a/home/.config/spaceship/spaceship.zsh +++ b/home/.config/spaceship/spaceship.zsh @@ -8,8 +8,9 @@ ## Time SPACESHIP_TIME_SHOW=true -SPACESHIP_TIME_SUFFIX="|" -SPACESHIP_TIME_FORMAT='%W%t' +SPACESHIP_TIME_PREFIX="·[ " +SPACESHIP_TIME_SUFFIX=" ]" +SPACESHIP_TIME_FORMAT='%W %t' SPACESHIP_TIME_COLOR='white' ## Prompt (Char) diff --git a/home/.sh/brew-helper.zsh b/home/.sh/brew-helper.zsh index ea701a1..0ef2447 100755 --- a/home/.sh/brew-helper.zsh +++ b/home/.sh/brew-helper.zsh @@ -26,12 +26,17 @@ if command -v brew 1>/dev/null 2>&1; then ## Update & upgrade brew update && brew upgrade - # Install brew packages + # Install somre 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 dos2unix # Install GNU dos2unix + + # Install other packages + brew install tmux # Install tmux + brew install jq # Install jq brew install -sq pre-commit # Install pre-commit package manager (https://pre-commit.com/#install) ## Create symlinks diff --git a/home/.zshrc b/home/.zshrc index 4de8db8..2d9b005 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -1,9 +1,18 @@ # .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 ## Colors # man ls | grep -A 50 'LSCOLORS' @@ -13,34 +22,30 @@ 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 -# Start oh-my-zsh +## Start oh-my-zsh source "${ZSH}/oh-my-zsh.sh" -# Source other configs +## Source other configs source "${HOME}/.aliases" +## 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 + ## History # zstyle -L, zstyle :completion:history-words: zstyle ':completion:*:history-words' menu yes # activate menu diff --git a/home/Brewfile b/home/Brewfile index a0b5531..34a03d3 100644 --- a/home/Brewfile +++ b/home/Brewfile @@ -6,15 +6,18 @@ tap "homebrew/cask-fonts" # 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 +# Install core packages +brew "coreutils" +brew "wget" +brew "findutils" +brew "gnupg" if OS.mac? +brew "tree" +brew "dos2unix" # Others #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 From afc500700081ba3b7eaab5943630ec149ec7f26d Mon Sep 17 00:00:00 2001 From: Nicholas Houle <181gaming@gmail.com> Date: Tue, 25 Oct 2022 12:57:23 -0700 Subject: [PATCH 2/3] Fix typo --- home/.sh/brew-helper.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.sh/brew-helper.zsh b/home/.sh/brew-helper.zsh index 0ef2447..eb00549 100755 --- a/home/.sh/brew-helper.zsh +++ b/home/.sh/brew-helper.zsh @@ -26,7 +26,7 @@ if command -v brew 1>/dev/null 2>&1; then ## Update & upgrade brew update && brew upgrade - # Install somre core 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 From 1a5e6ca1c2545c82c543b5940e4807a02d670b9f Mon Sep 17 00:00:00 2001 From: Nicholas Houle <181gaming@gmail.com> Date: Tue, 25 Oct 2022 16:55:52 -0700 Subject: [PATCH 3/3] Add git submodules --- .gitattributes | 17 +++++++++++---- .gitmodules | 7 ++++++ README.md | 32 +++++++++++----------------- home/.config/spaceship/spaceship.zsh | 4 ++-- home/.gemrc | 10 +++++++++ home/.gitconfig | 23 +++++++++++++------- home/.sh/brew-helper.zsh | 20 ++++++++--------- home/.sh/nerd-fonts.zsh | 2 ++ home/.sh/oh-my-zsh-helper.zsh | 4 +--- home/.sh/powerline-fonts.zsh | 2 +- home/.sh/spaceship.zsh | 11 ++++++++++ home/.sh/vscode-helper.zsh | 2 ++ home/.zshrc | 18 +++++++++------- home/Brewfile | 10 ++++++--- 14 files changed, 103 insertions(+), 59 deletions(-) create mode 100644 .gitmodules create mode 100644 home/.sh/spaceship.zsh 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 7f31c0c..fa27263 100644 --- a/home/.config/spaceship/spaceship.zsh +++ b/home/.config/spaceship/spaceship.zsh @@ -8,8 +8,8 @@ ## Time SPACESHIP_TIME_SHOW=true -SPACESHIP_TIME_PREFIX="·[ " -SPACESHIP_TIME_SUFFIX=" ]" +SPACESHIP_TIME_PREFIX="·" +SPACESHIP_TIME_SUFFIX="|" SPACESHIP_TIME_FORMAT='%W %t' SPACESHIP_TIME_COLOR='white' 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 eb00549..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,9 +23,10 @@ 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 core packages @@ -32,16 +35,13 @@ if command -v brew 1>/dev/null 2>&1; then 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 dos2unix # Install GNU dos2unix + brew install -sq dos2unix # Install GNU dos2unix # Install other packages - brew install tmux # Install tmux - brew install jq # Install jq + 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) - ## Create symlinks - #sudo ln -s /usr/local/bin/gsha256sum /usr/local/bin/sha256sum - - ## 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 2d9b005..0351c2b 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -14,6 +14,12 @@ 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' CLICOLOR=1 @@ -36,21 +42,17 @@ plugins=(git macos brew ssh-agent tmux) # id_rsa gitlab_priv gitlab_work github_priv github_work zstyle ':omz:plugins:ssh-agent' identities id_rsa -## Start oh-my-zsh +## Source +# Start oh-my-zsh source "${ZSH}/oh-my-zsh.sh" - -## Source other configs +# Aliases source "${HOME}/.aliases" ## 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 -## 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 +## Additional Configurations # ## Python, pyenv # if command -v pyenv 1>/dev/null 2>&1; then diff --git a/home/Brewfile b/home/Brewfile index 34a03d3..07c3cef 100644 --- a/home/Brewfile +++ b/home/Brewfile @@ -1,11 +1,15 @@ # 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 +## Brew # Install core packages brew "coreutils" brew "wget" @@ -14,7 +18,7 @@ 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" @@ -22,4 +26,4 @@ brew "pre-commit" # Install pre-commit package manager (https://pre-commit.com/# # 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