Update ruby mode and change themes to white ones

This commit is contained in:
Maciej 2021-07-09 19:52:37 +03:00
parent 1d35210c86
commit e1b64159ab
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
4 changed files with 20 additions and 9 deletions

View file

@ -19,21 +19,22 @@
(set-indent 2)
;; Disable reek syntax checking permanently
(add-to-list (make-local-variable 'flycheck-disabled-checkers) 'ruby-reek)
(add-to-list (make-local-variable 'flycheck-disabled-checkers) 'ruby-reek 'ruby-rubocop)
;; Do not insert magic encoding comment at the begining of each file
(setq ruby-insert-encoding-magic-comment nil)
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-etags company-yasnippet))
'(company-capf company-yasnippet)))
;; Set specific ctags command
(setq-local ctags/refresh-command
(format "ctags -e -R --languages=ruby -f %sTAGS %s. $(bundle list --paths)"
(projectile-project-root) (projectile-project-root))))
(projectile-project-root) (projectile-project-root)))
(add-hook 'ruby-mode-hook 'enh-ruby-mode)
(add-hook 'enh-ruby-mode-hook 'lsp-deferred)
(add-hook 'enh-ruby-mode-hook 'rspec-mode)
(add-hook 'enh-ruby-mode-hook 'ruby-end-mode)
(eval-after-load 'rspec-mode

View file

@ -14,7 +14,7 @@
;;;;;;;;;;;;;;;;;;;;;; Font configuration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun set-font (name size)
"Set font to NAME and its SIZE to X pixels."
(interactive "sNew font: \nnEnter size for font %s: ")
(interactive "sNew font: \nnEnter size for %s: ")
(set-face-attribute 'default nil :font (format "%s %d" name size))
;; Set modeline font to be 1 pixel point smaller than the general font
(set-face-attribute 'mode-line nil :font (format "%s %d" name (- size 1)))
@ -27,16 +27,20 @@
(defun set-font-to-screen ()
"Automatically set font size to suit the monitor."
(interactive)
;; If display is set to emulate FullHD resultion or less, make the font
;; smaller.
(cond ((eq (x-display-list) nil)) ()
(cond ((eq (x-display-list) nil))
;; built-in screen
((>= 1050 (x-display-pixel-height)) (set-font +custom-font 14))
;; 4K screen
;; 4K screen on a Mac
((>= 1080 (x-display-pixel-height)) (set-font +custom-font 14))
;; Other screens
((>= 1120 (x-display-pixel-height)) (set-font +custom-font 14))
((>= 1440 (x-display-pixel-height)) (set-font +custom-font 16))
;; 4K screen on Windows
((>= 2160 (x-display-pixel-height)) (set-font +custom-font 20))
(t (set-font +custom-font 16))))
@ -44,6 +48,11 @@
;; Do it automatically on startup
(set-font-to-screen)
(defun set-font-size (size)
"Set font to a specified SIZE."
(interactive "nEnter size for font: ")
(set-font +custom-font size))
;; Remove ugly black line
(set-face-attribute 'vertical-border nil :foreground
(face-attribute 'fringe :background))

View file

@ -142,6 +142,7 @@ Other: _m_: iMenu
("d" (text-scale-decrease 1) "Smaller font in this buffer")
("r" (text-scale-adjust 0) "Reset font in this buffer")
("R" set-font-to-screen "Reload font to screen")
("s" set-font-size "Set font size")
("q" nil "cancel" :color blue))
:bind ("C-c p" . +hydra-file-switcher-menu/body)

View file

@ -22,7 +22,7 @@
(load-theme 'base16-atelier-forest-light t t)
(load-theme 'base16-harmonic-light t t)
(load-theme 'apropospriate-light t t)
(load-theme 'base16-tomorrow t t)
(load-theme 'base16-humanoid-light t t)
;; Dark themes
(load-theme 'base16-solarflare t t)
@ -34,7 +34,7 @@
(sml/apply-theme 'respectful)
(enable-theme (nth
(random 2)
'(base16-solarflare base16-snazzy))))
'(base16-humanoid-light base16-harmonic-light))))
(progn
(defvar base16-theme-256-color-source "base16-shell")
(enable-theme 'apropospriate-light)))