X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=b1761449ad82fc1f064c20e71f90b4af6cad774a;hb=bf8dbecc0742dc4baece54039f5f14e0a9a9ee43;hp=4a9a86626c751c2d2656950c76a1547816a240af;hpb=27af0f25265a40e19a0eaab8740df0b6582b813c;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 4a9a866..b176144 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -144,13 +144,12 @@ Check out [[http://tapoueh.org/emacs/el-get.html][el-get]]. #+END_SRC * Color and Fonts Settings - ** highlight current line - #+BEGIN_SRC emacs-lisp :tangle yes :results silent - - (global-hl-line-mode) - + ;; (global-hl-line-mode) + ;; don't want high light current line in eshell/term mode + (add-hook 'prog-mode-hook 'hl-line-mode) + (add-hook 'text-mode-hook 'hl-line-mode) #+END_SRC ** Smart Comments @@ -1241,9 +1240,20 @@ I like [[https://github.com/coldnew/linum-relative][linum-relative]], just like #+END_SRC ** Multi-term +define =multi-term= mapping to disable some mapping which is used globally. #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package multi-term :ensure t) + + (defun sd/term-mode-mapping () + (mapcar (lambda (map) + (define-key map (kbd "C-o") nil) + (define-key map (kbd "C-g") nil)) + (list term-mode-map + term-raw-map))) + + (with-eval-after-load 'multi-term + (sd/term-mode-mapping)) #+END_SRC ** ace-link @@ -1456,6 +1466,11 @@ brew install the-silver-searcher ;; (add-hook 'c++-mode-local-vars-hook #'sd/c++-mode-local-vars) #+END_SRC +** Table +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (add-hook 'text-mode-hook 'table-recognize) +#+END_SRC + * Dired ** Dired bindings =C-o= is defined as a global key for window operation, here unset it in dired mode @@ -1780,6 +1795,14 @@ C/C++ ide tools #+BEGIN_SRC emacs-lisp :tangle yes :results silent (setq c-default-style "stroustrup" c-basic-offset 4) + + ;; "C-M-j" is my global binding for avy goto line below + ;; disable it in c mode + (mapcar '(lambda (map) + (define-key map (kbd "C-M-j") nil)) + (list c-mode-map + c++-mode-map + objc-mode-map)) #+END_SRC *** irony @@ -1936,6 +1959,8 @@ Set the environments vairables in compilation mode (define-key compilation-mode-map (kbd "n") 'compilation-next-error) (define-key compilation-mode-map (kbd "p") 'compilation-previous-error) (define-key compilation-mode-map (kbd "r") #'recompile)) + + (global-set-key (kbd "s-r") 'compile) #+END_SRC * Auto-Insert @@ -2528,6 +2553,7 @@ Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to del ;; other special buffers ("d" sd/project-or-dired-jump nil :exit t) ("b" ibuffer nil :exit t) + ("t" multi-term nil :exit t) ("e" sd/toggle-project-eshell nil :exit t) ("m" bookmark-jump-other-window nil :exit t) ("M" bookmark-set nil :exit t) @@ -2973,6 +2999,18 @@ stolen from [[https://github.com/mariolong/emacs.d/blob/f6a061594ef1b5d1f4750e9d #+END_SRC *** TODO make expand-region hydra work with lispy selected +** =C-w= delete backward word +Refer [[https://github.com/fnwiya/dotfiles/blob/c9ca79f1b22c919d9f4c3a0f944ba8281255a594/setup/.emacs.d/loader-init/_90-kill-region-or-backward-kill-word.el][kill-region-or-backward-kill-word]] +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun sd/kill-region-or-backward-kill-word () + (interactive) + (if (region-active-p) + (kill-region (point) (mark)) + (backward-kill-word 1))) + + (global-set-key (kbd "C-w") 'sd/kill-region-or-backward-kill-word) +#+END_SRC + * key - passion - vision