您好我打開了緩衝自行車擺放在我的.emacs緩衝循環:避免劃傷和消息緩衝
(global-set-key (kbd "<C-tab>") 'bury-buffer)
以下命令,但是,而騎自行車我怎麼避免通過郵件和scrratch緩衝區其中循環 總是存在於任何emacs緩衝區列表中。我從來沒有使用這些緩衝區,併成爲眼瘡通過我的緩衝列表
您好我打開了緩衝自行車擺放在我的.emacs緩衝循環:避免劃傷和消息緩衝
(global-set-key (kbd "<C-tab>") 'bury-buffer)
以下命令,但是,而騎自行車我怎麼避免通過郵件和scrratch緩衝區其中循環 總是存在於任何emacs緩衝區列表中。我從來沒有使用這些緩衝區,併成爲眼瘡通過我的緩衝列表
騎車時如果你從來不使用臨時緩衝區,只需添加到您的.emacs自動關閉 :
(殺緩衝區 「*刮*」)
我還發現this code在Emacs wiki應該做你想要什麼:
; necessary support function for buffer burial
(defun crs-delete-these (delete-these from-this-list)
"Delete DELETE-THESE FROM-THIS-LIST."
(cond
((car delete-these)
(if (member (car delete-these) from-this-list)
(crs-delete-these (cdr delete-these) (delete (car delete-these)
from-this-list))
(crs-delete-these (cdr delete-these) from-this-list)))
(t from-this-list)))
; this is the list of buffers I never want to see
(defvar crs-hated-buffers
'("KILL" "*Compile-Log*"))
; might as well use this for both
(setq iswitchb-buffer-ignore (append '("^ " "*Buffer") crs-hated-buffers))
(defun crs-hated-buffers()
"List of buffers I never want to see, converted from names to buffers."
(delete nil
(append
(mapcar 'get-buffer crs-hated-buffers)
(mapcar (lambda (this-buffer)
(if (string-match "^ " (buffer-name this-buffer))
this-buffer))
(buffer-list)))))
; I'm sick of switching buffers only to find KILL right in front of me
(defun crs-bury-buffer (&optional n)
(interactive)
(unless n
(setq n 1))
(let ((my-buffer-list (crs-delete-these (crs-hated-buffers)
(buffer-list (selected-frame)))))
(switch-to-buffer
(if (< n 0)
(nth (+ (length my-buffer-list) n)
my-buffer-list)
(bury-buffer)
(nth n my-buffer-list)))))
(global-set-key [(control tab)] 'crs-bury-buffer)
(global-set-key [(control meta tab)] (lambda()
(interactive)
(crs-bury-buffer -1)))
您需要劃痕和消息緩衝區添加到變量crs-hated-buffers
,例如:
(add-to-list 'crs-hated-buffers "*Messages*")
(add-to-list 'crs-hated-buffers "*scratch*")
盧克的回答您的具體問題。在我個人的經驗中,緩衝區循環作爲最近使用的堆棧而不是Emacs的默認循環函數更有用。也就是說,你最近使用的緩衝區應該冒泡到棧頂,類似於alt-tab在Windows中的工作方式。
有很多包在wiki上執行此操作。 buffer-stack
是我推薦的。它有一個默認排除緩衝區列表,我已經包含了我的buffer-stack-suppl
配置,它進行了相同的主模式過濾。如果您提出有關buffer-stack
的問題,我會盡我所能提供幫助。
好吧,如果你使用ido-mode
循環緩衝區之間可以設置ido-ignore-buffers
以匹配要忽略的緩衝區。從文檔:
匹配要忽略的緩衝區名稱的正則表達式或函數的列表。 例如,傳統行爲不是列出其名稱以 帶有空格的緩衝區,其中正則表達式爲「`」。請參閱 過濾緩衝區名稱的示例函數的源文件。
有關ido-mode
查看更多資訊:Introduction to ido-mode
所有緩衝區我沒有用,如劃痕,消息和完成,與我的工作流程混亂。
我設法徹底擺脫它們,沒有以任何方式破壞emacs。
發佈第一here和波紋管粘貼:
將此放在你的。emacs的:
;; Makes *scratch* empty.
(setq initial-scratch-message "")
;; Removes *scratch* from buffer after the mode has been set.
(defun remove-scratch-buffer()
(if (get-buffer "*scratch*")
(kill-buffer "*scratch*")))
(add-hook 'after-change-major-mode-hook 'remove-scratch-buffer)
;; Removes *messages* from the buffer.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")
;; Removes *Completions* from buffer after you've opened a file.
(add-hook 'minibuffer-exit-hook
'(lambda()
(let ((buffer "*Completions*"))
(and (get-buffer buffer)
(kill-buffer buffer)))))
;; Don't show *Buffer list* when opening multiple files at the same time.
(setq inhibit-startup-buffer-menu t)
;; Show only one active window when opening multiple files at the same time.
(add-hook 'window-setup-hook 'delete-other-windows)
獎勵:
;; No more typing the whole yes or no. Just y or n will do.
(fset 'yes-or-no-p 'y-or-n-p)
是的是的謝謝! –
如何使用通配符,當我問緩衝棧總是忽略/ untrack一定的緩衝?例如如果我想要它添加到未追蹤列表* .html我該怎麼做? – incandescentman