better modeline/colors

This commit is contained in:
Iñaki Domínguez
2016-12-28 19:38:09 +01:00
parent a8e3664a3c
commit 39e805f587
6 changed files with 80 additions and 39 deletions

34
init.el
View File

@@ -1,4 +1,4 @@
;;(package-initialize) (package-initialize)
(defun byte-compile-init-dir () (defun byte-compile-init-dir ()
"Byte-compile all your dotfiles." "Byte-compile all your dotfiles."
@@ -19,19 +19,27 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(haskell-process-suggest-remove-import-lines t)
'(haskell-process-auto-import-loaded-modules t)
'(haskell-process-log t)
'(haskell-process-type 'cabal-repl)
'(package-selected-packages '(package-selected-packages
(quote (quote
(swiper colemak-evil evil all-the-icons use-package rich-minority projectile mode-icons magit-find-file haskell-mode gruvbox-theme fill-column-indicator evil-magit counsel)))) (swiper colemak-evil evil all-the-icons use-package rich-minority projectile mode-icons magit-find-file haskell-mode gruvbox-theme fill-column-indicator evil-magit counsel))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. '(mode-line ((t (:background " "))))
;; If you edit it by hand, you could mess it up, so be careful. '(linum ((t (:underline nil))))
;; Your init file should contain only one such instance. )
;; If there is more than one, they won't work right. ;; ;; custom-set-faces was added by Custom.
'(term-color-black ((t (:foreground "#525252")))) ;; ;; If you edit it by hand, you could mess it up, so be careful.
'(term-color-blue ((t (:foreground "#33ddff")))) ;; ;; Your init file should contain only one such instance.
'(term-color-cyan ((t (:foreground "#196f80")))) ;; ;; If there is more than one, they won't work right.
'(term-color-green ((t (:foreground "#bf4c26")))) ;; '(term-color-black ((t (:foreground "#525252"))))
'(term-color-magenta ((t (:foreground "#26a6bf")))) ;; '(term-color-blue ((t (:foreground "#33ddff"))))
'(term-color-red ((t (:foreground "#ff6633")))) ;; '(term-color-cyan ((t (:foreground "#196f80"))))
'(term-color-white ((t (:foreground "#bfbfbf")))) ;; '(term-color-green ((t (:foreground "#bf4c26"))))
'(term-color-yellow ((t (:foreground "#803319"))))) ;; '(term-color-magenta ((t (:foreground "#26a6bf"))))
;; '(term-color-red ((t (:foreground "#ff6633"))))
;; '(term-color-white ((t (:foreground "#bfbfbf"))))
;; '(term-color-yellow ((t (:foreground "#803319")))))

View File

@@ -22,7 +22,7 @@
(count-lines (count-lines
(point-min) (point-min)
(point-max)))))) (point-max))))))
(concat "%" (number-to-string w) "d ")))))) (concat " %" (number-to-string w) "d "))))))
(defun linum-format-func (line) (defun linum-format-func (line)

View File

@@ -1,4 +1,4 @@
(load "~/.emacs.d/my-packages.elc") (load "~/.emacs.d/my-packages.el")
(require 'use-package) (require 'use-package)
@@ -32,3 +32,5 @@
:init :init
(setq fci-rule-column 80)) (setq fci-rule-column 80))
(use-package all-the-icons) (use-package all-the-icons)
(use-package haskell-mode)
(use-package ghc)

View File

