Skip to content

aaronjensen/night-owl-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Night Owl for Emacs

MELPA MELPA Stable

Based entirely on Sarah Drasner's amazing Night Owl VSCode Theme. Built by modifying Kelvin Smith's monokai-emacs. Many thanks to both Sarah Drasner and Kelvin Smith.

Screenshot of Night Owl Theme for Emacs

Installation

If you're all set up to use MELPA, simply

M-x package-install RET night-owl-theme RET

Otherwise, ensure sure a directory containing these files is on your load-path.

Use M-x customize-themes to activate it, or put the following in your Emacs configuration file:

(load-theme 'night-owl t)

Status

Initial development, but covers most of my use cases. PRs gladly accepted.

Tips

Ivy

To style the non-selected ivy items, try this:

(defun night-owl/ivy-format-function-line (cands)
  "Transform CANDS into a string for minibuffer."
  (let ((str (ivy-format-function-line cands)))
    (font-lock-append-text-property 0 (length str) 'face 'ivy-not-current str)
    str))

(setq ivy-format-function #'night-owl/ivy-format-function-line)

Spacemacs/evil

To style spacemacs cursors, try this:

(setq night-owl-evil-cursors
      '(("normal" night-owl-orange box)
        ("insert" night-owl-cursor (bar . 2))
        ("emacs" night-owl-cursor (bar . 2))
        ("hybrid" night-owl-cursor (bar . 2))
        ("replace" night-owl-gray (hbar . 2))
        ("evilified" night-owl-yellow box)
        ("visual" night-owl-gray (hbar . 2))
        ("motion" night-owl-violet box)
        ("lisp" night-owl-red box)
        ("iedit" night-owl-magenta box)
        ("iedit-insert" night-owl-magenta (bar . 2))))

(defun night-owl-set-evil-cursor (state color shape)
  (set (intern (format "evil-%s-state-cursor" state))
       (list color shape)))

(defun night-owl-update-evil-cursors ()
  (let ((current-theme (symbol-name (car custom-enabled-themes))))
    (if (string-prefix-p "night-owl" current-theme)
        (cl-loop for (state color style) in night-owl-evil-cursors
                 do
                 (night-owl-set-evil-cursor state (symbol-value color) style))
      ;; not night-owl theme, restore default spacemacs cursors
      (if (functionp 'spacemacs/add-evil-cursor)
          (cl-loop for (state color shape) in spacemacs-evil-cursors
                   do (spacemacs/add-evil-cursor state color shape))))))

(add-hook 'after-init-hook #'night-owl-update-evil-cursors)
;; For spacemacs (comment this out if not using spacemacs):
(add-hook 'spacemacs-post-theme-change-hook #'night-owl-update-evil-cursors)

;; For Evil (uncomment this if not using spacemacs):
;; (defvar after-load-theme-hook nil
;;   "Hook run after a color theme is loaded using `load-theme'.")
;; 
;; (defadvice load-theme (after run-after-load-theme-hook activate)
;;   "Run `after-load-theme-hook'."
;;   (message (format "Loading theme %s" (ad-get-arg 0)))
;;   (run-hooks 'after-load-theme-hook))
;; 
;; (add-hook 'after-load-theme-hook #'night-owl-update-evil-cursors)