X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=c19eb3c154fb26520a2582ba554f01ca84c31f88;hb=208982a22a85a3d377490b72e20398afb65f003d;hp=0520fa7341224cd8923158becb606e0a680ac642;hpb=1ffc8a8c9140267430951925844887f51e4e55cb;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 0520fa7..c19eb3c 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -93,6 +93,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 +608,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]] @@ -641,11 +655,13 @@ Make flyspell enabled for org-mode, see [[http://emacs.stackexchange.com/questio *** =M-g= prefix #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (global-set-key (kbd "M-g g") 'avy-goto-line) + (global-set-key (kbd "M-g j") 'avy-goto-line-below) + (global-set-key (kbd "M-g k") 'avy-goto-line-above) + (global-set-key (kbd "M-g w") 'avy-goto-word-1-below) + (global-set-key (kbd "M-g b") 'avy-goto-word-1-above) (global-set-key (kbd "M-g e") 'avy-goto-word-0) - (global-set-key (kbd "M-g w") 'avy-goto-word-1) - (global-set-key (kbd "M-g c") 'avy-goto-char-timer) - (global-set-key (kbd "M-g f") 'avy-goto-char-in-line) + (global-set-key (kbd "M-g f") 'avy-goto-char-timer) + (global-set-key (kbd "M-g c") 'avy-goto-char-in-line) ;; M-g TAB move-to-column ;; M-g ESC Prefix Command @@ -721,13 +737,6 @@ Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g= ;; C-7 ;; C-Space - - - - - - - #+END_SRC ** =Super= bindings for file, buffer and windows @@ -940,7 +949,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 @@ -970,6 +978,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 @@ -1296,6 +1305,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 @@ -1387,10 +1399,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")) @@ -1463,6 +1473,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) @@ -1481,25 +1492,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 @@ -1758,6 +1775,15 @@ 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 * Programming ** Languages @@ -2112,6 +2138,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