Created
June 28, 2012 03:04
-
-
Save vmi/3008607 to your computer and use it in GitHub Desktop.
change buffer name for chef
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
;;; Chef's cookbooks has too many "default.rb". | |
;;; This hook is for detecting each "default.rb". | |
(defun chef-rename-buffer () | |
(let ((fn (buffer-file-name))) | |
(and (stringp fn) | |
(string-match "/cookbooks/\\(.+\\)" fn) | |
(rename-buffer (match-string 1 fn) t)))) | |
(add-hook 'find-file-hook | |
'chef-rename-buffer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment