Git bash notes

From raju

default font used by git bash

Lucida Console, 9-point

To use this in gvim

    set guifont=Lucida_Console:h9:cANSI:qDRAFT

PS1 in git bash

    # By default git bash sets the bash prompt to
    # $ echo $PS1
    # \[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
    # which makes the system very slow. Change it to make it faster.
    export PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[0m\]\n$'


vim and gvim

    # for gvim
    # I want to use gvim custom installed in /c/Program\ Files\ \(x86\)/Vim/vim80/gvim.exe
    # and vim that comes with git bash (/usr/bin/vim).
    # There is no gvim in git bash. The vim in 
    # /c/Program\ Files\ \(x86\)/Vim/vim80/ cannot be run from git bash as it gives
    #   Vim: Error: This version of Vim does not run in a Cygwin terminal
    # As a work around add /c/Program\ Files\ \(x86\)/Vim/vim80 to the end of the
    # path.
    export PATH=$PATH:"/c/Program Files (x86)/Vim/vim80"

always background gvim

By default when gvim is run from git bash, the command prompt does not return. One way around this is to add '&' to background the job. But I always forget to do that. To work around this, I have the following in ~/.bashrc so gvim commands are always backgrounded.

    # Always background gvim
        abs_gvim=`which gvim`
        "$abs_gvim" "$@" &