Here's a tip you might find useful if you work with
git and you use Vim. I recently came up with it.
For example, I want to see a file in different branch while staying in my current branch(so without changing the branch). I could use command like:
git show branch_name:/path/to/file.pl
But what if I want to see this file in Vim? It's easy, I could run a command like:
git show branch_name:/path/to/file.pl | vim -
However, this way there's no syntax highlight, so we can fix this:
git show branch_name:/path/to/file.pl | vim - -c 'set syntax=perl'
That's nice :) now my Perl file is properly highlighted.
Okay, but what if I work with Perl, and Python, and Bash, etc. It's not very handy to type all of this every time.
Here's one solution - you could create aliases:
alias vim.py="vim - -c 'set syntax=python'" alias vim.pl="vim - -c 'set syntax=perl'"
So next time you need to see a Python file in different branch than your current one, you could run:
git show branch_name:/path/to/file.py | vim.py
I hope you find this useful.
I share tips like this in Mastering Vim Quickly newsletter at http://masteringvim.com.