Skip to content

Commit

Permalink
Merge branch 'release/0.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Abuelodelanada committed Feb 25, 2019
2 parents 1a644cc + ace6006 commit c368f58
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 11 deletions.
10 changes: 1 addition & 9 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(load "~/.emacs.d/automode")
(load "~/.emacs.d/hooks")
(load "~/.emacs.d/shortcuts")

(load "~/.emacs.d/tabbar")

(add-to-list 'default-frame-alist '(fullscreen . maximized)) ;; Maximize window at startup
(tool-bar-mode -1) ;; Hide toolbar
Expand Down Expand Up @@ -41,10 +41,6 @@


(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(blink-cursor-mode t)
'(custom-safe-themes
(quote
Expand Down Expand Up @@ -74,10 +70,6 @@
(face trailing tabs spaces newline empty indentation space-after-tab space-before-tab space-mark tab-mark newline-mark))))

(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:background "#000000" :foreground "#F8F8F2" :weight bold :height 110 :family "Ubuntu Mono"))))
'(cursor ((t (:background "turquoise1" :foreground "white smoke" :inverse-video t))))
'(flycheck-color-mode-line-error-face ((t (:box (:line-width 1 :color "DeepPink3") :weight bold))))
Expand Down
4 changes: 2 additions & 2 deletions shortcuts.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
(global-set-key (kbd "C-t") 'crear-tags) ;; Create tags shortcut
(global-set-key (kbd "C-x p") 'phpcbf)
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "M-<left>") 'previous-buffer)
(global-set-key (kbd "M-<right>") 'next-buffer)
(global-set-key (kbd "M-<left>") 'tabbar-backward)
(global-set-key (kbd "M-<right>") 'tabbar-forward)
(global-set-key (kbd "S-M-<down>") 'enlarge-window)
(global-set-key (kbd "S-M-<left>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-M-<right>") 'shrink-window-horizontally)
Expand Down
80 changes: 80 additions & 0 deletions tabbar.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
;;; package --- Summary
;;; Commentary:
;;; Code:

;; Taken from: https://amitp.blogspot.com/2018/10/emacs-prettier-tabbar.html
;; Tab Bar
(require 'tabbar)
(customize-set-variable 'tabbar-background-color "black")
(customize-set-variable 'tabbar-separator '(0.5))
(customize-set-variable 'tabbar-use-images t)
(tabbar-mode 1)

;; Colors
(set-face-attribute 'tabbar-default nil
:background "black" :foreground
"black" :distant-foreground "black"
:family "Helvetica Neue" :box nil)
(set-face-attribute 'tabbar-unselected nil
:background "gray80" :foreground "black" :box nil)
(set-face-attribute 'tabbar-modified nil
:foreground "DarkOrange" :box nil
:inherit 'tabbar-unselected)
(set-face-attribute 'tabbar-selected nil
:background "turquoise4" :foreground "white" :box nil)
(set-face-attribute 'tabbar-selected-modified nil
:inherit 'tabbar-selected :foreground "turquoise1" :box nil)
(set-face-attribute 'tabbar-button nil
:box nil)

;; Use Powerline to make tabs look nicer
;; (this needs to run *after* the colors are set)
(require 'powerline)
(defvar my/tabbar-height 20)
(defvar my/tabbar-left (powerline-wave-right 'tabbar-default nil my/tabbar-height))
(defvar my/tabbar-right (powerline-wave-left nil 'tabbar-default my/tabbar-height))
(defun my/tabbar-tab-label-function (tab)
(powerline-render (list my/tabbar-left
(format " %s " (car tab))
my/tabbar-right)))
(setq tabbar-tab-label-function #'my/tabbar-tab-label-function)


;; Group tabs by project/directory, and hide some buffers
;; <https://www.emacswiki.org/emacs/TabBarMode#toc15>
(defun my/tabbar-buffer-groups ()
(cond ((member (buffer-name)
'("*Completions*"
"*scratch*"
"*Messages*"
"*Ediff Registry*"))
(list "#hide"))
(t (list (or (cdr (project-current))
(expand-file-name default-directory))))))


;; Keep tabs sorted <https://www.emacswiki.org/emacs/TabBarMode#toc7>
(defun tabbar-add-tab (tabset object &optional _append_ignored)
"Add to TABSET a tab with value OBJECT if there isn't one there yet.
If the tab is added, it is added at the beginning of the tab list,
unless the optional argument APPEND is non-nil, in which case it is
added at the end."
(let ((tabs (tabbar-tabs tabset)))
(if (tabbar-get-tab object tabset)
tabs
(let ((tab (tabbar-make-tab object tabset)))
(tabbar-set-template tabset nil)
(set tabset (sort (cons tab tabs)
(lambda (a b) (string< (buffer-name (car a))
(buffer-name (car b))))))))))


(defun toggle-tabbar ()
"Run toggle-tabbar"
(interactive)
(run-tabbar-settings)
(tabbar-mode (if tabbar-mode -1 1)))


(provide 'tabbar)
;;; alias.el ends here

0 comments on commit c368f58

Please sign in to comment.