Skip to content

Latest commit

 

History

History

setup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Scripts

osx

Sane OSX defaults. Based on ~/.osx by @mathiasbynens.

setup

Installs Homebrew, Git, git-friendly, Node.js, etc.

Tips & Tricks

Separate Git identity for work repositories

Assuming your work repositories are inside the ~/PIZZA folder.

  1. First create a separate Git config:
git config -f ~/PIZZA/.gitconfig user.email "artem@pizza.io"
git config -f ~/PIZZA/.gitconfig user.name "Artem Sapegin"
  1. Then create ~/.gitlocal file:
[includeIf "gitdir:~/PIZZA/"]
    path = ~/PIZZA/.gitconfig

Per repository Git identity

cd ~/repo
git config user.email "artem.sapegin@pizza.io"
git config user.name "Artem Sapegin"

How to make Home and End keys behave like on Windows

Create ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
  "\UF729"  = moveToBeginningOfParagraph:; // home
  "\UF72B"  = moveToEndOfParagraph:; // end
  "$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
  "$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
  "^\UF729" = moveToBeginningOfDocument:; // ctrl-home
  "^\UF72B" = moveToEndOfDocument:; // ctrl-end
  "^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
  "^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}

How to open files in different apps depending on their location by Cmd+click in iTerm2

Create a script:

#!/usr/bin/env bash

if [[ "$1" == /Users/admin/badoo/* ]]; then
  /usr/local/bin/pstorm "$1"
  open /Applications/PhpStorm.app # Focus
else
  open "$1"
fi

Go to iTerm2 preferences → Profiles → Advanced → Semantic History. Choose Run command and type: /Users/admin/bin/iopen "\1".

Useful iTerm2 triggers

Go to iTerm2 preferences → Profiles → Advanced → Triggers. Click Edit.

Description RegExp Action Color
Highlight Git merge conflicts CONFLICT \([^)]+\)\:.* Highlight Text Text: f2ac00