Dev Cheatsheet

A collection of useful commands that I use frequently

Git

Managing profiles

There is a neat way to manage multiple git profiles, mainly the email address.

git config --global alias.work 'config user.email "roy@work"'
git config --global alias.personal 'config user.email "roy@home"'

Then within a project, run git work or git personal to set the local git profile.

Bash

Vim

Spell Checking

Enable spell checking with:

:se spell

Spelling corrections will be underlined, to fix a spelling error, move the cursor over it and press z=, then select the option from the list.

Repeating a command

@:

Sorting

Select some line of texts and run:

:sort
:%s/<pattern>//gn