Yet another massive update

This commit is contained in:
Henrik Lissner 2015-05-28 22:24:43 -04:00
parent ee6ac2095e
commit d32b9f0dd0
28 changed files with 1124 additions and 601 deletions

View file

@ -1,50 +1,105 @@
;;; core-ui.el -- User interface layout & behavior
;;;; Load Theme ;;;;;;;;;;;;;;;;;;;;;;;;
(when window-system
(set-frame-parameter nil 'alpha '(96 86))
(cycle-font 0)) ; Load font
(when window-system
(set-frame-font *default-font)
(set-frame-parameter nil 'alpha '(100 75)))
(add-to-list 'custom-theme-load-path my-themes-dir)
(load-dark-theme)
(load-theme *default-theme t)
;;;; GUI Settings ;;;;;;;;;;;;;;;;;;;;;;
(when window-system
(scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar
(menu-bar-mode -1)) ; no menubar
(scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar
(menu-bar-mode -1) ; no menubar
(fringe-mode '(2 . 8))) ; no nonsense
(tooltip-mode -1)
(blink-cursor-mode 1) ; blink cursor
(global-hl-line-mode -1) ; highlight line
;; Highlight curent line number
(use-package hlinum
:config
(progn
(hlinum-activate)
;; A little excessive
(remove-hook 'pre-command-hook 'hlinum-unhighlight-current-line)))
;; Line numbers
(setq linum-format " %4d ")
(add-hooks '(text-mode-hook prog-mode-hook) 'linum-mode)
(global-hl-line-mode 1) ; do highlight line
(blink-cursor-mode 1) ; do blink cursor
(line-number-mode 1) ; do show line no in modeline
(column-number-mode 1) ; do show col no in modeline
(tooltip-mode -1) ; don't show tooltips
;; Multiple cursors across buffers cause a strange redraw delay for
;; some things, like auto-complete or evil-mode's cursor color
;; switching.
(setq-default cursor-in-non-selected-windows nil)
(setq-default cursor-in-non-selected-windows nil
visible-bell nil ; silence of the bells
use-dialog-box nil ; avoid GUI
redisplay-dont-pause t
;; do not soft-wrap lines
truncate-lines t
truncate-partial-width-windows nil
indicate-buffer-boundaries nil
indicate-empty-lines nil
fringes-outside-margins t)
(setq-default visible-bell nil) ; silence of the bells
(setq-default use-dialog-box nil) ; avoid GUI
(setq-default redisplay-dont-pause t)
(use-package nlinum
:commands nlinum-mode
:init
(progn
(defface linum-highlight-face '((t (:inherit linum)))
"Face for line highlights")
;; do not soft-wrap lines
(setq-default truncate-lines t)
(setq-default truncate-partial-width-windows nil)
(setq-default indicate-buffer-boundaries nil)
(setq-default indicate-empty-lines nil)
;; Preset width nlinum
(add-hook! 'nlinum-mode-hook
(setq nlinum--width
(length (number-to-string
(count-lines (point-min) (point-max))))))
;; Highlight line number
(setq hl-nlinum-overlay nil)
(setq hl-nlinum-line nil)
(defun hl-nlinum-unhighlight-line ()
(when hl-nlinum-overlay
(let* ((ov hl-nlinum-overlay)
(disp (get-text-property 0 'display (overlay-get ov 'before-string)))
(str (nth 1 disp)))
(put-text-property 0 (length str) 'face 'linum str)
(setq hl-nlinum-overlay nil)
(setq hl-nlinum-line nil))))
(defun hl-nlinum-highlight-line ()
(let ((line-no (line-number-at-pos (point))))
(when (and nlinum-mode (not (eq line-no hl-nlinum-line)))
(let* ((pbol (point-at-bol))
(peol (1+ pbol)))
;; Handle EOF case
(when (>= peol (point-max))
(setq pbol (line-beginning-position 0))
(setq peol (line-end-position 0)))
(jit-lock-fontify-now pbol peol)
(let* ((overlays (overlays-in pbol peol))
(ov (-first (lambda (item) (overlay-get item 'nlinum)) overlays)))
(when ov
(hl-nlinum-unhighlight-line)
(let* ((disp (get-text-property 0 'display (overlay-get ov 'before-string)))
(str (nth 1 disp)))
(put-text-property 0 (length str) 'face 'linum-highlight-face str)
(put-text-property 0 (length str) 'face 'linum-highlight-face str)
(setq hl-nlinum-overlay ov)
(setq hl-nlinum-line line-no))))))))
(defun nlinum-toggle ()
(interactive)
(if nlinum-mode
(nlinum-disable)
(nlinum-enable)))
(defun nlinum-enable ()
(nlinum-mode +1)
(add-hook 'post-command-hook 'hl-nlinum-highlight-line))
(defun nlinum-disable ()
(nlinum-mode -1)
(remove-hook 'post-command-hook 'hl-nlinum-highlight-line)
(hl-nlinum-unhighlight-line))
(add-hooks '(text-mode-hook prog-mode-hook) 'nlinum-enable)
(add-hook 'org-mode-hook 'nlinum-disable))
:config
(setq-default nlinum-format " %4d "))
(when window-system
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
@ -58,11 +113,11 @@
;; [pedantry intensifies]
(rename-mode-name emacs-lisp-mode "Elisp")
(use-package vim-empty-lines-mode
:config (global-vim-empty-lines-mode +1))
;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (use-package vim-empty-lines-mode
;; :config (global-vim-empty-lines-mode +1))
(use-package uniquify
:config
(setq uniquify-buffer-name-style 'post-forward-angle-brackets
@ -70,28 +125,6 @@
uniquify-ignore-buffers-re "^\\*"))
(use-package smart-mode-line
:init
(defvar rm-blacklist
(mapconcat 'identity
'(" SP"
" Fill"
" EvilOrg"
" Abbrev"
" snipe"
" company"
" Anaconda"
" WS"
" GitGutter"
" Undo-Tree"
" Projectile\\[.+\\]"
" hs"
" ElDoc"
" wg"
" ~"
" s-/"
" emr"
" Refactor"
) "\\|"))
:config
(progn
(setq sml/no-confirm-load-theme t
@ -99,11 +132,12 @@
sml/extra-filler (if window-system -1 0)
sml/show-remote nil
sml/modified-char "*"
sml/encoding-format nil)
(setq sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:")
("^~/.emacs.d/" "EMACS.D:")))
sml/encoding-format nil
sml/replacer-regexp-list '(("^~/Dropbox/Projects/" "PROJECTS:")
("^~/.emacs.d/" "EMACS.D:")
("^~/Dropbox/notes/" "NOTES:")))
;; Hide evil state indicator
(after "evil" (setq evil-mode-line-format nil))
(setq-default mode-line-misc-info
@ -111,23 +145,24 @@
(global-mode-string ("" global-mode-string ""))))
(add-hook! 'after-change-major-mode-hook
(setq mode-line-format
'((if window-system " ")
"%e"
mode-line-mule-info
mode-line-client
mode-line-remote
mode-line-frame-identification
mode-line-buffer-identification
mode-line-modified
mode-line-modes
mode-line-misc-info
(vc-mode vc-mode)
" "
mode-line-position
" "
mode-line-front-space
))
(unless (null mode-line-format)
(setq mode-line-format
'((if window-system " ")
"%e"
;; mode-line-mule-info
;; mode-line-client
;; mode-line-remote
;; mode-line-frame-identification
mode-line-buffer-identification
mode-line-modified
mode-line-modes
mode-line-misc-info
(vc-mode vc-mode)
" "
mode-line-position
" "
mode-line-front-space
)))
(add-to-list 'mode-line-modes
'(sml/buffer-identification-filling
@ -138,7 +173,6 @@
(let ((-linepo mode-line-position))
(sml/setup)
(sml/apply-theme 'respectful)
(setq mode-line-position -linepo)
(sml/filter-mode-line-list 'mode-line-position))))