*** hydra misc
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(defhydra sd/hydra-misc (:color red :columns nil)
- "Miscellaneous Commands"
+ "Misc"
("e" eshell "eshell" :exit t)
("p" (lambda ()
(interactive)
(define-key dired-mode-map (kbd "g") 'dired-goto-file))
#+END_SRC
+* ibuffer
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (global-set-key (kbd "s-b") 'ibuffer)
+
+ (with-eval-after-load 'ibuffer
+ (define-key ibuffer-mode-map (kbd "C-o") nil)
+ (define-key ibuffer-mode-map (kbd "j") 'ibuffer-forward-line)
+ (define-key ibuffer-mode-map (kbd "k") 'ibuffer-backward-line)
+ (define-key ibuffer-mode-map (kbd "r") 'ibuffer-update)
+ (define-key ibuffer-mode-map (kbd "g") 'ibuffer-jump-to-buffer))
+#+END_SRC
+
* Completion
company mode and company-statistics
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(delete-other-windows)))
(defhydra sd/hydra-window (:color red :columns nil)
- "window"
+ "Window"
+ ;; windows split
("h" windmove-left nil :exit t)
("j" windmove-down nil :exit t)
("k" windmove-up nil :exit t)
(split-window-below)
(windmove-down))
"horz" :exit t)
- ;; ("o" delete-other-windows "one" :exit t)
+
+ ;; buffer / windows switch
("o" sd/toggle-max-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")
+ ;; ("a" ace-window "ace")
("s" ace-swap-window "swap")
- ("d" ace-delete-window "ace-one" :exit t)
- ("i" ace-maximize-window "ace-one" :exit t)
- ("b" ido-switch-buffer "buf" :exit t)
- ("C-b" ido-switch-buffer "buf" :exit t)
- ("m" bookmark-jump-other-window "open bmk" :exit t)
- ("M" bookmark-set "set bmk" :exit t)
+ ;; ("i" ace-maximize-window "ace-one" :exit t)
+
("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo")
("r" (progn (winner-redo) (setq this-command 'winner-redo)) "redo")
+
+ ;; ibuffer, dired, eshell, bookmarks
+ ;; ("d" ace-delete-window "ace-one" :exit t)
+ ("C-o" ido-switch-buffer "buf" :exit t)
+ ("d" dired-jump "dired" :exit t)
+ ("b" ibuffer "ibuffer" :exit t)
+ ("m" bookmark-jump-other-window "open bmk" :exit t)
+ ("M" bookmark-set "set bmk" :exit t)
+
+ ;; quit
("q" nil "cancel")
("<ESC>" nil)
("C-h" nil nil :exit t)
=C-x h= marks the whole buffer
=C-M-h= marks the next defun
=C-x C-p= marks the next page
-**** DONE Mapping toggle mark ring=
-:LOGBOOK:
-- State "DONE" from "TODO" [2016-07-22 Fri 23:18]
-:END:
*** Registers
Registers can save text, position, rectangles, file and configuration and other things.
Here for movement, we can use register to save/jump position
(back-to-indentation)
(set-mark (line-end-position)))
- (defhydra sd/expand-selected (:color red :columns nil
+ (defhydra sd/expand-selected (:color pink :columns nil
:post (deactivate-mark))
"Selected"
;; select
- ("e" er/expand-region "+")
- ("c" er/contract-region "-")
+ ;; ("e" er/expand-region "+")
+ ("SPC" er/expand-region "+")
+ ;; ("c" er/contract-region "-")
+ ("S-SPC" er/contract-region "-")
("r" (lambda ()
(interactive)
(er/contract-region 0))
("f" er/mark-defun "fun")
("n" er/mark-next-accessor "next")
- ;; exchange
("x" exchange-point-and-mark "exchange")
- ;; ("o" exchange-point-and-mark "exchange")
+
+ ;; Move
+ ;; ("h" backward-char nil)
+ ;; ("j" next-line nil)
+ ;; ("k" previous-line nil)
+ ;; ("l" foreward-char nil)
+
+ ;; Search
+ ;; higlight
+
;; exit
("d" kill-region "delete" :exit t)
- ;; ("i" kill-region "delete" :exit t)
+
("y" kill-ring-save "yank" :exit t)
+ ("M-SPC" nil "quit" :exit t)
+ ("C-SPC" nil "quit" :exit t)
("q" nil "quit" :exit t))
- (global-set-key (kbd "C-=") (lambda ()
+ (global-set-key (kbd "M-SPC") (lambda ()
(interactive)
(er/mark-word)
(sd/expand-selected/body)))
-
- ;; er/mark-word
- ;; er/mark-symbol
- ;; er/mark-symbol-with-prefix
- ;; er/mark-next-accessor
- ;; er/mark-method-call
- ;; er/mark-inside-quotes
- ;; er/mark-outside-quotes
- ;; er/mark-inside-pairs
- ;; er/mark-outside-pairs
- ;; er/mark-comment
- ;; er/mark-url
- ;; er/mark-email
- ;; er/mark-defun
#+END_SRC
*** TODO make expand-region hydra work with lispy selected
* =C-u C-h a= search funtions
=apropos-command=
-* TODO Questions
-- interactive for anonymous function
-When define a key to a anonymous function, the lambda function should be interactive
-
-#+BEGIN_SRC emacs-lisp :tangle yes :results silent
- ;; (require 'saveplace)
- ;; (setq-default save-place t)
- ;; (delete-selection-mode 1)
-#+END_SRC
-
* key
- passion
- vision
- mission
-
* M prefix
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
;; M-b
#+END_SRC
-* TODO ibuffer hydra