With 'shellslash' set, tempname() returns a filename with forward slashes, which trips up the type command if we don't translate to backslashes first. Fixes half of #212.
fugitive#head() returns the name of the current branch. If the current HEAD is detached, fugitive#head() will return the empty string, unless the optional 'len' argument is given, in which case the hash of the current HEAD will be truncated to 'len' characters. This makes should make life easier for people who don't want to use the default provided by fugitive#statusline()
Previously s:Detect() wasnt getting called for nerdtree buffers. I have added two autocmd events to nerdtree - NERDTreeInit and NERDTreeNewRoot. These are called when a tree is created, and when the user changes the root. Catch these events and call s:Detect() with the tree root path.