X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=5d8f12dbb18cfab771728fc406b97fa8a5e46c8a;hb=7633c9af30a55827c66c99998cf865af1b1610f3;hp=e3b330468dfd9e342c0753d094fdb1c0b106c289;hpb=4cd58f1393b142122c1f458667f627d23a576782;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index e3b3304..5d8f12d 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -406,22 +406,33 @@ Install powerline mode [[https://github.com/milkypostman/powerline][powerline]] #+END_SRC Revised powerline-center-theme - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (defun sd/powerline-simpler-vc (s) (if s (replace-regexp-in-string "Git[:-]" "" s) s)) - (defface sd/powerline-active1 '((t (:background "yellow" :foreground "red" :inherit mode-line))) + (defface sd/powerline-active1 '((t (:background "yellow" :foreground "black" :inherit mode-line))) + "My Powerline face 1 based on powerline-active1." + :group 'powerline) + + (defface sd/buffer-modified-active1 '((t (:background "red" :foreground "black" :inherit mode-line))) "My Powerline face 1 based on powerline-active1." :group 'powerline) (defface sd/mode-line-buffer-id '((t (:background "yellow" :foreground "black" :inherit mode-line-buffer-id))) - "Powerline mode-line face" + "My powerline mode-line face, based on mode-line-buffer-id" :group 'powerline) + ;; Don't show buffer modified for scratch and eshell mode + (defun sd/buffer-show-modified () + "Dot not show modified indicator for buffers" + (interactive) + (unless (or (string-match "*scratch*" (buffer-name)) + (equal major-mode 'eshell-mode)) + t)) + (defun sd/powerline-center-theme_revised () "Setup a mode-line with major and minor modes centered." (interactive) @@ -432,6 +443,9 @@ Revised powerline-center-theme (mode-line-buffer-id (if active 'sd/mode-line-buffer-id 'mode-line-buffer-id-inactive)) (mode-line (if active 'mode-line 'mode-line-inactive)) (my-face1 (if active 'sd/powerline-active1 'powerline-inactive1)) + (my-face-buffer-modified (if (and (sd/buffer-show-modified) (buffer-modified-p)) + 'sd/buffer-modified-active1 + my-face1)) (face1 (if active 'powerline-active1 'powerline-inactive1)) (face2 (if active 'powerline-active2 'powerline-inactive2)) (separator-left (intern (format "powerline-%s-%s" @@ -440,7 +454,7 @@ Revised powerline-center-theme (separator-right (intern (format "powerline-%s-%s" (powerline-current-separator) (cdr powerline-default-separator-dir)))) - (lhs (list (powerline-raw "%*" my-face1 'l) + (lhs (list (powerline-raw "%* " my-face-buffer-modified 'l) ;; (powerline-buffer-size mode-line 'l) (powerline-buffer-id mode-line-buffer-id 'l) (powerline-raw " " my-face1) @@ -453,9 +467,11 @@ Revised powerline-center-theme (powerline-raw ":" face1) (powerline-raw "%3c" face1 'r) (funcall separator-right face1 my-face1) - (powerline-raw " " my-face1) - (powerline-raw "%6p" my-face1 'r) - (powerline-hud my-face1 face1 ))) + ;; (powerline-raw " " my-face1) + (powerline-raw (format-time-string " %I:%M %p %m-%d %a ") my-face1 'r) + ;; (powerline-raw "%6p" my-face1 'r) + ;; (powerline-hud my-face1 face1 ) + )) (center (list (powerline-raw " " face1) (funcall separator-left face1 face2) (when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode) @@ -476,21 +492,17 @@ Revised powerline-center-theme #+END_SRC Fix the issue in mode line when showing triangle - #+BEGIN_SRC emacs-lisp :tangle yes :results silent (setq ns-use-srgb-colorspace nil) #+END_SRC set height in mode line - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (custom-set-variables '(powerline-height 14) - '(powerline-text-scale-factor 0.8)) - ;; 100/140 + '(powerline-text-scale-factor (/ (float 100) 140))) + ;; 100/140;0.8 (set-face-attribute 'mode-line nil :height 100) - #+END_SRC * IDO & SMEX @@ -609,10 +621,10 @@ Stolen from [[https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-spell ;; ;; Turn off RUN-TOGETHER option when spell check text-mode ;; (setq-local ispell-extra-args (flyspell-detect-ispell-args))) ;; (add-hook 'text-mode-hook 'text-mode-hook-setup) - (add-hook 'text-mode-hook 'flyspell-mode) + ;; (add-hook 'text-mode-hook 'flyspell-mode) ;; enable flyspell check on comments and strings in progmamming modes - (add-hook 'prog-mode-hook 'flyspell-prog-mode) + ;; (add-hook 'prog-mode-hook 'flyspell-prog-mode) ;; I don't use the default mappings (with-eval-after-load 'flyspell @@ -980,7 +992,8 @@ Always indents header, and hide header leading starts so that no need type =#+ST (sh . t) (sqlite . t) (js . t) - (gnuplot . t))) + (gnuplot . t) + (ditaa . t))) ;; use current window for org source buffer editting (setq org-src-window-setup 'current-window ) @@ -1794,11 +1807,6 @@ When see function by =C-h f=, and visit the source code, I would like the buffer ** TODO Man mode Color for Man-mode -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - ;; (add-hook 'Man-mode-hook (lambda () - ;; (interactive) - ;; (setenv "GROFF_NO_SRG"))) -#+END_SRC ** TODO swiper to occur @@ -1937,13 +1945,18 @@ Refer [[https://www.emacswiki.org/emacs/AutoInsertMode][AutoInsertMode]] Wiki ))) #+END_SRC -*** Keywords +*** Perl Keywords #+BEGIN_SRC emacs-lisp :tangle yes :results silent (font-lock-add-keywords 'cperl-mode - '(("\\(say\\)" . font-lock-function-name-face))) + '(("\\(say\\)" . cperl-nonoverridable-face) + ("\\([0-9.]\\)*" . font-lock-constant-face) + ("\".*\\(\\\n\\).*\"" . font-lock-constant-face) + ("\n" . font-lock-constant-face) + ("\\(^#!.*\\)$" . cperl-nonoverridable-face))) + + ;; (font-lock-add-keywords 'Man-mode + ;; '(("\\(NAME\\)" . font-lock-function-name-face))) - (font-lock-add-keywords 'Man-mode - '(("\\(NAME\\)" . font-lock-function-name-face))) #+END_SRC *** Run Perl @@ -2321,9 +2334,12 @@ new file =C-x C-f C-f= #+BEGIN_SRC emacs-lisp :tangle yes :results silent (font-lock-add-keywords 'perl-mode '(("\\(|\\w+?\\(,\\w+?\\)?|\\)" 1 'py-builtins-face))) - - (font-lock-add-keywords - 'cperl-mode - '(("\\(say\\)" . font-lock-constant-face))) #+END_SRC +* TODO set fly-spell binding + +* TODO imenu bindings + +* TODO modified indicator +* TODO highlight selected ido candicate +* TODO show time in right of mode-line