Created
April 7, 2013 12:35
-
-
Save carlwoodward/5330325 to your computer and use it in GitHub Desktop.
Add a line every time a file is opened or saved to ~/vim_files.csv. Tracks git branch and commit. Useful for time tracking. NOTE: this does slow down your save slightly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd BufWritePre,BufRead * exec 'silent :! echo "%:p,`date`,`if [ -d $(pwd)/.git ]; then GIT_DIR=$(pwd)/.git git rev-parse --abbrev-ref HEAD; fi`,`if [ -d $(pwd)/.git ]; then GIT_DIR=$(pwd)/.git git log --pretty=format:\"\%h\" -n 1; fi`" >> ~/vim_files.csv &' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment