X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=0c1fd5a985656229ec72737854feea1ba6ebcedb;hb=ce562e8d702a6af572e9955c7c0ee713516b6b37;hp=c80ebdb4b4b225710463ababa0c12b6c92222064;hpb=d6ff34f7eff8892f4976ac9d8b4b28680871ad2f;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index c80ebdb..0c1fd5a 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -44,7 +44,7 @@ Set system PATH and emacs exec path (menu-bar-mode 1)) (menu-bar-mode 0)) - (setq debug-on-error t) + ;; (setq debug-on-error t) (setq inhibit-startup-message t) (defalias 'yes-or-no-p 'y-or-n-p) @@ -112,6 +112,7 @@ Make a temp directory for all cache/history files ;; set temp file path for recentf and auto-save (setq recentf-save-file (concat sd-temp-directory "recentf")) + (setq recentf-max-saved-items 1000) (setq auto-save-list-file-prefix (concat sd-temp-directory "auto-save-list/.saves-")) #+END_SRC @@ -704,8 +705,8 @@ let helm windows split inside current window ivy-wrap t) (set-face-attribute 'ivy-current-match nil :background "Orange" :foreground "black") (global-set-key (kbd "M-x") 'counsel-M-x) - (global-set-key (kbd "C-h f") 'counsel-describe-function) - (global-set-key (kbd "C-h v") 'counsel-describe-variable) + ;; (global-set-key (kbd "C-h f") 'counsel-describe-function) + ;; (global-set-key (kbd "C-h v") 'counsel-describe-variable) (global-set-key (kbd "C-x C-f") 'counsel-find-file) (define-key read-expression-map (kbd "C-r") 'counsel-expression-history) (global-set-key (kbd "C-c C-r") 'ivy-resume)) @@ -730,6 +731,7 @@ let helm windows split inside current window (ivy-shrink-after-dispatching)) (with-eval-after-load "ivy" + (define-key ivy-minibuffer-map (kbd "C-o") 'ivy-dispatching-done) (define-key ivy-minibuffer-map (kbd "C-k") #'sd/swith-buffer-other-window)) #+END_SRC @@ -738,10 +740,6 @@ stolen from [[https://github.com/mariolong/emacs.d/blob/f6a061594ef1b5d1f4750e9d (use-package swiper :ensure t ;; :init - ;(require 'ivy) - ;; (setq ivy-use-virtual-buffers nil) - ;; (setq ivy-wrap t) - ;(set-face-attribute 'ivy-current-match nil :background "Orange" :foreground "black") :config ;; (ivy-mode) (global-set-key (kbd "s-/") 'swiper) @@ -1361,9 +1359,18 @@ set default eshell history folder ;; (add-hook 'eshell-mode-hook (lambda () ;; (local-set-key (kbd "C-l") 'sd/eshell-clear-buffer))) - (add-hook 'eshell-mode-hook (apply-partially #'local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)) ;; (add-hook 'eshell-mode-map (lambda () (interactive) ;; (define-key eshell-mode-map (kbd "") 'completion-at-point))) + + (defun sd/eshell-hook () + (interactive) + (define-key eshell-mode-map (kbd "C-j") #'eshell-send-input) + (define-key eshell-mode-map (kbd "C-l") #'sd/eshell-clear-buffer)) + + (add-hook 'eshell-mode-hook #'sd/eshell-hook) + + + ;; (add-hook 'eshell-mode-hook (apply-partially #'local-set-key (kbd "C-l") 'sd/eshell-clear-buffer)) #+END_SRC ** Toggle Eshell @@ -1415,9 +1422,10 @@ Toggle an eshell in split window below, refer [[http://www.howardism.org/Technic *** hydra install #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package hydra - :ensure t) - ;; disable new line in minibuffer when hint hydra - (setq hydra-lv nil) + :ensure t + ;; disable new line in minibuffer when hint hydra + :init + (setq hydra-lv nil)) #+END_SRC *** Windmove Splitter @@ -1480,7 +1488,38 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex ("q" nil "quit") ("f" nil "quit")) - (global-set-key (kbd "C-'") 'sd/hydra-misc/body) + ;; (global-set-key (kbd "C-'") 'sd/hydra-misc/body) + + (defun sd/exchange-win-layout () + "Change the windos layout." + (interactive) + (when (equal (length (window-list)) 2) + (let ((current-layout (if (or (window-in-direction 'right) (window-in-direction 'left)) + 'v + 'h)) + (other-buf (window-buffer (or (window-in-direction 'right) + (window-in-direction 'left) + (window-in-direction 'below) + (window-in-direction 'above))))) + (delete-other-windows) + (if (eq current-layout 'v) + (split-window-below) + (split-window-right)) + (other-window 1) + (switch-to-buffer other-buf)))) + + (defhydra sd/hydra-window-layout (:color red :colums nil) + "Window Layout" + ("m" sd/toggle-max-windows "Max-win" :exit t) + ("s" ace-swap-window "Swap" :exit t) + ("d" ace-delete-window "Delete" :exit t) + ("x" sd/exchange-win-layout "eXchange" :exit t) + ("u" winner-undo "window-Undo" :exit t) + ("r" winner-redo "window-Redo" :exit t)) + + ;; (with-eval-after-load "evil" + ;; (define-key evil-normal-state-map (kbd ";t") 'sd/hydra-window-layout/body)) + #+END_SRC *** hydra launcher @@ -1607,6 +1646,7 @@ When see function by =C-h f=, and visit the source code, I would like the buffer ;; (eval . (when buffer-file-name ;; (setq-local view-no-disable-on-exit t) ;; (view-mode-enter))) + (projectile-enable-caching . nil) )))) ;; (dir-locals-set-directory-class (expand-file-name "/usr/local/share/emacs") 'emacs) @@ -3128,7 +3168,7 @@ Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g= ;; https://emacs.stackexchange.com/questions/16497/how-to-exclude-files-from-projectile - (setq projectile-enable-caching t) + ;; (setq projectile-enable-caching t) (if (executable-find "rg") (progn (defconst modi/rg-arguments