From 3ed8d4f429da2d835d936b04026e53c753c80ff6 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 24 Apr 2019 22:03:52 +0200 Subject: [PATCH] Ruler instead of fci-mode. --- init.el | 104 ++++++++++++++++++++++++++++---------------------- server/server | 2 +- 2 files changed, 59 insertions(+), 47 deletions(-) diff --git a/init.el b/init.el index aa6cbfb..03cab38 100644 --- a/init.el +++ b/init.el @@ -1,5 +1,5 @@ ;;; 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: ;; 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. (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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (use-package bind-key :init @@ -472,47 +482,38 @@ With argument, do this that many times." :custom (magit-bury-buffer-function 'my/magit-kill-buffers))) -;; Draw line in column 80 -(use-package fill-column-indicator - :after company - :init - (defun my/set-fill-column-80 () - "Set fill-column to 80." - (set-fill-column 80)) - :config - ;; Fix bug with fci + popup menus. - (defun my/fci-mode-enabled-p () - (symbol-value 'fci-mode)) - (defvar-local my/fci-enabled nil) - ;; company: - (defun my/on-off-fci-before-company(command) - "Turn fci-mode off while displaying popups in company." - (when (string= "show" command) - (setq-local my/fci-enabled (my/fci-mode-enabled-p)) - (if my/fci-enabled - (turn-off-fci-mode))) - (when (string= "hide" command) - (if my/fci-enabled - (turn-on-fci-mode)))) - (advice-add 'company-call-frontends :before #'my/on-off-fci-before-company) - ;; popup: - (defadvice popup-create (before my/popup-suppress-fci-mode activate) - "Suspend fci-mode while popups are visible." - (setq-local my/fci-enabled (my/fci-mode-enabled-p)) - (if my/fci-enabled - (turn-off-fci-mode))) - (defadvice popup-delete (after my/popup-restore-fci-mode activate) - "Restore fci-mode when all popups have closed." - (if my/fci-enabled - (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. +;; ;; Draw line in column 80 +;; (use-package fill-column-indicator +;; :after company +;; :config +;; ;; Fix bug with fci + popup menus. +;; (defun my/fci-mode-enabled-p () +;; (symbol-value 'fci-mode)) +;; (defvar-local my/fci-enabled nil) +;; ;; company: +;; (defun my/on-off-fci-before-company(command) +;; "Turn fci-mode off while displaying popups in company." +;; (when (string= "show" command) +;; (setq-local my/fci-enabled (my/fci-mode-enabled-p)) +;; (if my/fci-enabled +;; (turn-off-fci-mode))) +;; (when (string= "hide" command) +;; (if my/fci-enabled +;; (turn-on-fci-mode)))) +;; (advice-add 'company-call-frontends :before #'my/on-off-fci-before-company) +;; ;; popup: +;; (defadvice popup-create (before my/popup-suppress-fci-mode activate) +;; "Suspend fci-mode while popups are visible." +;; (setq-local my/fci-enabled (my/fci-mode-enabled-p)) +;; (if my/fci-enabled +;; (turn-off-fci-mode))) +;; (defadvice popup-delete (after my/popup-restore-fci-mode activate) +;; "Restore fci-mode when all popups have closed." +;; (if my/fci-enabled +;; (turn-on-fci-mode))) +;; :hook +;; (prog-mode . fci-mode) +;; (conf-mode . fci-mode)) ;; Interactive substring matching. (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. :init (setq tabbar-ruler-global-tabbar t) + (setq tabbar-ruler-global-ruler t) :config ;; (tabbar-ruler-group-by-projectile-project) ; Group by projectile. ;; (tabbar-ruler-group-buffer-groups) ; Group by file type. (tabbar-ruler-group-user-buffers) ; Group by frame. (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 :background "gray11" :foreground "light gray" @@ -569,6 +571,17 @@ With argument, do this that many times." :foreground "brown2" :italic t :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. 'tabbar-ruler-group-by-projectile-project) @@ -576,7 +589,7 @@ With argument, do this that many times." ("C-" . 'tabbar-ruler-tabbar-backward-tab) ("C-" . 'tabbar-ruler-tabbar-forward-tab) :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 :background "gray11" :foreground "light gray" @@ -590,8 +603,7 @@ With argument, do this that many times." (tabbar-modified (nil :foreground "brown2" :italic t - :bold nil)) - )) + :bold nil)))) ;; Visualize whitespace. (use-package whitespace diff --git a/server/server b/server/server index b1d6252..5c4a3e4 100644 --- a/server/server +++ b/server/server @@ -1,2 +1,2 @@ -127.0.0.1:51313 22453 +127.0.0.1:51313 678 phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh \ No newline at end of file