我一直在寻找互联网并没有提出解决方案。有谁知道如何跳转到 html 文件中的 css 声明并打开一个新的缓冲区,指向或接近该声明?
编辑
经过更多搜索后,我决定使用搜索打开缓冲区的字符串方法。
;; CSS search 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)
感觉就像这是一个黑客。