@@ -2,28 +2,35 @@
(require 'magit) (require 'magit)
(require 'all-the-icons) (require 'all-the-icons)
(defvar powerline-current-window nil) (defvar powerline-current-window nil)
(defun update-current-window (windows) (defun update-current-window (windows)
(when (not (minibuffer-window-active-p (frame-selected-window))) (when (not (minibuffer-window-active-p (frame-selected-window)))
(setq powerline-current-window (selected-window)))) (setq powerline-current-window (selected-window))))
(add-function :before pre-redisplay-function 'update-current-window) (add-function :before pre-redisplay-function 'update-current-window)
(defun evil-tag-color () (defun evil-tag-color ()
(if (eq (get-buffer-window) powerline-current-window) (if (eq (get-buffer-window) powerline-current-window)
(cond ((evil-normal-state-p) "#86261c") (cond ((evil-normal-state-p) "DodgerBlue4")
((evil-visual-state-p) "DarkSlateGray") ((evil-visual-state-p) "DarkSlateGray")
((evil-insert-state-p) "#ff2222") ((evil-insert-state-p) "maroon")
((evil-emacs-state-p) "SeaGreen") ((evil-emacs-state-p) "SeaGreen")
((evil-operator-state-p) "SeaGreen") ((evil-operator-state-p) "SeaGreen")
((evil-motion-state-p) "SeaGreen") ((evil-motion-state-p) "SeaGreen")
((evil-replace-state-p) "#ff2222")) ((evil-replace-state-p) "maroon"))
(face-background 'mode-line-inactive))) (face-background 'mode-line-inactive)))
(defun branch-tag-bg-color () (defun branch-tag-bg-color ()
(if (eq (get-buffer-window) powerline-current-window) (if (eq (get-buffer-window) powerline-current-window)
"#424242" "gainsboro"
(face-background 'mode-line-inactive))) (face-background 'mode-line-inactive)))
(defun branch-tag-fg-color ()
(if (eq (get-buffer-window) powerline-current-window)
"#181818"
(face-foreground 'mode-line-inactive)))
(defun time-tag-bg-color () (defun time-tag-bg-color ()
(if (eq (get-buffer-window) powerline-current-window) (if (eq (get-buffer-window) powerline-current-window)
"ivory" "ivory"
@@ -74,7 +81,9 @@ can be used to add a number of spaces to the front and back of the string."
(when (magit-get-current-branch) (when (magit-get-current-branch)
(propertize (propertize
(format "  %s " (magit-get-current-branch)) (format "  %s " (magit-get-current-branch))
'face `(:weight bold :background ,(branch-tag-bg-color))))))) 'face `(:weight bold
:foreground ,(branch-tag-fg-color)
:background ,(branch-tag-bg-color)))))))
(defun powerline-modified () (defun powerline-modified ()
(let* ((config-alist (let* ((config-alist
@@ -109,19 +118,19 @@ can be used to add a number of spaces to the front and back of the string."
(let* ((bg (time-tag-bg-color)) (let* ((bg (time-tag-bg-color))
(fg (time-tag-fg-color))) (fg (time-tag-fg-color)))
(concat (concat
;; (propertize
;; (all-the-icons-faicon "rebel")
;; 'face
;; `(:height 0.8 :background ,bg :foreground ,fg) 'display '(raise 0.2))
(propertize (propertize
(all-the-icons-faicon "rebel") (format " %%l/%d "
'face
`(:height 0.8 :background ,bg :foreground ,fg) 'display '(raise 0.2))
(propertize
(format " %%l/%d "
(count-lines (point-min) (point-max))) (count-lines (point-min) (point-max)))
'face `(:background ,bg :foreground ,fg))))) 'face `(:background ,bg :foreground ,fg)))))
(defun powerline-time () (defun powerline-time ()
(let* ((hour (string-to-number (format-time-string "%I"))) (let* ((hour (string-to-number (format-time-string "%I")))
(icon (all-the-icons-wicon ;; (icon (all-the-icons-wicon
(format "time-%s" hour) :height 1.0 :v-adjust 0.0)) ;; (format "time-%s" hour) :height 1.0 :v-adjust 0.0))
(bg (time-tag-bg-color)) (bg (time-tag-bg-color))
(fg (time-tag-fg-color))) (fg (time-tag-fg-color)))
(concat (concat
@@ -129,13 +138,13 @@ can be used to add a number of spaces to the front and back of the string."
(format-time-string " %H:%M ") (format-time-string " %H:%M ")
'face 'face
`(:height 1.0 :background ,bg :foreground ,fg)) `(:height 1.0 :background ,bg :foreground ,fg))
;; (propertize
;; (format "%s" icon)
;; 'face
;; `(:height 1.0 :family "Weather Icons" :background ,bg :foreground ,fg)
;; 'display '(raise -0.0))
(propertize (propertize
(format "%s" icon) "·"
'face
`(:height 1.0 :family "Weather Icons" :background ,bg :foreground ,fg)
'display '(raise -0.0))
(propertize
" · "
'face `(:height 1.0 :background ,bg :foreground ,fg))))) 'face `(:height 1.0 :background ,bg :foreground ,fg)))))
(defvar separator-left (defvar separator-left

View File

@@ -1,11 +1,20 @@
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) (when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'windmove-default-keybindings)
(windmove-default-keybindings))
(autoload 'ghc-init "ghc" nil t)
(autoload 'ghc-debug "ghc" nil t)
(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
(add-to-list 'exec-path "~/.cabal/bin")
(add-to-list (add-to-list
'default-frame-alist 'default-frame-alist
'(font . "-ypn-envypn-medium-r-normal--15-150-75-75-c-90-iso8859-1")) '(font . "Iosevka Term 10"))
(set-frame-font (set-frame-font
"-ypn-envypn-medium-r-normal--15-150-75-75-c-90-iso8859-1") "Iosevka Term 10")
(setq frame-title-format
'(buffer-file-name "%f"
(dired-directory dired-directory "%b")))
(fringe-mode '(0 . 0)) (fringe-mode '(0 . 0))
(setq inhibit-startup-screen t) (setq inhibit-startup-screen t)
(setq vc-follow-symlinks t) (setq vc-follow-symlinks t)
@@ -72,3 +81,16 @@
(process-send-string (process-send-string
(get-buffer-process (current-buffer)) (get-buffer-process (current-buffer))
(if string string (current-kill 0)))) (if string string (current-kill 0))))
(eval-after-load 'haskell-mode '(progn
(define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
(define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
(define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
(define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
(define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
(define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)))
(eval-after-load 'haskell-cabal '(progn
(define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
(define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
(define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))

View File

@@ -1,4 +1,4 @@
(defvar my:theme 'nothing-rhymes-with-orange) (defvar my:theme 'base16-default-dark)
(defvar my:theme-window-loaded nil) (defvar my:theme-window-loaded nil)
(defvar my:theme-terminal-loaded nil) (defvar my:theme-terminal-loaded nil)
(if (daemonp) (if (daemonp)
@@ -8,7 +8,7 @@
(select-frame frame) (select-frame frame)
(when (window-system frame) (when (window-system frame)
(set-frame-parameter (set-frame-parameter
(selected-frame) 'internal-border-width 5) (selected-frame) 'internal-border-width 0)
(unless my:theme-window-loaded (unless my:theme-window-loaded
(if my:theme-terminal-loaded (if my:theme-terminal-loaded
(enable-theme my:theme) (enable-theme my:theme)
@@ -24,7 +24,7 @@
(if (display-graphic-p) (if (display-graphic-p)
(setq my:theme-window-loaded t) (setq my:theme-window-loaded t)
(setq my:theme-terminal-loaded t))) (setq my:theme-terminal-loaded t)))
(set-frame-parameter (selected-frame) 'internal-border-width 5)) (set-frame-parameter (selected-frame) 'internal-border-width 0))
(custom-set-faces (custom-set-faces
;; term ;; term
@@ -48,4 +48,4 @@
(add-hook 'before-make-frame-hook (add-hook 'before-make-frame-hook
#'(lambda () #'(lambda ()
(add-to-list 'default-frame-alist '(height . 42)) (add-to-list 'default-frame-alist '(height . 42))
(add-to-list 'default-frame-alist '(width . 84)))) (add-to-list 'default-frame-alist '(width . 100))))