junjiemars / .emacs.d
Programming Languages
Projects that are alternatives of or similar to .emacs.d
#+TITLE: More Reasonable Emacs #+AUTHOR: Junjie Mars #+STARTUP: overview #+OPTIONS: num:nil toc:nil #+REVEAL_HLEVEL: 2 #+REVEAL_SLIDE_NUMBER: h #+REVEAL_THEME: moon #+BEGIN_COMMENT #+REVEAL_TRANS: cube #+REVEAL_MARGIN: 0.1 #+REVEAL_MIN_SCALE: 0.2 #+REVEAL_MAX_SCALE: 1.5 #+END_COMMENT #+PROPERTY: header-args :exports code #+HTML_HEAD:
@@html:@@
- Quick start :PROPERTIES: :CUSTOM_ID: quick-start :END:
#+ATTR_HTML: :style text-align:left It's works on Emacs version 22.1.1+ , provides more reasonable styles: more organized code, more consistent, more cleaner and more faster. You can run it on any environment Emacs itself runs on: GUI or Terminal, even you can run multiple Emacs instances with different version on the same machine and at the same time.
#+REVEAL: split
-
clone More Reasonable Emacs from github #+BEGIN_SRC sh git clone --depth=1 https://github.com/junjiemars/.emacs.d.git ~/.emacs.d #+END_SRC
-
open Emacs, after Emacs compile all elisp files, then reopen Emacs
-
want more functionalities see [[#cooking][Cooking]] section
#+ATTR_HTML: :style text-align:left One more thing, it's best to remind you: take care, it's super fast.
#+ATTR_HTML: :style display:none
- [[#story][Story]]
- [[#cooking][Cooking]]
- [[#programming][Programming]]
- [[#troubleshoting][Troubleshoting]]
- [[#mnemonic][Mnemonic]]
- Story :PROPERTIES: :CUSTOM_ID: story :END:
#+ATTR_HTML: :style text-align:left Emacs is the most powerful editor on the world there is no one of, it's programmable, elegant and /self-documenting/.
#+REVEAL: split #+ATTR_HTML: :style text-align:left After falling in love with [[https://en.wikipedia.org/wiki/Lisp_(programming_language)][Lisp]], I know it's the time to make Emacs being a part of my body and mind, not just open a file, navigating, editing, and save it. So, I build More Reasonable Emacs like Ecluid did for gemometry.
#+REVEAL: split #+ATTR_HTML: :style text-align:left The More Reasonable Emacs strives to be fast, stable and hacker friendly, which can be run and with consistent behaviors on wherever Emacs runs.
#+ATTR_HTML: :style display:none
- [[#highlights][Highlights]]
- [[#requirements][Requirements]]
- [[#where][Where]]
- [[#what][What]]
- [[#install][Install]]
- [[#organization][Organization]]
#+REVEAL: split #+ATTR_HTML: :style text-align:left Now, let's start from the Level Two. And one more thing: teach yourself some little Elisp (@@html:@@M-x i d m [email protected]@html:@@).
** Highlights :PROPERTIES: :CUSTOM_ID: highlights :END:
- Carefully designed: robust, fast and just load what's your want.
- Adaptive: can run on any OS, GUI or Terminal, from most recent Emacs's versions to ancient ones, and one Emacs's configuration suit for all coexisting Emacs on the same machine.
- Consistent: wherever and whenever you can play with Emacs always behaves in the same way.
- Awesome style: [[https://github.com/junjiemars/images/blob/master/.emacs.d/dracula-theme-on-windows.png][Windows]], [[https://github.com/junjiemars/images/blob/master/.emacs.d/dracula-theme-on-darwin.png][Darwin]], and [[https://github.com/junjiemars/images/blob/master/.emacs.d/dracula-theme-on-linux.png][Linux]]
** Requirements :PROPERTIES: :CUSTOM_ID: requirements :END:
- Emacs 22.1.1+
- Keyboard+
** Where :PROPERTIES: :CUSTOM_ID: where :END:
- Linux, whatever GUI or Terminal
- Darwin, whatever GUI or Terminal
- Windows, whatever GUI or Terminal
- Raspberry Pi
- Docker container
- No Network
- One machine, multiple Emacs instances
** What :PROPERTIES: :CUSTOM_ID: what :END:
- You are the master of your Emacs, ...
- Navigating, finding, grepping in the same way wherever, ...
- Org Mode that's your new life, ...
- Reliable programming experiments, C, Lisp, ...
- It's a no-cost extension and git friendly infrastructure.
** Install :PROPERTIES: :CUSTOM_ID: install :END:
#+ATTR_HTML: :style text-align:left Just one thing you need to do, clone it (just <500KB) to your =HOME= directory:
#+BEGIN_SRC sh git clone --depth=1 https://github.com/junjiemars/.emacs.d.git ~/.emacs.d #+END_SRC
#+REVEAL: split #+ATTR_HTML: :style text-align:left First run More Reasonable Emacs, it should automatically do:
- byte compile elisp source files.
- install packages, if you allow it.
#+ATTR_HTML: :style text-align:left After first run More Reasonable Emacs, exit and then /reopen/ Emacs.
#+REVEAL: split #+ATTR_HTML: :style text-align:left On Windows, if you'd [[https://git-scm.com/downloads][Git-Bash]] installed but no Emacs, you are lucky, a one line code will do it all for you and more: fix some Emacs' issue for you, and you don't need run src_shell{git clone ...},
instead,
#+BEGIN_SRC sh HAS_EMACS=1 bash <(curl https://raw.githubusercontent.com/junjiemars/kit/master/win/install-win-kits.sh) #+END_SRC
#+ATTR_HTML: :style text-align:left Now, it will works perfectly, but if you want to more control and more features, such as themes, packages, and fonts etc., see next section: [[#cooking][cooking]]
** Organization :PROPERTIES: :CUSTOM_ID: organization :END:
#+ATTR_HTML: :style text-align:left Annotated your Emacs HOME as =(emacs-home*)=.
#+ATTR_HTML: :style text-align:left Your private configuration directory at =(emacs-home* "private/")=. All things under it you can rename, move, delete.
#+ATTR_HTML: :style text-align:left All Elisp files should be compiled, if you meet some trouble, a magic interactive function =(clean-compiled-files)= should help, run it and reopen the Emacs.
*** Directory
#+BEGIN_EXAMPLE (emacs-home*) ├── LICENSE ├── README.org ├── config (comment "all stuff here") ├── elpa (comment "installed packages") ├── init.el (comment "Emacs init file") ├── private (comment "your configuration can put here") │ ├── self-env-spec.el │ ├── self-package-spec.el │ ├── self-epilogue.el └── theme (comment "themes directory") #+END_EXAMPLE
#+REVEAL: split #+ATTR_HTML: :style text-align:left Locate your spec via =(self-paths)=.
#+BEGIN_SRC emacs-lisp
;; Run order: :env-spec -> :package-spec -> :epilogue
;; You can point to your Gited Emacs' configuration repo.
;; Default samples sample-self-*.el' in
(emacs-home* "config/")' directory.
;; :epilogue run in `after-init-hook'
(self-paths :put :package-spec (comment (emacs-home* "private/self-package-spec.el"))) (self-paths :put :epilogue (comment (emacs-home* "private/self-epilogue.el"))) #+END_SRC
#+REVEAL: split #+ATTR_HTML: :style text-align:left Directories with =.= /prefix/ are for the modules that need store configuration or cached files.
#+BEGIN_EXAMPLE (emacs-home*) ├── .backup ├── .bookmarks ├── .desktop ├── .dired ├── .eshell ├── .exec (comment "executable") ├── .games ├── .ido ├── .image-dired ├── .mail ├── .minibuffer ├── .places ├── .recentf ├── .save ├── .semantic ├── .semanticdb ├── .server ├── .tags ├── .tramp └── .url
#+END_EXAMPLE
*** Naming
#+REVAL: split #+ATTR_HTML: :style text-align:left Introduce the rules of naming /files/ and /functions/.
#+REVEAL: split **** Core Files Naming: single word and simple name.
#+BEGIN_EXAMPLE (emacs-home* "config/") ├── autoloads.el ├── basic.el ├── boot.el ├── chez.el ├── dicts.el ├── financial.el ├── fns.el ├── gambit.el ├── go.el ├── graphic.el ├── gud-cdb.el ├── gud-lldb.el ├── guds.el ├── memory.el └── module.el #+END_EXAMPLE
#+REVEAL: split **** Extension Naming
#+REVEAL: split
- /extension/ for Emacs builtin packages: =s.el= #+BEGIN_EXAMPLE (emacs-home* "config/") ├── shells.el ├── sockets.el └── tags.el #+END_EXAMPLE
#+REVEAL: split
- /autoload extension/ for Emacs builtin packages: =on--autoload.el= #+BEGIN_EXAMPLE (emacs-home* "config/") ├── on-cc-autoload.el ├── on-compile-autoload.el ├── on-dired-autoload.el ├── on-docview-autoload.el ├── on-edit-autoload.el ├── on-enc-autoload.el ├── on-eshell-autoload.el ├── on-eww-autoload.el ├── on-font-autoload.el ├── on-hippie-autoload.el ├── on-indent-autoload.el ├── on-isearch-autoload.el ├── on-lisp-autoload.el ├── on-module.el ├── on-net-autoload.el ├── on-org-autoload.el ├── on-pp-autoload.el ├── on-python-autoload.el ├── on-semantic-autoload.el ├── on-term-autoload.el ├── on-tramp-autoload.el └── on-window-autoload.el #+END_EXAMPLE
#+REVEAL: split
- /extension/ for /non/ Emacs builtin packages: =use--autoload.el= #+BEGIN_EXAMPLE (emacs-home* "config/") ├── use-cider-autoload.el ├── use-cider.el ├── use-geiser-autoload.el ├── use-inf-clojure.el ├── use-lfe-autoload.el ├── use-lua-autoload.el ├── use-magit-autoload.el ├── use-slime-autoload.el └── use-web-autoload.el #+END_EXAMPLE
#+REVEAL: split **** Sample Files Naming: =sample-self-*.el=
#+BEGIN_EXAMPLE (emacs-home* "config/") ├── sample-self-env-spec.el ├── sample-self-package-spec.el └── sample-self-epilogue.el #+END_EXAMPLE
#+REVEAL: split **** Functions Naming (χ denotes name)
#+REVEAL: split
- v-χ prefix: function or macro for versioned directory, such as =v-home*=
- χ prefix: function or macro only existing in compile-time, such as =[email protected]=
- χ* or χ** suffix: extension of Emacs' builtin function or macro, such as =every*= and =assoc**=
- χ% suffix: macro be expanded at compile time, such as =v-home%=
- χ! suffix: function or macro with side-effects, such as =v-home!=
- χ@ suffix: position related functions or macros, such as [email protected]= and [email protected]=
- Cooking :PROPERTIES: :CUSTOM_ID: cooking :END:
#+ATTR_HTML: :style display:none
- [[#theme][Theme]]
- [[#frame][Frame]]
- [[#cooking-shell][Shell]]
- [[#session][Session]]
- [[#network][Network]]
- [[#package][Package]]
- [[#indent][Indent]]
- [[#file][File]]
- [[#editing][Editing]]
- [[#keys][Keys]]
** Theme :PROPERTIES: :CUSTOM_ID: theme :END:
#+ATTR_HTML: :style text-align:left Easy to switch themes, or try a new one.
#+ATTR_HTML: :style text-align:left The theme's spec locate in =(self-paths :get :env-spec)= by default.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :theme (list :name nil ;; 'dracula :custom-theme-directory (emacs-home* "theme/") :compile nil ;; expert option :allowed nil)) #+END_SRC
#+REVEAL: split
- =:name= name of theme, does not need /-theme.el/ suffix
- =:custom-theme-directory= where custom theme files located
- =:compile= =t= compile theme, compiled theme more smooth and more faster if you had already confirmed the theme is secure.
- =:allowed= =t= enabled, =nil= disabled
#+REVEAL: split #+ATTR_HTML: :style text-align:left Using Emacs's builtin themes /tango-dark/ :
#+BEGIN_SRC emacs-lisp (self-env-spec :put :theme (list :name nil ;; 'dracula :custom-theme-directory (emacs-home* "theme/") :compile nil ;; expert option :allowed nil)) #+END_SRC
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/default-theme-on-windows.png][default theme]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dracula-theme-on-windows.png][dracula theme]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/tango-dark-theme-on-windows.png][tango-dark theme]]
** Frame :PROPERTIES: :CUSTOM_ID: frame :END:
#+ATTR_HTML: :style text-align:left Easy to swtich fonts and glyph character such as [[https://en.wikipedia.org/wiki/CJK_characters][CJK]], or try a new one. The default encoding is [[https://en.wikipedia.org/wiki/UTF-8][UTF-8]].
#+ATTR_HTML: :style text-align:left The frame's spec locate in =(self-env-spec :get :frame)= by default and for GUI mode only.
#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(self-env-spec
:put :frame
(list :initial ((fullscreen . fullheight)) :default
((font . ,(if-platform% 'darwin
"Monaco-17"
(if-platform% 'windows-nt
"Consolas-13"
"DejaVu Sans Mono-14"))))
:frame-resize-pixelwise t
:allowed t))
#+END_SRC
- =:name= string of font name
- =:size= integer of font size
- =:allowed= =t= enabled, =nil= disabled
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :glyph `((:name ,(if-platform% 'darwin "Hack" (if-platform% 'windows-nt "Courier New" "DejaVu Sans Mono")) :size 17 :scale nil :scripts (greek) :allowed t) (:name ,(if-platform% 'darwin "PingFang" (if-platform% 'windows-nt "Microsoft YaHei" "Noto Sans")) :size 12 :scale nil :scripts (han) :allowed nil))) #+END_SRC
- =:name= string of font name
- =:size= integer of font size
- =:scale= number of scale ratio of glyph font, =nil= disabled
- =:scripts= list of script symbol for character
- =:allowed= =t= enabled, =nil= disabled
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/cjk-font-on-darwin.png][glyph font: CJK]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/monaco-font-on-darwin.png][Monaco font]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/consolas-font-on-windows.png][Consolas font]]
** Shell :PROPERTIES: :CUSTOM_ID: cooking-shell :END:
*** shell
#+ATTR_HTML: :style text-align:left Suppport any =SHELL=, copying or spinning environment variables into Emacs environment.
#+ATTR_HTML: :style text-align:left [[https://github.com/purcell/exec-path-from-shell][exec-path-from-shell]] has a poor implementation for the same functionalities, it is unstable and slow. But here, We had a better one.
#+ATTR_HTML: :style text-align:left The shell spec locate in =(self-env-spec :get :shell)= by default.
#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(self-env-spec
:put :shell
(list :copy-vars ("PATH") :spin-vars nil ;;
(("ZZZ" . "123"))
:options '("-i" "2>/dev/null") ;; '("--login")
:exec-path t
:shell-file-name (or (executable-find% "zsh")
(executable-find% "bash"))
:prompt (list :zsh "%[email protected]\h:\w\$ ")
:allowed t))
#+END_SRC
#+REVEAL: split
- =:copy-vars= copy environment variables from shell to Emacs, affects =eshell=, =shell= and =ansi-term=
- =:spin-vars= spin customized variables, only affects =eshell=
- =:options= a list of shell's options
- =:exec-path= copy =$PATH= or =%PATH%= to =exec-path=
- =:shell-file-name= where the shell program located, it should be specified when =:copy-vars= is non nil
- =:prompt= unify shell prompt in =term= mode, via @@html:@@C-c [email protected]@html:@@ then @@html:C-c t [email protected]@html:@@
- =:allowed= =t= allowed, =nil= disabled
*** eshell :PROPERTIES: :CUSTOM_ID: eshell :END:
#+ATTR_HTML: :style text-align:left The eshell spec locate in =(self-env-spec :get :eshell)= by default. And shared the copied environment variables =:copy-vars= with shell.
#+REVEAL: splitV #+BEGIN_SRC emacs-lisp (self-env-spec :put :eshell (list :visual-commands '("mtr") :destroy-buffer-when-process-dies nil :visual-subcommands nil ;; '(("git" "log")) :visual-options nil :allowed t)) #+END_SRC
#+REVEAL: split
- =:visual-commands= @@html:@@C-h-v [email protected]@html:@@
- =:destroy-buffer-when-process-dies= @@html:@@C-h-v [email protected]@html:@@
- =:visual-subcommands= @@html:@@C-h-v [email protected]@html:@@
- =:visual-options= @@html:@@C-h-v [email protected]@html:@@
- =:allowed= =t= allowed, =nil= disabled
** Session :PROPERTIES: :CUSTOM_ID: session :END:
#+ATTR_HTML: :style text-align:left The desktop spec locate in =(self-env-spec :get :desktop)= by default.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :desktop (list :files-not-to-save ".t?gz$\|.zip$\|.desktop\|~$\|^/sudo:\|^/ssh[x]?:\|.elc$" :buffers-not-to-save "^TAGS\|\.log" :modes-not-to-save '(dired-mode fundamental-mode eww-mode rmail-mode) :restore-eager 8 :allowed t)) #+END_SRC
#+REVEAL: split
- =:files-not-to-save= @@html:@@C-h-v [email protected]@html:@@
- =:buffers-not-to-save= @@html:@@C-h-v [email protected]@html:@@
- =:modes-not-to-save= @@html:@@C-h-v [email protected]@html:@@
- =:restore-eager= @@html:@@C-h-v [email protected]@html:@@
- =:allowed= =t= enabled, =nil= disabled
** Network :PROPERTIES: :CUSTOM_ID: network :END:
*** Socks
#+ATTR_HTML: :style text-align:left Using socks proxy when installing packages or browsing web pages.
#+ATTR_HTML: :style text-align:left The socks spec locate in =(self-env-spec :get :socks)= by default.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :socks (list :port 32000 :server "127.0.0.1" :version 5 :allowed nil)) #+END_SRC
#+REVEAL: split
- =:port= the port of socks proxy server
- =:server= the address of socks proxy server
- =:version= socks version
- =:allowed= =t= enabled, =nil= disabled
#+ATTR_HTML: :style text-align:left If =:allowed t=, =url-gateway-method= should be switch to =socks= when Emacs initializing. After Emacs initialization, you can =toggle-socks!= and no matter =:allowed= is =t= or =nil=.
*** Network Utils
#+ATTR_HTML: :style text-align:left Emacs comes with a lots of wrappers(=net-utils.el=) around the common network utilities. Such as @@html:@@M-x [email protected]@html:@@ a host. But =net-utils.el= has some inconveniences:
#+REVEAL: split
- If you want to =ping= with options you must set =ping-program-options= customizable variable.
- IPv6 supporting: on Unix-like OS there are individual program for IPv6, such as =ping6=, but on Windows OS just one =ping= program and with =-6= option.
#+ATTR_HTML: :style text-align:left I'd refined common interative commands around =net-utils=, and named those commands with =*= prefix. Using @@html:@@C-u M-x *@@html:@@ you can set the options for that .
#+REVEAL: split #+ATTR_HTML: :style text-align:left The following interactive commands had been defined for Emacs22.1+ whatever OS you using:
- @@html:@@M-x *[email protected]@html:@@
- @@html:@@M-x *[email protected]@html:@@
- @@html:@@M-x *[email protected]@html:@@
- @@html:@@M-x *[email protected]@html:@@
- @@html:@@M-x *[email protected]@html:@@
*** Browser :PROPERTIES: :CUSTOM_ID: browser :END:
- toggle external or internal browser: @@html:@@M-x [email protected]@html:@@
- lookup web for symbol, word, etc.,: @@html:@@M-s [email protected]@html:@@
- lookup online dictionaries: @@html:@@M-s [email protected]@html:@@
** Package :PROPERTIES: :CUSTOM_ID: package :END:
#+ATTR_HTML: :style text-align:left Don't tell me [[https://github.com/jwiegley/use-package][use-package]], it's trying to redefine Emacs. Here you can find more simpler and faster way to implement almost functionalities that =use-pacakge= does and more.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :package (list :remove-unused nil :package-check-signature 'allow-unsigned :allowed t)) #+END_SRC
#+REVEAL: split
- =:remove-unused= whether remove the unused packages that be defined in =def-self-package-spec=
- =:package-check-signature= =nil= does not check signature when installing packages.
- =:allowed= =t= enabled, =nil= disabled
#+ATTR_HTML: :style text-align:left The /user defined/ package spec locate in =(self-packages)=.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-packages :put :doc (list :cond t :packages (list (when% (executable-find% "gnuplot") 'gnuplot-mode) 'markdown-mode 'multiple-cursors (when-version% <= 24.3 'yasnippet) 'vlf)))
(self-packages :put :org (list :cond t :packages (flatten (list (when% (executable-find% "latex") '(auctex cdlatex)) (when-version% <= 25 'ox-reveal)))))
(self-packages :put :vcs (list :cond (and (when-version% <= 24.4 t) (executable-find% "git")) :packages '(magit) :compile `(,(compile-unit% (emacs-home* "config/use-magit-autoload.el")))))
(self-packages :put :docker (list :cond (and (when-version% <= 24.4 t) (executable-find% "docker")) :packages '(dockerfile-mode)))
(self-packages :put :scheme (list :cond (and (when-version% <= 23.2 t) (or (executable-find% "racket") (executable-find% "scheme") (executable-find% "chicken") (executable-find% "guile"))) :packages '(geiser) :compile `(,(compile-unit% (emacs-home* "config/use-geiser-autoload.el")))))
(self-packages :put :common-lisp (list :cond (executable-find% "sbcl") :packages '(slime) :compile `(,(compile-unit% (emacs-home* "config/use-slime-autoload.el")))))
(self-packages :put :java (list :cond (and (when-version% <= 25.1 t) (executable-find% "java")) :packages '(cider clojure-mode clojure-mode-extra-font-locking kotlin-mode) :compile `(,(compile-unit% (emacs-home* "config/use-cider.el") t) ,(compile-unit% (emacs-home* "config/use-cider-autoload.el") t))))
(self-packages :put :erlang (list :cond (executable-find% "erlc") :packages (list 'erlang (when% (executable-find% "lfe") 'lfe-mode)) :compile (list (when% (executable-find% "lfe") (compile-unit% (emacs-home* "config/use-lfe-autoload.el"))))))
(self-packages :put :lua (list :cond (executable-find% "lua") :packages '(lua-mode) :compile `(,(compile-unit% (emacs-home* "config/use-lua-autoload.el")))))
(self-packages :put :web (list :cond nil :packages (list 'htmlize 'js2-mode (when-version% <= 25 'restclient) (when-version% <= 24.3 'skewer-mode) 'web-mode 'x509-mode))) #+END_SRC
#+REVEAL: split
- =:cond= decide whether to install =:packages= or compile =:compile=
- =:packages= a list of package names or tar file names
- =:compile= when installed packages, a list of files that should be compiled only or be loaded after been compiled
#+REVEAL: split #+ATTR_HTML: :style text-align:left You can use any =Elisp= functions after the aboved keywords.
- =when-version%= macro checking the version of current Emacs at compile time.
- =executable-find%= macro checking the exising of the /executable/ at compile time.
- =compile-unit%= macro specify the compiling file to compile or compile then load.
** Indent :PROPERTIES: :CUSTOM_ID: indent :END:
#+ATTR_HTML: :style text-align:left Avoiding a war. If /whitespace/ causes some trouble, you can swith to @@html:@@M-x [email protected]@html:@@ to find out.
#+REVEAL: split #+BEGIN_SRC emacs-lisp (self-env-spec :put :edit (list :tab-width 2 :standard-indent 2 :auto-save-default nil :disable-indent-tabs-mode '(c-mode-common-hook sh-mode-hook emacs-lisp-mode-hook) :narrow-to-region nil :allowed t)) #+END_SRC
- =:tab-width= default @@html:@@C-h-v [email protected]@html:@@
- =:auto-save-default= @@html:@@C-h-v [email protected]@html:@@
- =:disable-indent-tabs-mode= disble =indent-tabs-mode= in specified major modes
- =:narrow-to-region= =t= enabled, =nil= disabled
- =:allowed= =t= enabled, =nil= disabled
** File :PROPERTIES: :CUSTOM_ID: file :END:
#+ATTR_HTML: :style text-align:left Using =dired= as a File Manager is awesome, same experiences on Windows, Darwin and Linux.
*** ls Program
#+ATTR_HTML: :style text-align:left For Windows, there are no built-in =ls= program, but you can install GNU's =ls= via [[https://git-scm.com/downloads][Git-Bash]].
#+ATTR_HTML: :style text-align:left For Darwin, let =dired= don't do stupid things.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/ido-dired-windows-gnu-ls.png][ido-dired]]
*** find Program
#+ATTR_HTML: :style text-align:left On Windows, if GNU's =find= has already in your disk, and let Windows stupid =find= or =findstr= program go away. Don't =setq= =find-program= on Windows, because =dired= can not differ the cases between local and remote.
#+ATTR_HTML: :style text-align:left Now, on Windows you can use @@html:@@M-x [email protected]@html:@@ or @@html:@@M-x [email protected]@html:@@
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/find-name-dired-on-windows.png][find-name-dired]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/find-name-dired-tramp-on-windows.png][find-name-dired via tramp]]
*** compress Program
#+ATTR_HTML: :style text-align:left On Windows, there are no builtin =zip/unzip= program, but Emacs ship with =minizip= program. Although =minizip= without /recursive/ functionalities, but do some tricks with =minizip=, we can zip files and directories with =minizip=, even export =org= to =odt= [[https://en.wikipedia.org/wiki/OpenDocument][OpenDocument]]. And more [[https://www.7-zip.org/download.html][7-Zip standalone command version also be supported]].
#+REVEAL: split #+ATTR_HTML: :style text-align:left On Windows, there are logical bugs in =dired-aux.el=, We can not using =Z= key compress or uncompress file to or from =.gz= or =.7z=. The good news: if =gunzip= or =7za= installed we can do it now.
#+ATTR_HTML: :style text-align:left You can using @@html:[email protected]@html:@@ in =dired mode= compress to =.gz=, =.7z= or =*.zip=. For some ancient Emacs24-, @@html:@@! zip x.zip [email protected]@html:@@ to zip.
#+REVEAL: split #+ATTR_HTML: :style text-align:left It's headache when =default-file-name-coding-system= not equal with =locale-coding-system= specifically on Windows. Even view archived file in =arc-mode=, will display wrong encoded file names.
#+REVEAL: split
#+ATTR_HTML: :style text-align:left
On Windows, there are some encoding issues when
default-file-name-coding-system not equal locale-coding-system.
- display non-unicode encoded directory name or file name;
- insert non-unicode encoded directory;
- compress the files with with
locale-coding-systemfilenames; -
dired-do-shell-commandordired-do-async-shell-command;
#+REVEAL: split #+ATTR_HTML: :style text-align:left The good news is all those issues had gone in this kit.
#+ATTR_HTML: :style text-align:left For =.rar= archive, emacs really sucks.
- on Emacs 23.3.1, using =unrar-free= in =archive-rar-summarize= function, but on Emacs 26.1 using =lsar=, and those all had been hard coded in =arc-mode.el=.
- =7z l= output is not compatible with =lsar= and =unrar=.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-do-compress-to-zip-on-windows.png][dired-do-compress-to: zip]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-do-compress-to-7z-on-windows.png][dired-do-compress-to: 7z]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/archive-summarize-files-zip-on-windows.png][archive-summarize-files: zip]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/archive-summarize-files-7z-on-windows.png][archive-summarize-files: 7z]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/org-odt-export-to-odt-on-windows.png][org-odt-export-to-odt]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-compress-file-suffixes-version-24lt.png][dired-compress-file-suffixes]]
** Editing :PROPERTIES: :CUSTOM_ID: editing :END:
*** Mark :PROPERTIES: :CUSTOM_ID: edit-mark :END:
#+ATTR_HTML: :style text-align:left
Provides the abilities to mark /symbol/, /filename/ and /line/ in
current buffer then you can @@html:@@[email protected]@html:@@ the
marked part.
#+ATTR_HTML: :style text-align:left Using [email protected]= default mark whole Lisp /sexp/ or C /block/ at point. If prefix arg is non nil, set mark away from point then forward or backward to sexps boundary, just like the builtin =mark-sexp= does.
#+ATTR_HTML: :style text-align:left [email protected]= default mark the whole word at point. If prefix arg is non nil, set mark away from point then forward or backword to word boundary, just like the builtin =mark-word= does.
#+ATTR_HTML: :style text-align:left [email protected]= more stable in vary programming modes than `mark-defun'.
- @@html:@@C-c m [email protected]@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-symbol.png][mark symbol at point]]
- @@html:@@C-c m [email protected]@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-filename.png][mark filename at point]]
- @@html:@@[email protected]@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-word.png][mark word at point]]
- @@html:@@C-c m [email protected]@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-line.png][mark line at point]]
- @@html:@@[email protected]@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-list.png][mark sexp at point]]
- @@html:@@C-M [email protected]@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-defun.png][mark defun at point]]
*** Tags :PROPERTIES: :CUSTOM_ID: edit-tags :END:
#+ATTR_HTML: :style text-align:left Prefer =etags= program, because it works well on varied platforms. In =(emacs-home* "config/tags.el")=, there are some handy functions to create the tags for =Elisp= or =C= source code, such as =make-emacs-source-tags=, =make-system-c-tags=, =mount-tags=, and =unmount-tags=.
#+ATTR_HTML: :style text-align:left More Reasonable Emacs also supports [[http://ctags.sourceforge.net/][Exuberant Ctags]].
#+REVEAL: split Using =mount-tags= to mount the specified tags file at first order of =tags-table-list=. Or @@html:@@C-u [email protected]@html:@@ to mount tags file at the tail of =tags-table-list=. The =unmount-tags= is the inverse of =mount-tags=.
#+REVEAL: split
- =make-emacs-source-tags=: make tags for Emacs' C and Lisp source code.
- =make-dir-tags=: make tags for specified directory.
- =cc*-make-system-tags=: make system C tags.
*** Clipboard :PROPERTIES: :CUSTOM_ID: edit-clipboard :END:
#+ATTR_HTML: :style text-align:left In terminal, Emacs can not /copy to/ or /paste from/ system clipboard when on Darwin or Linux. For such cases, we need external programs to help us do the job. Now, More Reasonable Emacs integrates this functionalities, so we can use natural keys (such as @@html:@@[email protected]@html:@@, @@html:@@[email protected]@html:@@) to /copy to/ or /paste from/ system clipboard.
*** iSearch :PROPERTIES: :CUSTOM_ID: edit-isearch :END:
#+ATTR_HTML: :style text-align:left There are no uniformed [[https://www.emacswiki.org/emacs/IncrementalSearch][isearch]] functionalites among in =isearch-forward=, =isearch-backward= and =isearch-forward-symbol-at-point=. Now, in More Reasonable Emacs those functionalites unified to two functions: =isearch-forward*= and =isearch-backward*=.
#+REVEAL: split #+ATTR_HTML: :style text-align:left In More Reasonable Emacs, by default, =isearch-forward*= and =isearch-backward*= same with the built-in ones. Except we can search the text of activated region. @@html:@@[email protected]@html:@@ and @@html:@@[email protected]@html:@@ will search forward or backward just like /vi/'s @@html:@@*@@html:@@ does. And more, searching =word=, =quoted string=, or =filename= forward or backword.
*** Open line :PROPERTIES: :CUSTOM_ID: edit-open-line :END:
#+ATTR_HTML: :style text-align:left Emulates /vi/'s o and O command in Emacs, the built-in one =open-line= or =split-line= do not indent accordingly the current line. See [[https://www.emacswiki.org/emacs/OpenNextLine][Open Next Line]].
#+REVEAL: split
- @@html:@@[email protected]@html:@@ =open-next-line=
- @@html:@@[email protected]@html:@@ =open-previous-line=
*** Comment :PROPERTIES: :CUSTOM_ID: edit-comment :END:
#+ATTR_HTML: :style text-align:left =comment-line= has stupid behaviors, that why =toggle-comment= had been made.
#+REVEAL: split
*** Kill :PROPERTIES: :CUSTOM_ID: edit-kill :END:
#+ATTR_HTML: :style text-align:left =kill-whole-word= and =kill-whole-symbol= are frequently editing commands when programming.
** Keys :PROPERTIES: :CUSTOM_ID: keys :END:
#+ATTR_HTML: :style text-align:left Obey the defaults of Emacs' keymap.
*** Global keys
#+ATTR_HTML: :style text-align:left Global for all Emacs' version.
- @@html:@@M-/@@html:@@ =hippie-expand=
- @@html:@@C-c f [email protected]@html:@@ =find-file-at-point=
- @@html:@@C-c b [email protected]@html:@@ =revert-buffer=
- @@html:@@C-c b [email protected]@html:@@ =echo-buffer-file-name=
- @@html:@@[email protected]@html:@@ =open-next-line=
- @@html:@@[email protected]@html:@@ =open-previous-line=
- @@html:@@C-c m [email protected]@html:@@: [email protected]=
- @@html:@@C-c m [email protected]@html:@@: [email protected]=
- @@html:@@C-c m [email protected]@html:@@: [email protected]=
- @@html:@@C-c m [email protected]@html:@@: [email protected]= #+REVEAL: split
- @@html:@@[email protected]@html:@@: =isearch-forward*=
- @@html:@@[email protected]@html:@@: =isearch-backward*=
- @@html:@@M-s [email protected]@html:@@: =isearch-forward-symbol*=
- @@html:@@M-s [email protected]@html:@@: =isearch-forward-word*=
*** Compatible keys
#+ATTR_HTML: :style text-align:left Compatibled for ancient Emacs versions, compatible keys may not avaiabled on ancient Emacs.
- @@html:@@M-,@@html:@@ =pop-tag-mark=
- @@html:@@M-*@@html:@@ =tags-loop-continue=
- @@html:@@[email protected]@html:@@ =recenter-top-bottom=
- @@html:@@C-c b [email protected]@html:@@ =linum-mode=
- @@html:@@M-#@@html:@@ =xref-find-references=
*** Featured keys
#+ATTR_HTML: :style text-align:left The features provided by non-Emacs's packages, featured keys may not avaiabled on ancient Emacs.
- @@html:@@C-x v [email protected]@html:@@ =magit-status=
- Programming :PROPERTIES: :CUSTOM_ID: programming :END:
** Generic editing :PROPERTIES: :CUSTOM_ID: general-editing :END:
#+ATTR_HTML: :style text-align:left Just introduce More Resonable Emacs improved or extra editing features.
** Lisp programming :PROPERTIES: :CUSTOM_ID: lisp-programming :END:
#+ATTR_HTML: :style text-align:left Lisp programming in Emacs already good enough, if [[https://www.emacswiki.org/emacs/ParEdit][ParEdit]] and [[https://github.com/Malabarba/aggressive-indent-mode][aggressive-indent-mode]] installed editing Lisp code more easy.
#+ATTR_HTML: :style text-align:left [[https://github.com/slime/slime][slime]] is the best tool for Common Lisp programming. And for Scheme programming the [[http://www.nongnu.org/geiser/][Geiser]] the pretty good.
#+ATTR_HTML: :style text-align:left The [[http://www.gambitscheme.org/wiki/index.php/Main_Page][Gambit]] Scheme system is a complete, portable, efficient and reliable implementation, if you like it you can =run-gambit=.
#+ATTR_HTML: :style text-align:left The [[https://scheme.com][Chez]] Scheme system is a complete, portable, efficient and reliable implementation, if you like it you can =run-chez=.
*** Editing
*** REPL
** C programming :PROPERTIES: :CUSTOM_ID: c-programming :END:
#+ATTR_HTML: :style text-align:left Now, we are in the cycle of editing, compiling, debugging.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-editing-on-darwin-gui.png][editing on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-darwin.png][debugging via lldb on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-linux.png][debugging via lldb on Ubuntu]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-cdb-on-windows.png][debugging via cdb]]
*** Editing :PROPERTIES: :CUSTOM_ID: c-programming-editing :END:
Change C programming style using @@html:@@C-c [email protected]@html:@@.
**** View C system include :PROPERTIES: :CUSTOM_ID: c-programming-view-c-system-include :END:
#+ATTR_HTML: :style text-align:left Like /vi/'s @@html:@@gf@@html:@@ command, you can using @@html:@@C-c f [email protected]@html:@@ to open C system include file on local or remote in =view-mode= and via @@html:@@M-,@@html:@@ to go back. It supports /gcc/, /clang/, and /msvc/.
**** Macro expand :PROPERTIES: :CUSTOM_ID: c-programming-macro-expand :END:
#+ATTR_HTML: :style text-align:left Mark the code that include a macro call then @@html:@@C-c [email protected]@html:@@, you should see the expansion of the macro in =Macroexpansion=, whatever you are using /gcc/, /clang/ and /msvc/, locally or remotely.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-macro-expansion-on-windows.png][macro expansion for msvc]]
**** Dump predefined macros :PROPERTIES: :CUSTOM_ID: c-programming-dump-predefined-macros :END:
#+ATTR_HTML: :style text-align:left Dump compiler predefined macros, @@html:@@C-c #@@html:@@, you should see the predefined macros in =Predefined Macros=, whatever you are using /gcc/ and /clang/ locally or remotely.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-dump-predefined-macros.png][dump predefined macros for clang]]
*** Compiling :PROPERTIES: :CUSTOM_ID: c-programming-compiling :END:
#+ATTR_HTML: :style text-align:left Using @@html:@@M-x [email protected]@html:@@ to /build/ or /test/.
#+ATTR_HTML: :style text-align:left For /msvc/ there are need tricks to works with Emacs, More Resonable Emacs will generate a /msvc/'s host environment =cc-env.bat= for you that make life easy and if [[https://github.com/junjiemars/nore][Nore]] already on your machine, now life is perfect.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-compile-on-windows.png][compile via msvc]]
*** Debugging :PROPERTIES: :CUSTOM_ID: c-programming-debugging :END:
#+ATTR_HTML: :style text-align:left [[https://www.gnu.org/software/gdb/][gdb]], [[https://lldb.llvm.org/][lldb]] and [[https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/][cdb]] had been perfect integrated within this kit.
#+ATTR_HTML: :style display:none /screenshots/: #+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-darwin.png][debugging via lldb on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-linux.png][debugging via lldb on Ubuntu]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-cdb-on-windows.png][debugging via cdb]]
- Troubleshoting :PROPERTIES: :CUSTOM_ID: troubleshoting :END:
- @@html:@@M-x [email protected]@html:@@ then exit and reopen Emacs.
- Check Emacs configurations:
- @@html:@@M: [email protected]@html:@@
- @@html:@@M: [email protected]@html:@@
- @@html:@@M: [email protected]@html:@@
- @@html:@@M: [email protected]@html:@@ then do #1
- Check =Compilation-Log= buffer, then do #1
- Disable the problematic item in =(emacs-home* "private/self-env-spec.el")=, then do #1
- Disable the problematic item in =(emacs-home* "private/self-path.el")=, then do #1
- Mnemonic :PROPERTIES: :CUSTOM_ID: mnemonic :END:
#+ATTR_HTML: :style display:none
- [[#emacs-documents][Emacs Documents]]
- [[#motion][Motion]]
- [[#interaction][Interaction]]
- [[#editing][Editing]]
- [[#coding-system][Coding system]]
- [[#basic-sexp-commands][Basic sexp commands]]
- [[#frame][Frame]]
- [[#window][Window]]
- [[#register][Register]]
- [[#bookmark][Bookmark]]
- [[#rectangle][Rectangle]]
- [[#keyboard-macro][Keyboard Macro]]
- [[#dired][Dired]]
- [[#mnemonic-shell][Shell]]
- [[#remote][Remote]]
- [[#sort][Sort]]
- [[#face][Face]]
- [[#latex-requirements][LaTeX Requirements]]
- [[#log][Log]]
** Emacs Documents :PROPERTIES: :CUSTOM_ID: emacs-documents :END:
#+ATTR_HTML: :style text-align:left It's self-documenting and great, keep reading it frequently.
- Tutorial: @@html:@@[email protected]@html:@@
- Help for Help: @@html:@@C-h [email protected]@html:@@
- Emacs manual: @@html:@@C-h [email protected]@html:@@
- Apropos command: @@html:@@C-h [email protected]@html:@@
- Mode: @@html:@@[email protected]@html:@@ see all the key bindings and documentation of current buffer
#+REVEAL: split
- Info: @@html:@@C-h [email protected]@html:@@
- Info /file/: @@html:@@C-u C-h i @@html:@@
- Index of /topic/: @@html:@@C-h r i @@html:@@
- Info of /mode/: @@html:@@C-h i m @@html:@@
#+REVEAL: split
- Function: @@html:@@C-h [email protected]@html:@@ display documentation of the given function
- Variable: @@html:@@C-h [email protected]@html:@@ display documentation of the given variable
- Keybinding: @@html:@@C-h [email protected]@html:@@ display documentation of the function invoked by the given keystrokes
- Keybinding briefly: @@html:@@C-h [email protected]@html:@@, which command for given keystroke
#+REVEAL: split
- Prefix keybindings: press prefix keys such as @@html:@@[email protected]@html:@@ then @@html:@@[email protected]@html:@@ to see all key bindings for given prefix keystrokes
#+REVEAL: split
- Message: @@html:@@C-h [email protected]@html:@@ see the logging of echo area message
- Man: @@html:@@M-x [email protected]@html:@@ view UNIX manual page
- Woman: @@html:@@M-x [email protected]@html:@@ view UNIX manual page without =man= program
#+REVEAL: split
- Coding system: @@html:@@C-h [email protected]@html:@@ describe coding system
- Colors: @@html:@@M-x [email protected]@html:@@ display names of defined colors and show what they look like
- Syntax: @@html:@@C-h [email protected]@html:@@ describe syntax
- Where is command: @@html:@@C-h [email protected]@html:@@ which keystrokes binding to a given command
- Keystrokes: @@html:@@C-h [email protected]@html:@@ display last 100 input keystrokes
** Motion :PROPERTIES: :CUSTOM_ID: motion :END:
#+REVEAL: split
- goto line: @@html:@@M-g [email protected]@html:@@
- goto nth char: @@html:@@M-g [email protected]@html:@@
- goto next error: @@html:@@C-x `@@html:@@
- goto previous error: @@html:@@M-g [email protected]@html:@@
#+REVEAL: split
- jump between buffers: @@html:@@C-x [email protected]@html:@@, jumps to the global mark acrross buffers
- jump in buffer: @@html:@@C-u [email protected]@html:@@
- jump to definition: @@html:@@[email protected]@html:@@
- pop back to where @@html:@@M-,@@html:@@
** Interaction :PROPERTIES: :CUSTOM_ID: interaction :END:
- =scratch= buffer
- eval /Elisp/: @@html:@@M-:@@html:@@
- execute /Shell/ command: @@html:@@[email protected]@html:@@
- in Dired mode: @@html:@@[email protected]@html:@@, do shell command
- region as input to Shell command: @@html:@@M-|@@html:@@,
#+REEVAL: split
- insert from shell output: @@html:@@C-u [email protected]@html:@@
- insert from elisp output: @@html:@@C-u M-:@@html:@@
#+REVEAL: split
- find file at point: @@html:@@C-c f [email protected]@html:@@
- filename of current buffer: @@html:@@C-c b [email protected]@html:@@
#+REVAL: split
- lookup /web/ at point: @@html:@@M-s [email protected]@html:@@
- lookup /dict/ at point: @@html:@@M-s [email protected]@html:@@
#+REVAL: split
- display time: @@html:@@M-x [email protected]@html:@@
** Editing :PROPERTIES: :CUSTOM_ID: editing :END:
- write file: @@html:@@C-x [email protected]@html:@@ same as save as
- kill all spaces at point: @@html:@@[email protected]@html:@@
- kill all spaces except one at point: @@html:@@[email protected]@html:@@
- delete indentation to join line to previous line: @@html:@@M-^@@html:@@
- join next line: @@html:@@C-u 1 M-^@@html:@@
#+REVAL: split
- kill word: @@html:@@[email protected]@html:@@
- kill /whole word/: @@html:@@C-x [email protected]@html:@@, include the word that current point located.
- kill /whole symbol/: @@html:@@C-x [email protected]@html:@@, include the symbol that current point located.
- kill /line/: @@html:@@[email protected]@html:@@
- kill /whole/ line: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- dynamic abbreviation: @@html:@@M-/@@html:@@
- query replace: @@html:@@M-%@@html:@@
- upcase region: @@html:@@C-x [email protected]@html:@@
- downcase region: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- transpose characters: @@html:@@[email protected]@html:@@
- transpose words: @@html:@@[email protected]@html:@@
- transpose lines: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- insert parentheses: @@html:@@M-(@@html:@@, wrap selection in parentheses
- toggle read-only mode: @@html:@@C-x [email protected]@html:@@
- toggle input method: @@html:@@[email protected]@html:@@
- set input method: @@html:@@C-x RET [email protected]@html:@@
- describe current input method: @@html:@@C-h [email protected]@html:@@
#+REVEAL: split
- insert char: @@html:@@C-x 8 [email protected]@html:@@ GREEK SMALL LETTER LAMBDA
- what cursor position: @@html:@@C-x [email protected]@html:@@
- describe char: @@html:@@C-u C-x [email protected]@html:@@
- quoted insert: @@html:@@[email protected]@html:@@, such as page break @@html:@@C-q [email protected]@html:@@, use @@html:@@C-x [@@html:@@ to backward or @@html:@@C-x ]@@html:@@ to forward, @@html:@@C-q [email protected]@html:@@ to insert horizontal tab, @@html:@@C-q [email protected]@html:@@ to insert line feed, @@html:@@C-q [email protected]@html:@@ to insert carriage return
- check unmatched parentheses: @@html:@@M-x [email protected]@html:@@
#+REVEAL: split
- tab to space: @@html:@@M-x [email protected]@html:@@
- space to tab: @@html:@@M-x [email protected]@html:@@
- fill paragraph: @@html:@@M [email protected]@html:@@
- redo after undo: @@html:@@[email protected]@html:@@ and then @@html:@@C-x [email protected]@html:@@
- cancel: @@html:@@C-]@@html:@@, or @@html:@@M-x [email protected]@html:@@
#+REVEAL: split
- open new line before current: @@html:@@[email protected]@html:@@
- remove all but one empty line: @@html:@@C-x [email protected]@html:@@
- delete entire line: @@html:@@[email protected]@html:@@
- delete to end of sentence: @@html:@@[email protected]@html:@@
- insert char: @@html:@@C-x 8 [email protected]@html:@@
- count lines, words or characters of select region: @@html:@@[email protected]@html:@@
- count lines on current page: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- toggle comment the current line or region: @@html:@@C-x M-;@@html:@@. =toggle-comment= more better than sucked =comment-line=.
- insert or realign comment on current line: @@html:@@M-;@@html:@@
- kill comment on current line: @@html:@@C-u M-;@@html:@@
- indent and continuing comment: @@html:@@[email protected]@html:@@
** Coding system :PROPERTIES: :CUSTOM_ID: coding-system :END:
#+REVEAL: split
- check current buffer coding system: @@html:@@C-x RET [email protected]@html:@@
- revert current buffer's coding system: @@html:@@C-x RET [email protected]@html:@@
- specify coding system for the current buffer: @@html:@@C-x RET [email protected]@html:@@ #+REVEAL: split
- specify coding system for terminal output: @@html:@@C-x RET [email protected]@html:@@
- specify coding system for keyboard input: @@html:@@C-x RET [email protected]@html:@@
- specify coding system for the immediately following command: @@html:@@C-x RET [email protected]@html:@@ #+REVEAL: split
- specify input and output coding systems for subprocess: @@html:@@C-x RET [email protected]@html:@@
- specify coding system for transferring selections to and from other programs through the window system: @@html:@@C-x RET [email protected]@html:@@
- specify coding system for transferring one selection to or from the window system: @@html:@@C-x RET [email protected]@html:@@
** Basic sexp commands :PROPERTIES: :CUSTOM_ID: basic-sexp-commands :END:
- =forward-sexp=: @@html:@@[email protected]@html:@@
- =backward-sexp=: @@html:@@[email protected]@html:@@
- =kill-sexp=: @@html:@@[email protected]@html:@@, delete forward one sexp
- =transpose-sexp=: @@html:@@[email protected]@html:@@
- =backward-up-list=: @@html:@@[email protected]@html:@@, move up out of an sexp
- =down-list=: @@html:@@[email protected]@html:@@, move down into a nested sexp
- =backward-list=: @@html:@@[email protected]@html:@@, match parentheses backward
- =pp-eval-last-sexp=: pretty print
** Frame :PROPERTIES: :CUSTOM_ID: frame :END:
- find file other frame: @@html:@@C-x 5 [email protected]@html:@@, or @@html:@@C-x 5 [email protected]@html:@@
- display buffer other frame: @@html:@@C-x 5 [email protected]@html:@@, or @@html:@@C-x 5 [email protected]@html:@@
- find tag other frame: @@html:@@C-x 5 [email protected]@html:@@
- delete frame: @@html:@@C-x 5 [email protected]@html:@@
- delete other frames: @@html:@@C-x 5 [email protected]@html:@@
- make frame command: @@html:@@C-x 5 [email protected]@html:@@
- dired to other frame: @@html:@@C-x 5 [email protected]@html:@@
- other frame: @@html:@@C-x 5 [email protected]@html:@@
- find file read only other frame: @@html:@@C-x 5 [email protected]@html:@@
** Window :PROPERTIES: :CUSTOM_ID: window :END:
#+REVEAL: split
- /find/ file: @@html:@@C-x [email protected]@html:@@
- /view/ file: @@html:@@C-x [email protected]@html:@@
- /write/ file: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- save /current/ buffer: @@html:@@C-x [email protected]@html:@@
- save all /modified/ buffers: @@html:@@C-u C-x [email protected]@html:@@
- save and /backup/ current buffer: @@html:@@C-x [email protected]@html:@@
#+REVEAL: split
- kill a buffer: @@html:@@C-x [email protected]@html:@@
- other window: @@html:@@C-x [email protected]@html:@@
- dired other window: @@html:@@C-x 4 [email protected]@html:@@
- find file in other window: @@html:@@C-x 4 [email protected]@html:@@, or @@html:@@C-x 4 [email protected]@html:@@
#+REVEAL: split
- display buffer: @@html:@@C-x 4 [email protected]@html:@@, display the buffer in another window
- find tag other window: @@html:@@C-x 4 [email protected]@html:@@
- kill buffer and window: @@html:@@C-x 4 [email protected]@html:@@, just like @@html:@@C-x [email protected]@html:@@ except kill the buffer
#+REVEAL: split
- switch to buffer other window: @@html:@@C-x 4 [email protected]@html:@@
- clone indirect buffer other window: @@html:@@C-x 4 [email protected]@html:@@, clone the buffer in another window
- recenter the screen at cursor: @@html:@@[email protected]@html:@@
- center the screen at the top: @@html:@@C-u 0 [email protected]@html:@@
- recenter the screen at the bottom: @@html:@@C-u - [email protected]@html:@@
** Register :PROPERTIES: :CUSTOM_ID: register :END:
#+ATTR_HTML: :style text-align:left
- store /window/ configuration to register: @@html:@@C-x r w @@html:@@, but the configuration cannot accross sessions.
- store /frame/ configuration to register: @@html:@@C-x r f @@html:@@
- store /region/ into register: @@html:@@C-x r s @@html:@@
- store current /point/ in register: @@html:@@C-x r SPC @@html:@@
#+REVEAL: split
- /jump to/ register: @@html:@@C-x r j @@html:@@
- /insert from/ register: @@html:@@C-x r i @@html:@@
- /view/ the content of register: @@html:@@M-x view-register @@html:@@
** Bookmark :PROPERTIES: :CUSTOM_ID: bookmark :END:
#+ATTR_HTML: :style text-align:left Unlike registers, bookmarks have long names, and they persist automatically from one Emacs session to the next.
- set bookmark: @@html:@@C-x r [email protected]@html:@@
- set named bookmark: @@html:@@C-x r m [email protected]@html:@@
- jump to bookmark: @@html:@@C-x r b [email protected]@html:@@
- list all bookmarks: @@html:@@C-x r [email protected]@html:@@
- save bookmark to file: @@html:@@M-x [email protected]@html:@@
** Rectangle :PROPERTIES: :CUSTOM_ID: rectangle :END:
- /kill/ rectangle: @@html:@@C-x r [email protected]@html:@@
- /delete/ rectangle: @@html:@@C-x r [email protected]@html:@@
- /yank/ rectangle: @@html:@@C-x r [email protected]@html:@@
- /open/ rectangle: @@html:@@C-x r [email protected]@html:@@, insert blank /space/ to fill the space of the region-rectangle
- /clear/ rectangle: @@html:@@C-x r [email protected]@html:@@
#+REVEAL: split
- /replace/ rectangle: @@html:@@C-x r [email protected]@html:@@
- /string insert/ rectangle: @@html:@@C-x r [email protected]@html:@@
- /numbers insert/ rectangle: @@html:@@C-x r [email protected]@html:@@
#+REVAL: split
- select entire buffer: @@html:@@C-x [email protected]@html:@@
- select page: @@html:@@C-x [email protected]@html:@@
- exchange cursor position and mark: @@html:@@C-x [email protected]@html:@@
** Keyboard Macro :PROPERTIES: :CUSTOM_ID: keyboard-macro :END:
- /start/ recording macro: @@html:@@C-x (@@html:@@
- /stop/ recording macro: @@html:@@C-x )@@html:@@
- /playback/ macro: @@html:@@C-x [email protected]@html:@@
- apply macro to /region/: @@html:@@C-x C-k [email protected]@html:@@
- /edit/ last marcro: @@html:@@C-x C-k [email protected]@html:@@
- /bind/ the most recent macro to a key: @@html:@@C-x C-k b [1-9A-Z]@@html:@@
** Dired :PROPERTIES: :CUSTOM_ID: dired :END:
#+REVEAL: split
- hide details: @@html:@@(@@html:@@
- change marks: @@html:@@* c @@html:@@
- toggle readonly: @@html:@@C-x [email protected]@html:@@
- finish edit: @@html:@@C-c [email protected]@html:@@
- abort editing: @@html:@@C-c [email protected]@html:@@
#+REVEAL: split
- browse file: @@html:@@b@@html:@@
- echo current directory: @@html:@@[email protected]@html:@@
- hex edit file: @html:@@f@@html:@@
#+REVEAL: split
- /find/ regexp recusive: @@html:@@[email protected]@html:@@
- /replace/ regexp recusive: @@html:@@[email protected]@html:@@
** Regexp :PROPERTIES: :CUSTOM_ID: regexp :END:
- regexp builder: @@html:@@M-x [email protected]@html:@@
** Shell :PROPERTIES: :CUSTOM_ID: mnemonic-shell :END:
- EShell: @@html:@@M-x [email protected]@html:@@
- Shell: @@html:@@M-x [email protected]@html:@@
- Ansi-Term: @@html:@@M-x [email protected]@html:@@
#+REVAL: split
- interrupt process in =eshell=: @@html:@@C-c [email protected]@html:@@
- interrupt process in =shell=: @@html:@@C-c [email protected]@html:@@
- interrupt process in =ansi-term=: @@html:@@C-x [email protected]@html:@@
** Remote :PROPERTIES: :CUSTOM_ID: remote :END:
#+ATTR_HTML: :style text-align:left It's the duty of [[https://www.gnu.org/software/tramp/][TRAMP]].
- non-sudo: @@html:@@C-x C-f /ssh:[email protected]:/path/to/[email protected]@html:@@, such as [email protected]= or =user= in .ssh/config entries.
- sudo /remote/: @@html:@@C-x C-f /ssh:user|sudo::/path/to/[email protected]@html:@@
- sudo /localhost/: @@html:@@C-x C-f /sudo::/path/to/[email protected]@html:@@ #+REVEAL: split
- eshell remote: @@html:@@cd /ssh:[email protected]:/path/to/[email protected]@html:@@
- on Windows use =~/.ssh/config=: use =/sshx:= instead, such as @@html:@@/sshx:[email protected]:/path/to/[email protected]@html:@@
** Sort :PROPERTIES: :CUSTOM_ID: sort :END:
- sort /fields/: @@html:@@C-c s [email protected]@html:@@ by Nth field
- sort /lines/: @@html:@@C-c s [email protected]@html:@@
- /reverse/ region: @@html:@@C-c s [email protected]@html:@@
** Face :PROPERTIES: :CUSTOM_ID: face :END:
- describe the face at point: @@html:@@M-x [email protected]@html:@@
#+ATTR_HTML: :style text-align:left *** Text scale
- reset face height: @@html:@@C-x [email protected]@html:@@
- increase face height: @@html:@@C-x [email protected]@html:@@
- decrease face height: @@html:@@C-x [email protected]@html:@@
** LaTeX Requirements :PROPERTIES: :CUSTOM_ID: latex-requirements :END:
*** On Darwin
- [[https://www.imagemagick.org/][ImageMagick]]
- texlive-basic
- texlive-fonts-recommended
- texlive-latex-extra
- texlive-latex-recommended
- texlive-pictures
- texlive-plain-generic
- texlive-lang-cjk
*** On Ubuntu
- [[https://www.imagemagick.org/][ImageMagick]]
- [[https://www.tug.org/texlive/][texlive]]
- texlive-latex-extra: additional packages.
- texlive-lang-cjk: supporting a combination of Chinese, Japanese, Korean, including macros, fonts, documentation.
- texlive-xetex
*** On Windows
- [[https://www.imagemagick.org/][ImageMagick]]
- MiKTex
** Log :PROPERTIES: :CUSTOM_ID: log :END:
- =tail -f=: @@html:@@M-x [email protected]@html:@@
- toggle highlighting of the current line: @@html:@@M-x [email protected]@html:@@
- /narrow/ region: @@html:@@C-x n [email protected]@html:@@
- /widen/ region: @@html:@@C-x n [email protected]@html:@@
- Issues?
If you have issues, just post it.