diff options
author | blendoit <blendoit@gmail.com> | 2019-09-04 01:45:45 -0700 |
---|---|---|
committer | blendoit <blendoit@gmail.com> | 2019-09-04 01:45:45 -0700 |
commit | 2a9f285b2457bad1b6d35846829cfc5d4fef6f64 (patch) | |
tree | 6d2a57ac61a8410f027842c42fc2a8206564988c | |
parent | b244e936942ae572d8a154a75336c9efec2ddb87 (diff) |
Mode line changes color upon entering normal mode
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | README.org | 17 | ||||
-rw-r--r-- | blendoit-ucla-theme.el | 7 | ||||
-rw-r--r-- | init.el | 4 | ||||
-rw-r--r-- | init_blendoit.el | 21 | ||||
-rw-r--r-- | init_emacs.el | 24 | ||||
-rw-r--r-- | init_evil-leader-keys.el | 22 | ||||
-rw-r--r-- | init_latex.el | 17 | ||||
-rw-r--r-- | init_org-mode.el | 27 |
9 files changed, 94 insertions, 49 deletions
@@ -1,6 +1,10 @@ # .gitignore .#* '#* +*.html +*.tex +*.pdf elpa/** auto-save-list/** transient/** +ido.last @@ -1,18 +1,13 @@ -#+TITLE: Marius Peter's GNU Emacs configuration files +#+TITLE: GNU Emacs Configuration #+AUTHOR: Marius Peter * Installation - + ** Linux - 1. Backup your current =~/.emacs.d=: - #+BEGIN_SRC bash - mv ~/.emacs.d ~/.emacs.d.bkp - #+END_SRC + 1. Backup your current =~/.emacs.d= with the following command: + =mv ~/.emacs.d ~/.emacs.d.bkp= 2. Clone my configuration folder to your home directory: - #+BEGIN_SRC bash - cd ~ - git clone https://github.com/Blendoit/.emacs.d.git - #+END_SRC + =cd ~= followed by =git clone https://github.com/Blendoit/.emacs.d.git= * Main Files @@ -23,7 +18,7 @@ - You may delete its content initially. - By default, all customization options available in Emacs' GUI that can be saved with =Options - Save Options= are saved here. - Useful to fool around with GUI customization options, without breaking our manually written code. - + ** =init_blendoit.el= - Load my personal configuration files. diff --git a/blendoit-ucla-theme.el b/blendoit-ucla-theme.el index b7fc88d..c618d1e 100644 --- a/blendoit-ucla-theme.el +++ b/blendoit-ucla-theme.el @@ -1,5 +1,5 @@ (deftheme blendoit-ucla - "Derived from UCLA's official brand colors: http://brand.ucla.edu/identity/colors") + "Created 2019-09-03.") (custom-theme-set-faces 'blendoit-ucla @@ -11,10 +11,10 @@ '(minibuffer-prompt ((t (:foreground "#FFD100")))) '(highlight ((t (:background "#FFD100" :foreground "#003B5C")))) '(region ((t (:background "#C3D7EE" :distant-foreground "#003B5C")))) - '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow")))) + '(shadow ((t (:foreground "grey70")))) '(secondary-selection ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:background "yellow")) (((class color) (min-colors 16) (background dark)) (:background "SkyBlue4")) (((class color) (min-colors 8)) (:foreground "black" :background "cyan")) (t (:inverse-video t)))) '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t)))) - '(font-lock-builtin-face ((((class grayscale) (background light)) (:weight bold :foreground "LightGray")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "dark slate blue")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 8)) (:weight bold :foreground "blue")) (t (:weight bold)))) + '(font-lock-builtin-face ((t (:foreground "LightSteelBlue")))) '(font-lock-comment-delimiter-face ((default (:inherit (font-lock-comment-face))))) '(font-lock-comment-face ((t (:foreground "#FFD100")))) '(font-lock-constant-face ((((class grayscale) (background light)) (:underline (:color foreground-color :style line) :weight bold :foreground "LightGray")) (((class grayscale) (background dark)) (:underline (:color foreground-color :style line) :weight bold :foreground "Gray50")) (((class color) (min-colors 88) (background light)) (:foreground "dark cyan")) (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine")) (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue")) (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine")) (((class color) (min-colors 8)) (:foreground "magenta")) (t (:underline (:color foreground-color :style line) :weight bold)))) @@ -29,7 +29,6 @@ '(font-lock-type-face ((((class grayscale) (background light)) (:weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 16) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 8)) (:foreground "green")) (t (:underline (:color foreground-color :style line) :weight bold)))) '(font-lock-variable-name-face ((((class grayscale) (background light)) (:slant italic :weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:slant italic :weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "sienna")) (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod")) (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 8)) (:weight light :foreground "yellow")) (t (:slant italic :weight bold)))) '(font-lock-warning-face ((t (:inherit (error))))) - '(button ((t (:background "white" :foreground "#003B5C")))) '(link ((((class color) (min-colors 88) (background light)) (:underline (:color foreground-color :style line) :foreground "RoyalBlue3")) (((class color) (background light)) (:underline (:color foreground-color :style line) :foreground "blue")) (((class color) (min-colors 88) (background dark)) (:underline (:color foreground-color :style line) :foreground "cyan1")) (((class color) (background dark)) (:underline (:color foreground-color :style line) :foreground "cyan")) (t (:inherit (underline))))) '(link-visited ((default (:inherit (link))) (((class color) (background light)) (:foreground "magenta4")) (((class color) (background dark)) (:foreground "violet")))) '(fringe ((t (:background "#8BB8E8")))) @@ -1,7 +1,9 @@ (require 'package) (package-initialize) -;; Load settings automatically created by GNU Emacs customize commands +;; Load settings created automatically by GNU Emacs Custom. +;; (For example, any clickable option/toggle is saved here.) +;; Useful for fooling around with A-x customize-group <package>. (setq custom-file "~/.emacs.d/init_emacs.el") (load custom-file) diff --git a/init_blendoit.el b/init_blendoit.el index cd47284..7ea38a9 100644 --- a/init_blendoit.el +++ b/init_blendoit.el @@ -1,12 +1,29 @@ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) -;; Who are we kidding. (require 'evil-leader) ;; All hail our evil leader! (global-evil-leader-mode) ;; The evil leader has gone global... (load "~/.emacs.d/init_evil-leader-keys.el") ;; My custom evil-leader key bindings. (require 'evil) ;; Let's follow in our leader's footsteps and become evil ourselves. (evil-mode 1) +;; TODO +;; Change color of mode line upon entering and leaving evil-mode. +;;(setq original-background (face-attribute 'mode-line :background)) +;;(setq normal-state-background "#FF4F00") +;;(if evil-mode +;; (set-face-attribute 'mode-line nil :background normal-state-background) +;; '(set-face-attribute 'mode-line nil :background original-background) +;; ) + +(setq original-background (face-attribute 'mode-line :background)) +(setq normal-state-background "#FF4F00") +(add-hook 'evil-normal-state-entry-hook + (lambda () + (set-face-attribute 'mode-line nil :background normal-state-background))) +(add-hook 'evil-normal-state-exit-hook + (lambda () + (set-face-attribute 'mode-line nil :background original-background))) + ;; Interactively Do Things - add powerful features to common Emacs commands. (setq ido-enable-flex-matching t) (setq ido-everywhere t) @@ -22,7 +39,7 @@ (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) -;; GNU Emacs GUI transparency +;; Emacs GUI transparency ;;(set-frame-parameter (selected-frame) 'alpha '(<active> . <inactive>)) ;;(set-frame-parameter (selected-frame) 'alpha <both>) (set-frame-parameter (selected-frame) 'alpha '(85 . 50)) diff --git a/init_emacs.el b/init_emacs.el index 5644e5c..901dabd 100644 --- a/init_emacs.el +++ b/init_emacs.el @@ -3,21 +3,37 @@ ;; 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-enabled-themes (quote (blendoit-ucla))) '(custom-safe-themes (quote - ("37d9d29b4be64ce7f3bcee989b5b4e410520c44ed61db200dc80518abdf2de5d" "f3c5904d7b27f967f9bc93ef21757e84752b52a3d091a535e32bca4324c95419" default))) + ("c0b9ce02572ae56f7e41b8cc05d878af55c804f42a962274e929b196d010998e" "37d9d29b4be64ce7f3bcee989b5b4e410520c44ed61db200dc80518abdf2de5d" "f3c5904d7b27f967f9bc93ef21757e84752b52a3d091a535e32bca4324c95419" default))) '(display-line-numbers-type (quote visual)) + '(evil-want-C-w-delete nil) + '(evil-want-C-w-in-emacs-state t) '(global-display-line-numbers-mode t) '(package-selected-packages (quote - (pdf-tools org-bullets magit latex-preview-pane evil-leader))) + (writeroom-mode pdf-tools org-bullets magit latex-preview-pane evil-leader))) '(scroll-bar-mode nil) '(show-paren-mode t) - '(tool-bar-mode nil)) + '(tool-bar-mode nil) + '(writeroom-global-effects + (quote + (writeroom-set-fullscreen writeroom-set-menu-bar-lines writeroom-set-tool-bar-lines writeroom-set-vertical-scroll-bars writeroom-set-bottom-divider-width writeroom-set-internal-border-width))) + '(writeroom-restore-window-config t)) (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 (:family "Hack" :foundry "SRC" :slant normal :weight normal :height 174 :width normal))))) + '(default ((t (:family "Hack" :foundry "SRC" :slant normal :weight normal :height 174 :width normal)))) + '(org-document-title ((t (:inherit default :weight bold :foreground "white" :family "Verdana" :height 2.0 :underline nil)))) + '(org-level-1 ((t (:inherit default :weight bold :foreground "white" :family "Verdana" :height 1.75)))) + '(org-level-2 ((t (:inherit default :weight bold :foreground "white" :family "Verdana" :height 1.5)))) + '(org-level-3 ((t (:inherit default :weight bold :foreground "white" :family "Verdana" :height 1.25)))) + '(org-level-4 ((t (:inherit default :weight bold :foreground "white" :family "Verdana" :height 1.1)))) + '(org-level-5 ((t (:inherit default :weight bold :foreground "white" :family "Verdana")))) + '(org-level-6 ((t (:inherit default :weight bold :foreground "white" :family "Verdana")))) + '(org-level-7 ((t (:inherit default :weight bold :foreground "white" :family "Verdana")))) + '(org-level-8 ((t (:inherit default :weight bold :foreground "white" :family "Verdana"))))) diff --git a/init_evil-leader-keys.el b/init_evil-leader-keys.el index 22d0bb4..0f31bda 100644 --- a/init_evil-leader-keys.el +++ b/init_evil-leader-keys.el @@ -1,14 +1,16 @@ ;; All hail our evil leader! -(evil-leader/set-leader ";") +;; prefix to the following commands in evil-mode +(evil-leader/set-leader ";") (evil-leader/set-key - "e" 'ido-find-file - "w" 'save-buffer - "r" 'eval-buffer - "b" 'ido-switch-buffer - "q" 'save-buffers-kill-terminal - "k" 'kill-buffer-and-window - "x" 'shell - "g" 'magit-status - "d" 'ido-dired) + "e" 'ido-find-file ;; edit a file (TAB steals a buffer for autocompletion) + "f" 'writeroom-mode ;; focus the current buffer + "w" 'save-buffer ;; write + "r" 'eval-buffer ;; reload + "b" 'ido-switch-buffer ;; buffer switch (RET switches to last buffer) + "q" 'save-buffers-kill-terminal ;; quit + "k" 'kill-buffer-and-window ;; kill + "x" 'shell ;; execute + "g" 'magit-status ;; git + "d" 'ido-dired) ;; directory (RET opens current directory) diff --git a/init_latex.el b/init_latex.el deleted file mode 100644 index 7500166..0000000 --- a/init_latex.el +++ /dev/null @@ -1,17 +0,0 @@ -;; Function obtained from https://wiki.archlinux.org/index.php/Emacs#SyncTeX_support - -(defcustom tex-my-viewer "zathura --fork -s -x \"emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"'\"'\"%{input}\"'\"'\")) (goto-line %{line}))'\"" - "PDF Viewer for TeX documents. You may want to fork the viewer -so that it detects when the same document is launched twice, and -persists when Emacs gets closed. - -Simple command: - - zathura --fork - -We can use - - emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"%{input}\")) (goto-line %{line}))' - -to reverse-search a pdf using SyncTeX. Note that the quotes and double-quotes matter and must be escaped appropriately." -:safe 'stringp) diff --git a/init_org-mode.el b/init_org-mode.el index 62830ed..5176abc 100644 --- a/init_org-mode.el +++ b/init_org-mode.el @@ -1,2 +1,29 @@ +;; Org-mode bullets use UTF-8 bullets (require 'org-bullets) (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) + +;; Long lines will flow and adjust to window. +(add-hook 'org-mode-hook 'visual-line-mode) +;; Hide characters that make text bold/italic/underlined +(setq org-hide-emphasis-markers t) + +;; org-mode fonts +(let* ((variable-tuple + (cond ;;((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro")) + ;;((x-list-fonts "Lucida Grande") '(:font "Lucida Grande")) + ((x-list-fonts "Verdana") '(:font "Verdana")) + (nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro.")))) + (base-font-color (face-foreground 'default nil 'default)) + (headline `(:inherit default :weight bold :foreground ,base-font-color))) + + (custom-theme-set-faces + 'user + `(org-level-8 ((t (,@headline ,@variable-tuple)))) + `(org-level-7 ((t (,@headline ,@variable-tuple)))) + `(org-level-6 ((t (,@headline ,@variable-tuple)))) + `(org-level-5 ((t (,@headline ,@variable-tuple)))) + `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1)))) + `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25)))) + `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5)))) + `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75)))) + `(org-document-title ((t (,@headline ,@variable-tuple :height 2.0 :underline nil)))))) |