Created
May 17, 2013 10:11
-
-
Save handlename/5598226 to your computer and use it in GitHub Desktop.
This file contains 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
(defun my:chomp (str) | |
(replace-regexp-in-string "[\n\r]+$" "" str)) | |
(defun my:git-project-p () | |
(string= | |
(my:chomp | |
(shell-command-to-string "git rev-parse --is-inside-work-tree")) | |
"true")) | |
(defun my:tig-blame-current-file () | |
(interactive) | |
(if (git-project-p) | |
(progn | |
(shell-command | |
(format "tmux new-window 'cd %s; tig blame -- %s'" | |
(file-name-directory buffer-file-name) | |
(file-name-nondirectory buffer-file-name))) | |
(shell-command (format "open -a iTerm"))))) | |
(global-set-key (kbd "C-c o b") 'my:tig-blame-current-file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment