-
-
Save lexdene/7540775 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
在.emacs.d/core/prelude-core.el最后添加函数 | |
(defun prelude-py-taglist (arg) | |
"简易版taglist" | |
(interactive "P") | |
(let ((buffer-other | |
(if arg | |
"*py-taglist*" | |
(format "*py-taglist from %s*" (buffer-name))))) | |
(occur-1 "class \\|def " nil | |
(if arg | |
(delq nil (mapcar (lambda (buffer) | |
(when (eq 'python-mode | |
(with-current-buffer buffer)) | |
buffer)) | |
(buffer-list))) | |
(list (current-buffer))) | |
buffer-other) | |
(let ((line (line-number-at-pos))) | |
(switch-to-buffer-other-window buffer-other) | |
(end-of-buffer) | |
(while (and (search-backward-regexp "^ *\\([0-9]+\\):" nil t) | |
(> (string-to-int (match-string 1)) line)) t)))) |
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
然后在.emacs.d/core/prelude-mode.el 82 行添加一个绑定 --- 看心情放什么地方啦 | |
(define-key map (kbd "C-c v") 'prelude-py-taglist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment