Ruler instead of fci-mode.

This commit is contained in:
tastytea 2019-04-24 22:03:52 +02:00
parent db7512fc76
commit 3ed8d4f429
2 changed files with 59 additions and 47 deletions

104
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file. ;;; init.el --- tastytea's Emacs init file.
;; Time-stamp: <2019-04-23T05:51:51+00:00> ;; Time-stamp: <2019-04-24T19:56:37+00:00>
;;; Commentary: ;;; Commentary:
;; I am using this file with Emacs 26, but most of it will probably work with ;; I am using this file with Emacs 26, but most of it will probably work with
@ -144,6 +144,16 @@
;; Always add a newline at the and of the file. ;; Always add a newline at the and of the file.
(setq require-final-newline t) (setq require-final-newline t)
(use-package emacs
:config
(defun my/set-fill-column-80 ()
"Set fill-column to 80."
(set-fill-column 80))
:hook
(prog-mode . my/set-fill-column-80)
(conf-mode . my/set-fill-column-80)
(text-mode . auto-fill-mode)) ; Enable word-wrapping at fill-column.
;;;;;;;;;;;;;;;;;;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package bind-key (use-package bind-key
:init :init
@ -472,47 +482,38 @@ With argument, do this that many times."
:custom :custom
(magit-bury-buffer-function 'my/magit-kill-buffers))) (magit-bury-buffer-function 'my/magit-kill-buffers)))
;; Draw line in column 80 ;; ;; Draw line in column 80
(use-package fill-column-indicator ;; (use-package fill-column-indicator
:after company ;; :after company
:init ;; :config
(defun my/set-fill-column-80 () ;; ;; Fix bug with fci + popup menus.
"Set fill-column to 80." ;; (defun my/fci-mode-enabled-p ()
(set-fill-column 80)) ;; (symbol-value 'fci-mode))
:config ;; (defvar-local my/fci-enabled nil)
;; Fix bug with fci + popup menus. ;; ;; company:
(defun my/fci-mode-enabled-p () ;; (defun my/on-off-fci-before-company(command)
(symbol-value 'fci-mode)) ;; "Turn fci-mode off while displaying popups in company."
(defvar-local my/fci-enabled nil) ;; (when (string= "show" command)
;; company: ;; (setq-local my/fci-enabled (my/fci-mode-enabled-p))
(defun my/on-off-fci-before-company(command) ;; (if my/fci-enabled
"Turn fci-mode off while displaying popups in company." ;; (turn-off-fci-mode)))
(when (string= "show" command) ;; (when (string= "hide" command)
(setq-local my/fci-enabled (my/fci-mode-enabled-p)) ;; (if my/fci-enabled
(if my/fci-enabled ;; (turn-on-fci-mode))))
(turn-off-fci-mode))) ;; (advice-add 'company-call-frontends :before #'my/on-off-fci-before-company)
(when (string= "hide" command) ;; ;; popup:
(if my/fci-enabled ;; (defadvice popup-create (before my/popup-suppress-fci-mode activate)
(turn-on-fci-mode)))) ;; "Suspend fci-mode while popups are visible."
(advice-add 'company-call-frontends :before #'my/on-off-fci-before-company) ;; (setq-local my/fci-enabled (my/fci-mode-enabled-p))
;; popup: ;; (if my/fci-enabled
(defadvice popup-create (before my/popup-suppress-fci-mode activate) ;; (turn-off-fci-mode)))
"Suspend fci-mode while popups are visible." ;; (defadvice popup-delete (after my/popup-restore-fci-mode activate)
(setq-local my/fci-enabled (my/fci-mode-enabled-p)) ;; "Restore fci-mode when all popups have closed."
(if my/fci-enabled ;; (if my/fci-enabled
(turn-off-fci-mode))) ;; (turn-on-fci-mode)))
(defadvice popup-delete (after my/popup-restore-fci-mode activate) ;; :hook
"Restore fci-mode when all popups have closed." ;; (prog-mode . fci-mode)
(if my/fci-enabled ;; (conf-mode . fci-mode))
(turn-on-fci-mode)))
:hook
(prog-mode . my/set-fill-column-80)
(conf-mode . my/set-fill-column-80)
(prog-mode . fci-mode)
(conf-mode . fci-mode)
(text-mode . auto-fill-mode)) ; Enable word-wrapping at fill-column.
;; Interactive substring matching. ;; Interactive substring matching.
(use-package ido (use-package ido
@ -547,13 +548,14 @@ With argument, do this that many times."
:after (projectile mode-icons) ; version from >=2016-08-02 is needed. :after (projectile mode-icons) ; version from >=2016-08-02 is needed.
:init :init
(setq tabbar-ruler-global-tabbar t) (setq tabbar-ruler-global-tabbar t)
(setq tabbar-ruler-global-ruler t)
:config :config
;; (tabbar-ruler-group-by-projectile-project) ; Group by projectile. ;; (tabbar-ruler-group-by-projectile-project) ; Group by projectile.
;; (tabbar-ruler-group-buffer-groups) ; Group by file type. ;; (tabbar-ruler-group-buffer-groups) ; Group by file type.
(tabbar-ruler-group-user-buffers) ; Group by frame. (tabbar-ruler-group-user-buffers) ; Group by frame.
(mode-icons-mode 0) ; Disable modeline symbols. (mode-icons-mode 0) ; Disable modeline symbols.
;; I have to define these 2 times, don't know why. ;; I have to set these 2 times, don't know why.
(set-face-attribute 'tabbar-selected nil (set-face-attribute 'tabbar-selected nil
:background "gray11" :background "gray11"
:foreground "light gray" :foreground "light gray"
@ -569,6 +571,17 @@ With argument, do this that many times."
:foreground "brown2" :foreground "brown2"
:italic t :italic t
:bold nil) :bold nil)
;; Setting this in :custom-face doesn't work.
(set-face-attribute 'ruler-mode-default nil
:inherit 'default
:background "gray18"
:foreground "dim gray"
:box '(:line-width 1
:color "black"
:style released-button))
(set-face-attribute 'ruler-mode-column-number nil
:inherit 'ruler-mode-default
:foreground "dark gray")
(add-hook 'projectile-after-switch-project-hook ; Does not work under :hook. (add-hook 'projectile-after-switch-project-hook ; Does not work under :hook.
'tabbar-ruler-group-by-projectile-project) 'tabbar-ruler-group-by-projectile-project)
@ -576,7 +589,7 @@ With argument, do this that many times."
("C-<prior>" . 'tabbar-ruler-tabbar-backward-tab) ("C-<prior>" . 'tabbar-ruler-tabbar-backward-tab)
("C-<next>" . 'tabbar-ruler-tabbar-forward-tab) ("C-<next>" . 'tabbar-ruler-tabbar-forward-tab)
:custom-face :custom-face
;; I Have to define these 2 times, don't know why. ;; I Have to set these 2 times, don't know why.
(tabbar-selected (nil (tabbar-selected (nil
:background "gray11" :background "gray11"
:foreground "light gray" :foreground "light gray"
@ -590,8 +603,7 @@ With argument, do this that many times."
(tabbar-modified (nil (tabbar-modified (nil
:foreground "brown2" :foreground "brown2"
:italic t :italic t
:bold nil)) :bold nil))))
))
;; Visualize whitespace. ;; Visualize whitespace.
(use-package whitespace (use-package whitespace

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 22453 127.0.0.1:51313 678
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh