+* NEXT Key Bindings
+Here are some global key bindings for basic editting
+** Project operations - =super=
+=projectile= settins
+** Windown & Buffer - =C-o=
+Defind a =hydra= function for windows, buffer & bookmark operations. And map it to =C-o= globally.
+Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to delete other windows
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (winner-mode 1)
+
+ (defhydra sd/hydra-window (:color red :columns nil)
+ "window"
+ ("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)
+ ("L" hydra-move-splitter-right nil)
+ ("v" (lambda ()
+ (interactive)
+ (split-window-right)
+ (windmove-right))
+ "vert" :exit t)
+ ("x" (lambda ()
+ (interactive)
+ (split-window-below)
+ (windmove-down))
+ "horz" :exit t)
+ ("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)
+ ("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)
+ ("q" nil "cancel")
+ ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo")
+ ("r" (progn (winner-redo) (setq this-command 'winner-redo)) "redo")
+ ("C-h" nil nil :exit t)
+ ("C-j" nil nil :exit t)
+ ;; ("C-k" nil :exit t)
+ ("C-l" nil nil :exit t)
+ ("C-;" nil nil :exit t)
+ ("p" nil nil :exit t)
+ ("n" nil nil :exit t)
+ ("[" nil nil :exit t)
+ ("]" nil nil :exit t)
+ ("f" nil))
+
+ (global-unset-key (kbd "C-o"))
+ (global-set-key (kbd "C-o") 'sd/hydra-window/body)
+#+END_SRC
+
+** Edit
+- cut, yank, =C-w=, =C-y=
+- save, revert
+- undo, redo - undo-tree
+- select, expand-region
+- spell check, flyspell
+
+** Motion
+- =C-M-=
+*** Use =Avy= for motion
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (use-package avy
+ :ensure t
+ :config
+ (avy-setup-default))
+
+ (global-set-key (kbd "C-M-j") 'avy-goto-line-below)
+ (global-set-key (kbd "C-M-n") 'avy-goto-line-below)
+ (global-set-key (kbd "C-M-k") 'avy-goto-line-above)
+ (global-set-key (kbd "C-M-p") 'avy-goto-line-above)
+
+ (global-set-key (kbd "C-M-f") 'avy-goto-word-1-below)
+ (global-set-key (kbd "C-M-b") 'avy-goto-word-1-above)
+
+ ;; (global-set-key (kbd "M-g e") 'avy-goto-word-0)
+ (global-set-key (kbd "C-M-w") 'avy-goto-char-timer)
+ (global-set-key (kbd "C-M-l") 'avy-goto-char-in-line)
+
+ ;; will delete above
+ (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 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
+ ;; M-g c goto-char
+ ;; M-g g goto-line
+ ;; M-g n next-error
+ ;; M-g p previous-error
+
+ ;; M-g M-g goto-line
+ ;; M-g M-n next-error
+ ;; M-g M-p previous-error
+#+END_SRC
+
+*** =imenu=
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ ;; (global-unset-key (kbd "C-M-i"))
+ ;; (global-set-key (kbd "C-M-i") #'counsel-imenu)
+ (global-set-key (kbd "M-i") #'counsel-imenu)
+
+ (global-set-key (kbd "M-l") 'goto-line)
+#+END_SRC
+
+*** Movement effective
+[[https://www.masteringemacs.org/article/effective-editing-movement][effective-editing-movement]]
+**** Command arguments, numeric argument
+=C-u 4= same as =C-4=, =M-4=
+**** movement by word
+=M-b=, =M-f=
+**** movement by paragraph/sentence
+=M-e=, =M-a=
+**** scrolling
+=C-v=, =M-v=
+**** Move to begin/end buffer
+=M->=, =M-<=
+**** Advanced movement
+***** movement by s-expression
+***** isearch
+=C-s=, =C-r=
+=C-w=, put the word into search minibuffer, =M-y=
+=M-c=, toggle case sensitivity
+=M-n=, =M-p=, history
+***** back to indentation
+=M-m=
+***** Registers/Bookmarks
+Register, =C-x r SPC=, =C-x r j=
+Bookmarks, =C-x r m=, =C-x r b=, =C-x r l=
+***** Mark
+Stolen [[https://www.masteringemacs.org/article/fixing-mark-commands-transient-mark-mode][fixing-mark-commands-transient-mark-mode]]
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+ (defun push-mark-no-activate ()
+ "Pushes `point' to `mark-ring' and does not activate the region
+ Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
+ (interactive)
+ (push-mark (point) t nil)
+ (message "Pushed mark to ring"))
+
+ (global-set-key (kbd "C-`") 'push-mark-no-activate)
+
+ (defun jump-to-mark ()
+ "Jumps to the local mark, respecting the `mark-ring' order.
+ This is the same as using \\[set-mark-command] with the prefix argument."
+ (interactive)
+ (set-mark-command 1))
+
+ (global-set-key (kbd "M-`") 'jump-to-mark)
+
+ (defun exchange-point-and-mark-no-activate ()
+ "Identical to \\[exchange-point-and-mark] but will not activate the region."
+ (interactive)
+ (exchange-point-and-mark)
+ (deactivate-mark nil))
+
+ (define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate)
+#+END_SRC
+***** Repositioning Point
+=M-r=
+***** Imenu
+ido-goto-symbol
+***** tagss
+***** got-to-line
+***** Next/Prev error
+***** begin/end of defun
+** Search & Replace / hightlight =M-s=
+*** search
+*** replace
+*** hightlight
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent