Created
February 9, 2013 05:02
-
-
Save jrichter/4743908 to your computer and use it in GitHub Desktop.
Search any open css buffers for searchTerm
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
;; CSS search if there are open buffers | |
(defun search-open-css-buffers-for-region-or-word () | |
"Use the current region/point and search open css buffers" | |
(interactive) | |
(let (searchTerm) | |
(setq searchTerm | |
(if (region-active-p) | |
(buffer-substring-no-properties (region-beginning) (region-end)) | |
(thing-at-point 'symbol))) | |
(multi-occur (mapcar (lambda (buf) | |
(if (string-match "\w*.css" (buffer-name buf)) | |
buf)) (buffer-list)) | |
searchTerm 5))) | |
(global-set-key (kbd "M-s-.") 'search-open-css-buffers-for-region-or-word) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment