-*** Elisp
-Emacs lisp auto-insert, based on the default module in =autoinsert.el=, but replace =completing-read= as
-=completing-read-ido-ubiquitous= to fix the edge case of that =ido= cannot handle.
-#+BEGIN_SRC emacs-lisp :tangle yes :results silent
- (eval-after-load 'autoinsert
- '(define-auto-insert '("\\.el\\'" . "my Emacs Lisp header")
- '(
- "Short description: "
- ";;; " (file-name-nondirectory (buffer-file-name)) " --- " str
- (make-string (max 2 (- 80 (current-column) 27)) ?\s)
- "-*- lexical-binding: t; -*-" '(setq lexical-binding t)
- "\n
- ;; Copyright (C) " (format-time-string "%Y") " "
- (getenv "ORGANIZATION") | (progn user-full-name) "
-
- ;; Author: " (user-full-name)
- '(if (search-backward "&" (line-beginning-position) t)
- (replace-match (capitalize (user-login-name)) t t))
- '(end-of-line 1) " <" (progn user-mail-address) ">
- ;; Keywords: "
- '(require 'finder)
- ;;'(setq v1 (apply 'vector (mapcar 'car finder-known-keywords)))
- '(setq v1 (mapcar (lambda (x) (list (symbol-name (car x))))
- finder-known-keywords)
- v2 (mapconcat (lambda (x) (format "%12s: %s" (car x) (cdr x)))
- finder-known-keywords
- "\n"))
- ((let ((minibuffer-help-form v2))
- (completing-read-ido-ubiquitous "Keyword, C-h: " v1 nil t))
- str ", ") & -2 "
-
- \;; This program is free software; you can redistribute it and/or modify
- \;; it under the terms of the GNU General Public License as published by
- \;; the Free Software Foundation, either version 3 of the License, or
- \;; (at your option) any later version.
+** Motion
+- =C-M-=
+[[https://www.masteringemacs.org/article/effective-editing-movement][effective-editing-movement]]
+*** Command Arguments, numeric argumens
+=C-u 4= same as =C-4=, =M-4=
+*** Basic movement
+moving by line / word /
+=C-f=, =C-b=, =C-p=, =C-n=, =M-f=, =M-b=
+=C-a=, =C-e=
+=M-m= (move first non-whitespace on this line)
+=M-}=, =M-{=, Move forward end of paragraph
+=M-a=, =M-e=, beginning / end of sentence
+=C-M-a=, =C-M-e=, move begining of defun
+=C-x ]=, =C-x [=, forward/backward one page
+=C-v=, =M-v=, =C-M-v=, =C-M-S-v= scroll down/up
+=M-<=, =M->=, beginning/end of buffer
+=M-r=, Repositiong point
+
+*** Moving by S-expression / List
+*** Marks
+=C-<SPC>= set marks toggle the region
+=C-u C-<SPC>= Jump to the mark, repeated calls go further back the mark ring
+=C-x C-x= Exchanges the point and 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"))