Dotfiles - A restore point for sync your settings and preferences in your toolbox.

| A restore point for sync your settings and preferences in your toolbox.

Why it's awesome

Dotfiles provides a fast setup for backup, restore, and sync the prefs and settings for your toolbox. Dotfiles might be the most important files on your machine and I hope it helps you as much as it helps me!

Table of Contents

Usage

Start reading this document to see it is not difficult as you might have imagined. Just follow the step by step.

NOTE: This tips is just a personal reference, use with care.

Homebrew

Homebrew is the package manager for macOS (or Linux).

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Dependencies

brew install git heroku nvm wget yarn

Apps

brew cask install appcleaner authy browserstacklocal caffeine docker google-chrome flume franz lastpass logitech-presentation kap sketch slack sourcetree spotify visual-studio-code vlc

Plugins

brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize webpquicklook suspicious-package quicklookase qlvideo && mv ~/Downloads/.qlgenerator > ~/Library/QuickLook && qlmanage -r

Visual Studio Code

Plugins

Visual Studio Code is a source-code editor developed by Microsoft.

code --install-extension aaron-bond.better-comments && code --install-extension christian-kohler.path-intellisense && code --install-extension codezombiech.gitignore && code --install-extension dbaeumer.vscode-eslint && code --install-extension deerawan.vscode-whitespacer && code --install-extension dracula-theme.theme-dracula && code --install-extension eamodio.gitlens && code --install-extension EditorConfig.EditorConfig && code --install-extension eg2.vscode-npm-script && code --install-extension esbenp.prettier-vscode && code --install-extension formulahendry.auto-close-tag && code --install-extension formulahendry.auto-complete-tag && code --install-extension formulahendry.auto-rename-tag && code --install-extension formulahendry.code-runner && code --install-extension formulahendry.terminal && code --install-extension JerryHong.autofilename && code --install-extension mikestead.dotenv && code --install-extension ms-vscode.sublime-keybindings && code --install-extension ms-vscode.vscode-typescript-tslint-plugin && code --install-extension msjsdiag.debugger-for-chrome && code --install-extension NathanRidley.autotrim && code --install-extension PKief.material-icon-theme && code --install-extension Shan.code-settings-sync && code --install-extension Tyriar.lorem-ipsum && code --install-extension WakaTime.vscode-wakatime && code --install-extension xabikos.JavaScriptSnippets && code --install-extension Zignd.html-css-class-completion

After install, confirm all plugins installed:

code --list-extensions

Settings

{
  "files.autoSave": "onFocusChange",
  "files.autoSaveDelay": 0,
  "files.defaultLanguage": "en",
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "editor.detectIndentation": true,
  "editor.detectIndentation": true,
  "files.trimTrailingWhitespace": true,
  "editor.fontSize": 14,
  "editor.tabSize": 2,
  "markdown.preview.fontSize": 14,
  "window.openFilesInNewWindow": "on",
  "workbench.colorTheme": "Dracula",
  "workbench.iconTheme": "material-icon-theme"
}

Google Chrome

Google Chrome is a cross-platform web browser developed by Google.

Plugins

Github

GitHub is provides hosting for software development version control using Git.

SSH Settings

  1. Generating public/private rsa key pair
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
  2. Start the ssh-agent in the background
    eval "$(ssh-agent -s)"
  3. Creating config file
    printf "ServerAliveInterval 60\nHost github.com\nHostname ssh.github.com\nPort 443\n" > ~/.ssh/config
  4. Add your SSH private key to the ssh-agent and store your passphrase in the keychain.
    ssh-add -K ~/.ssh/id_rsa
  5. Copy the SSH key to your clipboard.
    pbcopy < ~/.ssh/id_rsa.pub
  6. Now access Github SSH Settings to add the SSH key
    https://github.com/settings/ssh/new

GPG Settings

https://gist.github.com/troyfontaine/18c9146295168ee9ca2b30c00bd1b41e

Git Settings

Make it even easier version control ~/.gitconfig

[user]
    name = CJ Patoilo
    email = [email protected]
    signingkey = "Your Sign In Key"

[branch]
    autosetupmerge = always

[alias]
    ci = commit -am
    lo = log --pretty=format:'%an - %h %s %ar'
    st = status
    br = branch
    sw = show
    df = diff
    fe = fetch
    mg = merge
    rb = rebase
    rt = remote -v
    co = checkout
    po = push origin
    pu = pull origin
    pom = push origin master
    pum = pull origin master
    com = checkout master
    pod = push origin develop
    pud = pull origin develop
    cod = checkout develop
    pog = push origin gh-pages
    pug = pull origin gh-pages
    cog = checkout gh-pages
    lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative

[core]
    excludesfile = ~/.gitignore_global

[commit]
    template = ~/.stCommitMsg

[difftool "sourcetree"]
    cmd = opendiff \"$LOCAL\" \"$REMOTE\"
    trustExitCode = true
    path =

[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    required = true
    process = git-lfs filter-process

[mergetool "sourcetree"]
    cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
    trustExitCode = true

Terminal

The Terminal is an interface that allows you to access the command line from the GUI.

Bash Settings

First create Bash Profile file mkdir ~/.bash_profile and add this content:

# Show current Git branch name in bash PS1
source "$HOME/.gitprompt"
PS1="\[\033[1;36m\]\u\[\033[32m\]\$(__git_ps1)\[\033[0m\] $\[\033[0m\] "

# Define alias

alias reload="source ~/.bash_profile"
alias cls="clear"
alias www="cd $HOME/Www/"

# Add local bin for all Homebrew stuff

export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"

export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"

# GPG2

macOS

macOS is a series of graphical operating systems developed and marketed by Apple Inc.

xcode-select --install

Settings

defaults write com.apple.spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
'{"enabled" = 1;"name" = "PDF";}' \
'{"enabled" = 1;"name" = "FONTS";}' \
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 0;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 0;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "SOURCE";}'

Contributing

Want to contribute? Follow these recommendations.

Designed with ♥ by CJ Patoilo. Licensed under the MIT License.