@@ -66,6 +66,7 @@ Commandline-tools (including [SDK headers](https://github.com/pyenv/pyenv/wiki#s
6666``` bash
6767# install homebrew and command-line tools, SDK headers
6868/usr/bin/ruby -e " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) "
69+ xcode-select --install
6970sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
7071# check wether all is good
7172brew doctor
@@ -78,7 +79,8 @@ brew tap buo/cask-upgrade # `brew cu -a docker` - https://github.com/buo/homebr
7879brew install \
7980 git git-lfs bash-completion rsync curl openssl readline automake xz zlib \
8081 sshfs htop ncdu direnv pwgen \
81- gcc@8 rust ruby node yarn sqlite3
82+ gcc@8 rust ruby node@12 sqlite3
83+ npm install -g yarn
8284```
8385
8486
@@ -88,7 +90,9 @@ brew install \
8890brew cask install iterm2
8991brew tap homebrew/cask-fonts
9092brew cask install font-inconsolatalgc-nerd-font
91- cargo install exa ripgrep # ls, rg
93+ cargo install ripgrep # rg (search for regex occurrences in directory)
94+ cargo install zoxide # z (cd with auto-complete)
95+ cargo install --git https://github.com/ogham/exa.git
9296# use exa with icons and git status instead of builtin ls
9397alias ls=" exa --all --group-directories-first --icons --level=2" # default level for --tree
9498alias ll=" ls --long --sort=age --git --time=modified --time-style=iso"
@@ -101,6 +105,8 @@ alias ll="ls --long --sort=age --git --time=modified --time-style=iso"
101105# Docker CE - docker.com/community-edition
102106brew cask install docker
103107brew install docker-compose
108+ # PostgresApp - postgresapp.com
109+ brew cask install postgres
104110# Sublime Text - sublimetext.com
105111brew cask install sublime-text
106112# Sublime Merge - sublimemerge.com
@@ -172,15 +178,19 @@ mas install 595191960
172178 git clone https://github.com/momo-lab/pyenv-install-latest.git " $( pyenv root) " /plugins/pyenv-install-latest
173179 git clone git://github.com/concordusapps/pyenv-implict.git " $( pyenv root) " /plugins/pyenv-implict
174180 # list all available python versions
175- pyenv install -l
181+ pyenv install -l | grep ' ^\s*[0-9] '
176182 pyenv install-latest 2.7
177183 pyenv install-latest 3.7
184+ sudo SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/ pyenv install-latest 3.8 # might need to unsource .bash_profile first
178185 pyenv global $( pyenv install-latest --print 3.7) $( pyenv install-latest --print 2.7) # set default versions: prefer py3 over py2
179186 source ~ /.bash_profile # global history etc
180- pip install --upgrade pip setuptools wheel Cython
187+ pip3.7 install --upgrade pip setuptools wheel Cython
188+ pip2.7 install --upgrade pip setuptools wheel Cython
189+ pip3.8 install --upgrade pip setuptools wheel Cython
181190 # install virtualenv 'vv' based latest pyenv Python version 3.7, inheriting installed packages
182191 pyenv virtualenv $( pyenv install-latest --print 3.7) --system-site-packages vv
183192 pyenv virtualenv $( pyenv install-latest --print 2.7) --system-site-packages vv27
193+ pyenv virtualenv $( pyenv install-latest --print 3.8) --system-site-packages vv38
184194 ```
185195- Manage envs
186196 ``` bash
@@ -220,7 +230,7 @@ Note: first open Chrome for the first time
220230- iStat Menus preferences: ` File/Import Settings... ` , select ` iStat Menus Settings.ismp `
221231- Quickly download audio & video with [ ` yt ` ] ( https://github.com/ddelange/yt )
222232 ``` bash
223- git clone https://github.com/ ddelange/yt.git ~ /git/yt && brew install youtube-dl
233+ brew install ddelange/brewformulae/yt
224234 ```
225235
226236
@@ -277,6 +287,16 @@ git config --global icdiff.options "--highlight --line-numbers --numlines=3"
277287git config --global difftool.icdiff.cmd ' icdiff --highlight --line-numbers --numlines=3 $LOCAL $REMOTE'
278288```
279289
290+ ##### Mergetool
291+
292+ On failed automatic merge, use Sublime Merge GUI for conflict resolution using ` git mergetool ` or ` git mt ` (see below).
293+ ``` bash
294+ git config --global mergetool.smerge.cmd ' smerge mergetool "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"'
295+ git config --global mergetool.smerge.trustExitCode true
296+ git config --global mergetool.keepBackup false
297+ git config --global merge.tool smerge
298+ ```
299+
280300
281301##### Aliases
282302
@@ -289,13 +309,16 @@ git config --global alias.camend "commit --amend -am"
289309git config --global alias.amend " commit --amend --no-edit -a"
290310git config --global alias.br " branch"
291311git config --global alias.co " checkout"
312+ git config --global alias.mt " mergetool"
292313git config --global alias.lg " log --graph --decorate --pretty=oneline --abbrev-commit"
293314git config --global alias.fp " fetch -p --all" # purge and fetch all remotes
315+ git config --global alias.defaultbranch ' ! f() { echo $(git remote show origin | grep "HEAD branch" | cut -d ":" -f 2 | xargs); }; f' # https://stackoverflow.com/questions/28666357#comment101797372_50056710
294316git config --global alias.df ' ! f() { git icdiff --color=always "$@" | less -eR; }; f' # no FX (keep output in terminal)
295317git config --global alias.pr ' ! git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"'
296318git config --global alias.dm ' ! git fetch -p && for branch in `git branch -vv | grep ' " ': gone] ' | awk '" ' {print $1}' " '" ' `; do git branch -D $branch; done' # 'delete merged' - local branches that have been deleted on remote
297- git config --global alias.gg ' ! f() { git checkout "${1:-master }" && git dm && git pull; }; f'
319+ git config --global alias.gg ' ! f() { git checkout "${1:-$(git defaultbranch) }" && git dm && git pull; }; f' # git gg develop -- no arg: defaultbranch. Return to default branch (or specified branch), delete merged, pull branch
298320git config --global alias.pall ' ! f() { START=$(git branch | grep "\*" | sed "s/^.//"); for i in $(git branch | sed "s/^.//"); do git checkout $i; git pull || break; done; git checkout $START; }; f' # 'pull all' - pull local branches that have been updated on remote
321+ git config --global alias.undo ' ! f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' # https://megakemp.com/2016/08/25/git-undo/
299322```
300323
301324
0 commit comments