Browse Source

Add centaur-tabs hide buffers list

master
Riyyi 4 years ago
parent
commit
abfad5cd8b
  1. 66
      .emacs.d/config.org

66
.emacs.d/config.org

@ -290,14 +290,20 @@ Places buffers as tabs in a bar at the top.
:after all-the-icons :after all-the-icons
:demand :demand
:custom :custom
(centaur-tabs-height 40) (centaur-tabs-height 38)
(centaur-tabs-modified-marker "•")
(centaur-tabs-set-icons t) (centaur-tabs-set-icons t)
(centaur-tabs-set-modified-marker t)
(centaur-tabs-style "slant") (centaur-tabs-style "slant")
;; (centaur-tabs-set-modified-marker t) :hook
;; (centaur-tabs-modified-marker "*") ((eshell-mode
;; (centaur-tabs-height 29) help-mode
;; (centaur-tabs-set-icons nil) helpful-mode
:hook (neotree-mode . centaur-tabs-local-mode) neotree-mode
occur-mode
shell-mode
term-mode)
. centaur-tabs-local-mode)
:config :config
(centaur-tabs-mode)) (centaur-tabs-mode))
#+END_SRC #+END_SRC
@ -612,7 +618,7 @@ https://github.com/laishulu/hl-fill-column
(:eval (:eval
(if (buffer-file-name) (if (buffer-file-name)
(concat (concat
(if (buffer-modified-p) " *" nil) (if (buffer-modified-p) " " nil)
" (" " ("
(abbreviate-file-name (abbreviate-file-name
(directory-file-name (directory-file-name
@ -811,25 +817,23 @@ Set UTF-8 encoding as default.
(display-buffer-in-side-window) (display-buffer-in-side-window)
(window-height . 0.25) (window-height . 0.25)
(side . bottom) (side . bottom)
(slot . -1) (slot . -1))
(centaur-tabs-local-mode 1)) ("\\*Faces\\*"
(display-buffer-in-side-window)
(window-height . 0.25)
(side . bottom)
(slot . 1))
("\\*Help.*" ("\\*Help.*"
(display-buffer-in-side-window) (display-buffer-in-side-window)
(window-height . 0.25) (window-height . 0.25)
(side . bottom) (side . bottom)
(slot . 0) (slot . 0))
(centaur-tabs-local-mode 1)) ("\\*Occur\\*"
("\\*Faces\\*"
(display-buffer-in-side-window) (display-buffer-in-side-window)
(window-height . 0.25) (window-height . 0.25)
(side . bottom) (side . bottom)
(slot . 1) (slot . 1))
(centaur-tabs-local-mode 1))
)) ))
(add-hook 'shell-mode-hook 'centaur-tabs-local-mode)
(add-hook 'eshell-mode-hook 'centaur-tabs-local-mode)
(add-hook 'help-mode-hook 'centaur-tabs-local-mode)
#+END_SRC #+END_SRC
* Functions * Functions
@ -944,17 +948,33 @@ Functions that use package functionality.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun centaur-tabs-buffer-groups () (defun centaur-tabs-buffer-groups ()
"Organize tabs into groups." "Organize tabs into groups by buffer."
(list (list
(cond (cond
((string-equal "*" (substring (buffer-name) 0 1)) "Emacs") ((string-equal "*" (substring (buffer-name) 0 1)) "Emacs")
((derived-mode-p 'dired-mode) "Dired")
((memq major-mode '(org-mode ((memq major-mode '(org-mode
org-agenda-mode emacs-lisp-mode)) "Org Mode")
diary-mode ((derived-mode-p 'dired-mode) "Dired")
emacs-lisp-mode)) "OrgMode") ((derived-mode-p 'prog-mode
'text-mode) "Editing")
(t "User")))) (t "User"))))
(defun centaur-tabs-hide-tab (buffer)
"Hide from the tab bar by BUFFER name."
(let ((name (format "%s" buffer)))
(string-match-p
(concat "^\\*\\("
"e?shell\\|"
"Completions\\|"
"clangd\\|" ; lsp c/c++
"Faces\\|"
"Help\\|"
"helpful\\|"
"iph\\|" ; lsp php
"Occur"
"\\).*")
name)))
(defun dashboard-goto-bookmarks () (defun dashboard-goto-bookmarks ()
"Go to bookmarks." "Go to bookmarks."
(interactive) (interactive)

Loading…
Cancel
Save