我想在buffer-menu
中点击T
( Shift + t )这么简单。它隐藏所有非文件访问缓冲区,仅显示文件访问缓冲区。我想在ibuffer中,我可以通过一些/
组合激活过滤器吗?
答案 0 :(得分:2)
从Emacs 26.1开始 / v 运行ibuffer-filter-by-visiting-file
:
将当前视图限制为访问文件的缓冲区。
新闻档案说:
***新的过滤器命令' ibuffer-filter-by-basename', ' ibuffer-filter-by-file-extension',' ibuffer-filter-by-directory', ' ibuffer-filter-by-starred-name',' ibuffer-filter-by-modified' 和' ibuffer-filter-by-visiting-file&#39 ;;分别绑定 到' / b',' /. 39;,' //',' / *',' / i& #39;和' / v'。
此版本中ibuffer还有许多其他增强功能,因此Emacs 26用户应该参考新闻更多。
Emacs 25.x(和24.x)用户可以像这样获取它:
(when (version< emacs-version "26")
(with-eval-after-load "ibuf-ext"
(define-ibuffer-filter visiting-file
"Limit current view to buffers that are visiting a file."
(:description "visiting a file"
:reader nil)
(with-current-buffer buf (buffer-file-name))))
(with-eval-after-load "ibuffer"
(autoload 'ibuffer-filter-by-visiting-file "ibuf-ext")
(define-key ibuffer-mode-map (kbd "/ v") 'ibuffer-filter-by-visiting-file)))