X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=b36f660e30200bab072963a53e82dd91e22c4611;hb=406d7270368d71bc4f0d1ee781c63477a79ddce8;hp=391f3801036602a676dcf54fcdb79e4d646f43e2;hpb=40a0fb350e4baa200b6560e07d899a8e462275f8;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 391f380..b36f660 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -25,9 +25,7 @@ Set system PATH and emacs exec path Set the emacs load path #+BEGIN_SRC emacs-lisp :tangle yes :results silent - - (add-to-list 'load-path "~/.emacs.d/elisp") - + ;; (add-to-list 'load-path "~/.emacs.d/elisp") #+END_SRC ** Package Initialization @@ -53,7 +51,7 @@ Disable scroll bar, tool-bar and menu-bar (tool-bar-mode 0) (menu-bar-mode 1) - (setq debug-on-error t) + ;; (setq debug-on-error t) (setq inhibit-startup-message t) (defalias 'yes-or-no-p 'y-or-n-p) @@ -93,6 +91,14 @@ Set default window size (height . 50))) #+END_SRC +Stop auto save +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (setq auto-save-default nil) + + ;; restore last session + (desktop-save-mode t) +#+END_SRC + * Package Management Tools ** Use-package @@ -600,6 +606,12 @@ Stolen from [[https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-spell ;; enable flyspell check on comments and strings in progmamming modes (add-hook 'prog-mode-hook 'flyspell-prog-mode) + + ;; I don't use the default mappings + (with-eval-after-load 'flyspell + (define-key flyspell-mode-map (kbd "C-;") nil) + (define-key flyspell-mode-map (kbd "C-,") nil) + (define-key flyspell-mode-map (kbd "C-.") nil)) #+END_SRC Make flyspell enabled for org-mode, see [[http://emacs.stackexchange.com/questions/9333/how-does-one-use-flyspell-in-org-buffers-without-flyspell-triggering-on-tangled][here]] @@ -935,7 +947,6 @@ use the prefix =M-s= for searching in buffers Always indents header, and hide header leading starts so that no need type =#+STATUP: indent= #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package org :ensure t :init @@ -965,6 +976,7 @@ Always indents header, and hide header leading starts so that no need type =#+ST ;; use current window for org source buffer editting (setq org-src-window-setup 'current-window ) + (define-key org-mode-map (kbd "C-'") nil) #+END_SRC ** Org-bullets @@ -1291,6 +1303,9 @@ and Defined keys, using vi keybindings, Refer abo-abo's setting [[https://github #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package magit :ensure t + :init + ;; don't ask me to confirm the unsaved change + (setq magit-save-repository-buffers nil) :commands magit-status magit-blame :config (dolist (map (list magit-status-mode-map @@ -1382,10 +1397,8 @@ Toggle an eshell in split window below, refer [[http://www.howardism.org/Technic #+END_SRC *** Font Zoom - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (defhydra sd/font-zoom (global-map "") - + (defhydra sd/font-zoom (global-map "") "zoom" ("g" text-scale-increase "in") ("l" text-scale-decrease "out")) @@ -1458,6 +1471,7 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex ("o" delete-other-windows "one" :exit t) ("C-o" ido-switch-buffer "buf" :exit t) ("C-k" sd/delete-current-window "del" :exit t) + ("'" other-window "other" :exit t) ("a" ace-window "ace") ("s" ace-swap-window "swap") ("d" ace-delete-window "ace-one" :exit t) @@ -1476,25 +1490,31 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex *** hydra misc #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (defhydra sd/hydra-misc () + (defhydra sd/hydra-misc (:color red :columns nil) "Miscellaneous Commands" - ("e" eshell "eshell" :color red :exit t) + ("e" eshell "eshell" :exit t) ("p" (lambda () (interactive) - (if (sd/buffer-exist "*Packages*") + (if (not (eq nil (get-buffer "*Packages*"))) (switch-to-buffer "*Packages*") (package-list-packages))) - "list-package" :color red :exit t) - ("g" magit-status "git-status" :color red :exit t)) + "list-package" :exit t) + ("g" magit-status "git-status" :exit t) + ("'" mode-line-other-buffer "last buffer" :exit t) + ("C-'" mode-line-other-buffer "last buffer" :exit t) + ("m" man "man" :exit t) + ("d" dired-jump "dired" :exit t) + ("q" nil "quit") + ("f" nil "quit")) + + (global-set-key (kbd "C-'") 'sd/hydra-misc/body) #+END_SRC *** hydra launcher #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (defhydra hydra-launcher (:color blue :columns 2) + (defhydra sd/hydra-launcher (:color blue :columns 2) "Launch" - ("h" man "man") - ("s" eshell "eshell") - ("p" package-list-packages "Package") + ("e" emms "emms" :exit t) ("q" nil "cancel")) #+END_SRC @@ -1714,14 +1734,6 @@ Play Go in Emacs, gnugo xpm refert [[https://github.com/okanotor/dotemacs/blob/f #+END_SRC -** dired -=C-o= is defined as a global key for window operation, here unset it in dired mode -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - (add-hook 'dired-mode-hook (lambda () - (local-unset-key (kbd "C-o")) - (local-set-key (kbd "o") 'dired-display-file))) -#+END_SRC - ** Info plus #+BEGIN_SRC emacs-lisp :tangle yes :results silent (el-get-bundle info+ @@ -1753,6 +1765,55 @@ Play Go in Emacs, gnugo xpm refert [[https://github.com/okanotor/dotemacs/blob/f (sd/delete-current-window)) #+END_SRC +** 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 + +** TODO UTF8 +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + ;; (set-language-environment "UTF-8") + ;; (set-default-coding-systems 'utf-8) +#+END_SRC + +** Demo It +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + ;; (el-get-bundle howardabrams/demo-it) + + ;; (use-package org-tree-slide + ;; :ensure t) + + ;; (use-package yasnippet + ;; :ensure t) +#+END_SRC + +* dired +=C-o= is defined as a global key for window operation, here unset it in dired mode +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (add-hook 'dired-mode-hook (lambda () + (local-unset-key (kbd "C-o")) + (local-set-key (kbd "o") 'dired-display-file))) + + (define-key dired-mode-map (kbd "DEL") (lambda () (interactive) (find-alternate-file ".."))) +#+END_SRC + +Dired+ +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (use-package dired+ + :ensure t + :init + (setq diredp-hide-details-initially-flag nil) + :config + (define-key dired-mode-map (kbd "j") 'diredp-next-line) + (define-key dired-mode-map (kbd "k") 'diredp-previous-line) + (define-key dired-mode-map (kbd "g") 'dired-goto-file)) +#+END_SRC + * Programming ** Languages @@ -2107,6 +2168,11 @@ See [[https://www.emacswiki.org/emacs/GnusWindowLayout][GnusWindowLayout]] ;; (gnus-group-select-group "INBOX"))) #+END_SRC +* Blog +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + +#+END_SRC + * key - passion - vision