Skip to content

Instantly share code, notes, and snippets.

@ryohey
Last active June 30, 2022 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryohey/6ebc6d0fe7697e697eb2ba3c955086a2 to your computer and use it in GitHub Desktop.
Save ryohey/6ebc6d0fe7697e697eb2ba3c955086a2 to your computer and use it in GitHub Desktop.
macOS を初期化したらやること

Apps

  • Xcode
  • Spark
  • BetterSnapTool

CLI

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Cask
# - Must to have
brew install --cask iterm2 1password google-japanese-ime google-chrome sourcetree
# - Optional
brew install --cask zoom github visual-studio-code android-studio sublime-text
# - Unity
brew install --cask unity-hub visual-studio
# - Browser versions available
brew install --cask slack spotify dropbox
# CLI
brew install fish mint rbenv node mergepbx
sudo gem install bundler

Settings

  • Change iTerm2 shell to fish /opt/homebrew/bin/fish
  • Change Spotlight Keyboard shortcut to Ctrl+Space (Remove Toggle IME Shortcut)
  • IME: ABC, 英数 (Google), ひらがな (Google)
  • Add fish_prompt.fish to ~/.config/fish/functions/
  • Add .gitconfig to ~/
  • Restore ssh key from Dropbox
  • Install Monokai Xcode Theme from https://github.com/hdoria/xcode-themes
git config --global credential.helper osxkeychain
[user]
name = ryohey
email = info@codingcafe.jp
#driver for merging Xcode project files
[mergetool "mergepbx"]
cmd = mergepbx "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red
new = green
[alias]
# add
a = add # add
chunkyadd = add --patch # stage commits chunk by chunk
#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
recent-branches = !git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='%(refname:short)'
# branch
b = branch -v # branch (verbose)
# commit
c = commit -m # commit with message
ca = commit -am # commit all with message
ci = commit # commit
amend = commit --amend # ammend your last commit
# checkout
co = checkout # checkout
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
# cherry-pick
cp = cherry-pick -x # grab a change from a branch
# diff
d = diff # diff unstaged changes
dc = diff --cached # diff staged changes
last = diff HEAD^ # diff last committed change
# log
l = log --graph --date=short
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
simple = log --pretty=format:\" * %s\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
# pull
pl = pull # pull
# push
ps = push # push
# rebase
rc = rebase --continue # continue rebase
rs = rebase --skip # skip rebase
# remote
r = remote -v # show remotes (verbose)
# reset
unstage = reset HEAD # remove files from index (tracking)
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
filelog = log -u # show changes to a file
mt = mergetool # fire up the merge tool
# stash
ss = stash # stash changes
sl = stash list # list stashes
sa = stash apply # apply stash (restore changes)
sd = stash drop # drop stashes (destory changes)
# status
s = status # status
st = status # status
stat = status # status
delete-merged = !git branch --merged | egrep -v '\\*|master|development' | xargs git branch -d
[core]
ignorecase = false
[credential]
helper = cache
[pull]
ff = only
[init]
defaultBranch = main
if status --is-interactive
# Suppress the greeting message
set fish_greeting
# Homebrew
fish_add_path /opt/homebrew/bin
# Setup rbenv
source (rbenv init -|psub)
end
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
# PWD
set_color $fish_color_cwd
echo -n (prompt_pwd)
set_color normal
printf '%s ' (__fish_git_prompt)
if not test $last_status -eq 0
set_color $fish_color_error
end
echo -n '$ '
set_color normal
end
@ryohey
Copy link
Author

ryohey commented Sep 1, 2021

Xcode の run script から見えるようにする

yonaskolb/Mint#188 (comment)

下記は Xcode から環境変数が読み込まれなかったので必要なし

set -Ux MINT_PATH $HOME/.mint
set -Ux MINT_LINK_PATH $MINT_PATH/bin
set -U fish_user_paths ~/.mint/bin $fish_user_path
git clone https://github.com/yonaskolb/Mint.git
swift run mint install yonaskolb/mint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment