Emacs+git: Adding Git Identity to the Emacs Frame Title
I am a heavy emacs person, so, when I started using Git, I really wanted to see what Git branch I am working on, and in what repository along with the frame title. I worked the problem by making a couple of tweaks to my ~/.bashrc and my ~/.emacs.d/init.el configuration.
First, I instructed my ~/.bashrc to set up two new environment variables for git (GIT_BRANCH & GIT_REPO_NAME):
1
| |
Next, you use the environment variables that are set in your ~/.emacs.d/init.el like so:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Note that everytime a new bash prompt appears, the environment variables are reset (this is good), but the environment variable does not change (within emacs, i.e.) as the working buffer changes from one directory to another (this is not so good because the other directory might be a different git repo/branch). I have to figure out a way to constantly refresh the frame title to reflect the current buffer’s git identity/status.
Here are some references that I am going to use to get me started: Emacs wiki and Emacs-fu.