X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=d6e6b70b26562634ab16b00e6b406fd3c09a9b85;hb=5aae6ccd189a41b3e84c885b653f6c5a1c82340a;hp=26ccb4b7535142c356b8b37be0232844a33ad3cf;hpb=171a01d4e0c5f3413a4fc01c3974bda22e9176a0;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 26ccb4b..d6e6b70 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -642,6 +642,7 @@ Logging Stuff (setq org-clock-into-drawer t) ;; save state change notes and time stamp into LOGBOOK drawer (setq org-log-into-drawer t) + (setq org-clock-into-drawer "CLOCK") #+END_SRC *** Tags @@ -834,6 +835,20 @@ extend org-mode's easy templates, refer to [[http://coldnew.github.io/coldnew-em #+END_SRC +Defined keys, using vi keybindings, Refer abo-abo's setting [[https://github.com/abo-abo/oremacs/blob/c5cafdcebc88afe9e73cc8bd40c49b70675509c7/modes/ora-nextmagit.el][here]] +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (dolist (map (list magit-status-mode-map + magit-log-mode-map + magit-diff-mode-map + magit-staged-section-map)) + (define-key map "j" 'magit-section-forward) + (define-key map "k" 'magit-section-backward) + (define-key map "n" nil) + (define-key map "p" nil) + (define-key map "v" 'recenter-top-bottom) + (define-key map "i" 'magit-section-toggle)) +#+END_SRC + * IDO & SMEX ** IDO @@ -1023,8 +1038,8 @@ Some global bindings on =Super=, on Mac, it is =Command= ;; (global-set-key (kbd "s-y") 'projectile-find-file) (global-set-key (kbd "s-f") 'projectile-find-file) - (global-set-key (kbd "s-[") 'persp-next) - (global-set-key (kbd "s-]") 'persp-prev) + ;; (global-set-key (kbd "s-[") 'persp-next) + ;; (global-set-key (kbd "s-]") 'persp-prev) (global-set-key (kbd "s-`") 'mode-line-other-buffer) @@ -1219,15 +1234,50 @@ Quickly start eshll in split window below, refer [[http://www.howardism.org/Tech (insert (concat "ls")) (eshell-send-input))))) - ;; (global-set-key (kbd "M-`") (lambda () - ;; (interactive) - ;; (if (buffer-name)))) + (global-unset-key (kbd "M-`")) + (global-set-key (kbd "M-`") #'eshell-here) +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun sd/window-has-eshell () + "Check if current windows list has a eshell buffer, and return the window" + (interactive) + (let ((ret nil)) + (dolist (window (window-list)) + (let ((modename (with-current-buffer (window-buffer window) + major-mode))) + (if (equal modename 'eshell-mode) + (setq ret window)))) + ret)) + + (defun sd/toggle-eshell-here () + "Toggle a eshell buffer vertically" + (interactive) + (if (sd/window-has-eshell) + (if (equal major-mode 'eshell-mode) + (delete-window) + (select-window (sd/window-has-eshell))) + (progn + (split-window-vertically (- (/ (window-total-height) 3))) + (other-window 1) + (unless (get-buffer eshell-buffer-name) + (eshell)) + (switch-to-buffer eshell-buffer-name) + (goto-char (point-max)) + (eshell-kill-input) + (message "wowo is %s" default-directory) + (message "wowo is %s" (file-name-directory (buffer-name))) + (insert (format "cd %s" default-directory)) + (eshell-send-input)))) + + (global-unset-key (kbd "M-`")) + (global-set-key (kbd "M-`") 'sd/toggle-eshell-here) #+END_SRC * Misc Settings ** [[https://github.com/abo-abo/hydra][Hydra]] - +*** hydra install #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package hydra :ensure t) @@ -1292,10 +1342,10 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex (defhydra sd/hydra-window (:color red :columns nil) "window" - ("h" windmove-left nil) - ("j" windmove-down nil) - ("k" windmove-up nil) - ("l" windmove-right nil) + ("h" windmove-left nil :exit t) + ("j" windmove-down nil :exit t) + ("k" windmove-up nil :exit t) + ("l" windmove-right nil :exit t) ("H" hydra-move-splitter-left nil) ("J" hydra-move-splitter-down nil) ("K" hydra-move-splitter-up nil) @@ -1304,12 +1354,12 @@ Refer [[https://github.com/abo-abo/hydra/blob/master/hydra-examples.el][hydra-ex (interactive) (split-window-right) (windmove-right)) - "vert") + "vert" :exit t) ("x" (lambda () (interactive) (split-window-below) (windmove-down)) - "horz") + "horz" :exit t) ("o" delete-other-windows "one" :exit t) ("a" ace-window "ace") ("s" ace-swap-window "swap") @@ -1493,11 +1543,10 @@ Type =o= to go to the link We can use [[https://www.gnu.org/software/emms/quickstart.html][Emms]] for multimedia in Emacs #+BEGIN_SRC emacs-lisp :tangle yes :results silent - (use-package emms :ensure t :init - (setq emms-source-file-default-directory "~/Music/emms/") + (setq emms-source-file-default-directory "~/Music/") :config (emms-standard) (emms-default-players)