Pages

Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Install Powerline for Mac OS X

Powerline is a shell prompt and statusline plugin for vim, written in Python. It makes working with terminal much more fun and colorful. Here is an example of how the prompt looks like with Powerline.

As you can see from the screenshot, powerline gives you a colorful and visual attractive prompt. If you are in a git repository, it also tells you which branch you are currently working on. It also tells you the exit code of previous process (the number in the last red tab), etc. In this post, I'll show you how to install and setup powerline for Mac OS X bash shell and vim.

Git aliases with autocompletion

If you are using git on daily basis, you probably want to create some shorthands, aka. aliases, to save time. The very first option that is documented in tutorials and books about git is through git configuration.

$ vi ~/.gitconig

[alias]
st = status
co = checkout
br = branch
up = rebase
ci = commit

Update bash shell for Mac OS X

Apple releases software update quite often but, unfortunately, bash shell is never updated. The version of bash shell that comes with Max OS is quite old and lacks many features such as globing, exclude-dir when grepping, etc. If you need these features, you will need to update bash shell. First, check the version of your bash.


$ echo $BASH_VERSION
3.2.53(1)-release

$ which bash
/bin/bash