add help function, moving readme help content to help function
This commit is contained in:
41
README.md
41
README.md
@@ -39,11 +39,7 @@ installed linux packages as requirements inside `sripts/install.sh`.
|
|||||||
|
|
||||||
General key bindings and functions
|
General key bindings and functions
|
||||||
|
|
||||||
- `M->` (`end-of-buffer`)
|
|
||||||
- `M-<` (`begin-of-buffer`)
|
|
||||||
- `C-x b` (`counsel-switch-buffer`)
|
|
||||||
- `C-x |` (`toggle-window-split`) toggle horizontal/vertical of 2 window split
|
- `C-x |` (`toggle-window-split`) toggle horizontal/vertical of 2 window split
|
||||||
- `C-x h` (`mark-whole-buffer`)
|
|
||||||
- `C-x TAB` (`indent-rigidly`) indent lines in the region
|
- `C-x TAB` (`indent-rigidly`) indent lines in the region
|
||||||
- `C-r` (`query-replace-regexp`) replace text
|
- `C-r` (`query-replace-regexp`) replace text
|
||||||
- `M-<up>` (`move-line-up`)
|
- `M-<up>` (`move-line-up`)
|
||||||
@@ -51,12 +47,6 @@ General key bindings and functions
|
|||||||
- `C-x RET f` (`set-buffer-file-coding-system`) e.g. set to =utf-8
|
- `C-x RET f` (`set-buffer-file-coding-system`) e.g. set to =utf-8
|
||||||
- (`decode-coding-region`) e.g. decode to `utf-8` (郭富城Aaron Kwok)
|
- (`decode-coding-region`) e.g. decode to `utf-8` (郭富城Aaron Kwok)
|
||||||
- (`diff-buffer-with-file`) show a diff between buffer (current state) and file (saved state)
|
- (`diff-buffer-with-file`) show a diff between buffer (current state) and file (saved state)
|
||||||
- `C-h f` (`helpful-callable`)
|
|
||||||
- `C-h v` (`helpful-variable`)
|
|
||||||
- `mouse-6` scroll right
|
|
||||||
- `mouse-7` scroll left
|
|
||||||
- `mouse-8` (`previous-buffer`)
|
|
||||||
- `mouse-9` (`next-buffer`)
|
|
||||||
|
|
||||||
Spelling (flyspell ispell) bindings and functions
|
Spelling (flyspell ispell) bindings and functions
|
||||||
|
|
||||||
@@ -69,27 +59,6 @@ Spelling (flyspell ispell) bindings and functions
|
|||||||
|
|
||||||
## Org
|
## Org
|
||||||
|
|
||||||
Org key bindings and functions
|
|
||||||
|
|
||||||
- `C-c |` (`org-table-create-or-convert-from-region`) convert seperator 1. TAB, 2. comma, 3. space
|
|
||||||
- `C-u C-c |` (`org-table-create-or-convert-from-region`) convert using comma (CSV) seperator
|
|
||||||
- `C-u C-u C-c |` (`org-table-create-or-convert-from-region`) convert using TAB
|
|
||||||
- `C-u <integer> C-c |` (`org-table-create-or-convert-from-region`) convert using N spaces
|
|
||||||
- `C-u REGEX C-c |` (`org-table-create-or-convert-from-region`) convert using regex to match seperator
|
|
||||||
- `C-c C-x \` (`org-toggle-pretty-entries`) e.g. displays `\pm` as ±
|
|
||||||
|
|
||||||
Org table
|
|
||||||
|
|
||||||
- `S-<right>` (`org-shiftright`) move cell right
|
|
||||||
- `S-<left>` (`org-shiftleft`) move cell left
|
|
||||||
- `S-<up>` (`org-shiftup`) move cell up
|
|
||||||
- `S-<down>` (`org-shiftdown`) move cell down
|
|
||||||
- (`org-table-blank-field`) clear cell
|
|
||||||
|
|
||||||
Org src block
|
|
||||||
|
|
||||||
- `C-c C-v t` (`org-babel-tangle`) create a file with the content of the block; use in `header:` `:tangle filename`
|
|
||||||
|
|
||||||
Org export
|
Org export
|
||||||
|
|
||||||
- `<f5>` (`my-org-export-html`)
|
- `<f5>` (`my-org-export-html`)
|
||||||
@@ -103,16 +72,6 @@ Org export
|
|||||||
- `C-c C-e l a` (`my-org-article-latex-export-to-pdf`) PDF-article file, see also Article export
|
- `C-c C-e l a` (`my-org-article-latex-export-to-pdf`) PDF-article file, see also Article export
|
||||||
- `C-c C-e l t` (`my-org-article-latex-export-to-letter`) PDF-letter file
|
- `C-c C-e l t` (`my-org-article-latex-export-to-letter`) PDF-letter file
|
||||||
|
|
||||||
**Important**
|
|
||||||
|
|
||||||
- For **Gnuplot** source blocks: Do not use `%` inside Gnuplot source
|
|
||||||
block but `\%` or in format command `\%%`
|
|
||||||
- % starts a comment in LaTeX and therefore stops further
|
|
||||||
interpretations like a closing bracket `}` etc.
|
|
||||||
- Gnuplot graphics are imported as .tex (text, axis, legend) and
|
|
||||||
.eps (figure) files.
|
|
||||||
- `\%` `\%%` can also be used for HTML SVG export
|
|
||||||
|
|
||||||
|
|
||||||
<a id="export-article"></a>
|
<a id="export-article"></a>
|
||||||
|
|
||||||
|
|||||||
37
README.org
37
README.org
@@ -26,11 +26,7 @@ installed linux packages as requirements inside =sripts/install.sh=.
|
|||||||
:CUSTOM_ID: packages
|
:CUSTOM_ID: packages
|
||||||
:END:
|
:END:
|
||||||
General key bindings and functions
|
General key bindings and functions
|
||||||
- =M->= (=end-of-buffer=)
|
|
||||||
- =M-<= (=begin-of-buffer=)
|
|
||||||
- =C-x b= (=counsel-switch-buffer=)
|
|
||||||
- =C-x |= (=toggle-window-split=) toggle horizontal/vertical of 2 window split
|
- =C-x |= (=toggle-window-split=) toggle horizontal/vertical of 2 window split
|
||||||
- =C-x h= (=mark-whole-buffer=)
|
|
||||||
- =C-x TAB= (=indent-rigidly=) indent lines in the region
|
- =C-x TAB= (=indent-rigidly=) indent lines in the region
|
||||||
- =C-r= (=query-replace-regexp=) replace text
|
- =C-r= (=query-replace-regexp=) replace text
|
||||||
- =M-<up>= (=move-line-up=)
|
- =M-<up>= (=move-line-up=)
|
||||||
@@ -38,12 +34,6 @@ General key bindings and functions
|
|||||||
- =C-x RET f= (=set-buffer-file-coding-system=) e.g. set to =utf-8
|
- =C-x RET f= (=set-buffer-file-coding-system=) e.g. set to =utf-8
|
||||||
- (=decode-coding-region=) e.g. decode to =utf-8= (郭富城Aaron Kwok)
|
- (=decode-coding-region=) e.g. decode to =utf-8= (郭富城Aaron Kwok)
|
||||||
- (=diff-buffer-with-file=) show a diff between buffer (current state) and file (saved state)
|
- (=diff-buffer-with-file=) show a diff between buffer (current state) and file (saved state)
|
||||||
- =C-h f= (=helpful-callable=)
|
|
||||||
- =C-h v= (=helpful-variable=)
|
|
||||||
- =mouse-6= scroll right
|
|
||||||
- =mouse-7= scroll left
|
|
||||||
- =mouse-8= (=previous-buffer=)
|
|
||||||
- =mouse-9= (=next-buffer=)
|
|
||||||
|
|
||||||
Spelling (flyspell ispell) bindings and functions
|
Spelling (flyspell ispell) bindings and functions
|
||||||
- (=flyspell-mode=) toggle spelling
|
- (=flyspell-mode=) toggle spelling
|
||||||
@@ -54,24 +44,6 @@ Spelling (flyspell ispell) bindings and functions
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: org
|
:CUSTOM_ID: org
|
||||||
:END:
|
:END:
|
||||||
Org key bindings and functions
|
|
||||||
- =C-c |= (=org-table-create-or-convert-from-region=) convert seperator 1. TAB, 2. comma, 3. space
|
|
||||||
- =C-u C-c |= (=org-table-create-or-convert-from-region=) convert using comma (CSV) seperator
|
|
||||||
- =C-u C-u C-c |= (=org-table-create-or-convert-from-region=) convert using TAB
|
|
||||||
- =C-u <integer> C-c |= (=org-table-create-or-convert-from-region=) convert using N spaces
|
|
||||||
- =C-u REGEX C-c |= (=org-table-create-or-convert-from-region=) convert using regex to match seperator
|
|
||||||
- =C-c C-x \= (=org-toggle-pretty-entries=) e.g. displays =\pm= as ±
|
|
||||||
|
|
||||||
Org table
|
|
||||||
- =S-<right>= (=org-shiftright=) move cell right
|
|
||||||
- =S-<left>= (=org-shiftleft=) move cell left
|
|
||||||
- =S-<up>= (=org-shiftup=) move cell up
|
|
||||||
- =S-<down>= (=org-shiftdown=) move cell down
|
|
||||||
- (=org-table-blank-field=) clear cell
|
|
||||||
|
|
||||||
Org src block
|
|
||||||
- =C-c C-v t= (=org-babel-tangle=) create a file with the content of the block; use in =header:= =:tangle filename=
|
|
||||||
|
|
||||||
Org export
|
Org export
|
||||||
- =<f5>= (=my-org-export-html=)
|
- =<f5>= (=my-org-export-html=)
|
||||||
- =<f6>= (=my-org-export-pdf=)
|
- =<f6>= (=my-org-export-pdf=)
|
||||||
@@ -84,15 +56,6 @@ Org export
|
|||||||
- =C-c C-e l a= (=my-org-article-latex-export-to-pdf=) PDF-article file, see also Article export
|
- =C-c C-e l a= (=my-org-article-latex-export-to-pdf=) PDF-article file, see also Article export
|
||||||
- =C-c C-e l t= (=my-org-article-latex-export-to-letter=) PDF-letter file
|
- =C-c C-e l t= (=my-org-article-latex-export-to-letter=) PDF-letter file
|
||||||
|
|
||||||
*Important*
|
|
||||||
- For *Gnuplot* source blocks: Do not use =%= inside Gnuplot source
|
|
||||||
block but =\%= or in format command =\%%=
|
|
||||||
- % starts a comment in LaTeX and therefore stops further
|
|
||||||
interpretations like a closing bracket =}= etc.
|
|
||||||
- Gnuplot graphics are imported as .tex (text, axis, legend) and
|
|
||||||
.eps (figure) files.
|
|
||||||
- =\%= =\%%= can also be used for HTML SVG export
|
|
||||||
|
|
||||||
*** Template for an article export (HTML and LaTeX)
|
*** Template for an article export (HTML and LaTeX)
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: export-article
|
:CUSTOM_ID: export-article
|
||||||
|
|||||||
@@ -26,6 +26,82 @@
|
|||||||
:prefix "my-"
|
:prefix "my-"
|
||||||
:group 'emacs)
|
:group 'emacs)
|
||||||
|
|
||||||
|
(defun my-help ()
|
||||||
|
"Display help"
|
||||||
|
(interactive)
|
||||||
|
(let ((buffer-name "*Quick Help*"))
|
||||||
|
(with-current-buffer (get-buffer-create buffer-name)
|
||||||
|
(define-derived-mode my-org-help-mode org-mode "Org help mode"
|
||||||
|
"Major mode for help buffers using Org mode")
|
||||||
|
(insert "\
|
||||||
|
|
||||||
|
*General Commands* /S: shift, C: control, M: alt or ⌘/
|
||||||
|
|
||||||
|
[[save-buffer][Save]] ............... =[C-x]= =[C-s]= Help ..................... =[C-h]=
|
||||||
|
[[write-file][Save as]] ............ =[C-x]= =[C-w]= [[keyboard-quit][Cancel]] ................... =[C-g]=
|
||||||
|
[[find-file][Open file]] .......... =[C-x]= =[C-f]= [[undo][Undo]] ..................... =[C-/]=
|
||||||
|
[[counsel-recentf][Open recent]] ........ =[C-x]= =[C-r]= [[kill-buffer][Close buffer]] ......... =[C-x]= =[k]=
|
||||||
|
[[dired][Browse directory]] ..... =[C-x]= =[d]= [[counsel-switch-buffer][Switch buffer]] ........ =[C-x]= =[b]=
|
||||||
|
[[previous-buffer][Previous buffer]] ... =[C-x]= =[left]= [[next-buffer][Next buffer]] ...... =[C-x]= =[right]=
|
||||||
|
[[save-buffers-kill-terminal][Quit]] ............... =[C-x]= =[C-c]=
|
||||||
|
|
||||||
|
[[swiper][Search]] ................... =[C-s]= [[goto-line][Go to line]] ......... =[M-g]= =[M-g]=
|
||||||
|
Replace .................. =[M-%]= Execute .................. =[M-x]=
|
||||||
|
[[begin-of-buffer][Begin of buffer]] .......... =[M-<]= [[end-of-buffer][End of buffer]] ............ =[M->]=
|
||||||
|
[[beginning-of-line][Begin of line]] ............ =[C-a]= [[end-of-line][End of line]] .............. =[C-e]=
|
||||||
|
|
||||||
|
Mark ................... =[C-spc]= Copy from mark............ =[M-w]=
|
||||||
|
Kill from mark............ =[C-w]= Kill from cursor.......... =[C-k]=
|
||||||
|
[[yank][Paste]] .................... =[C-y]= Paste older .............. =[M-y]=
|
||||||
|
[[mark-whole-buffer][Mark whole buffer]] .... =[C-x]= =[h]=
|
||||||
|
/[[info:emacs#Key%2520Bindings][Other key bindings]]/
|
||||||
|
|
||||||
|
*Mouse*
|
||||||
|
|
||||||
|
Scroll right ......... =[mouse-6]= Scroll left .......... =[mouse-7]=
|
||||||
|
[[previous-buffer][Previous buffer]] ...... =[mouse-8]= [[next-buffer][Next buffer]] .......... =[mouse-9]=
|
||||||
|
|
||||||
|
|
||||||
|
*Org*
|
||||||
|
|
||||||
|
[[org-toggle-pretty-entities][Pretty entities]] (\\xyz to UTF8 char) ................ =[C-c]= =[C-x]= =[\\]=
|
||||||
|
|
||||||
|
/TABLE/
|
||||||
|
[[org-shiftleft][Move cell left]] ........ =[S-left]= [[org-shiftright][Move cell right]] ....... =[S-right]=
|
||||||
|
[[org-shiftup][Move cell up]] ............ =[S-up]= [[org-shiftdown][Move cell down]] ......... =[S-down]=
|
||||||
|
[[org-table-blank-field][Clear cell]] ............. =[space]=
|
||||||
|
|
||||||
|
[[org-table-create-or-convert-from-region][Convert]] seperator (1. tab, 2. comma, 3. space) ........... =[C-c]= =[|]=
|
||||||
|
[[org-table-create-or-convert-from-region][Convert]] using comma separator ...................... =[C-u]= =[C-c]= =[|]=
|
||||||
|
[[org-table-create-or-convert-from-region][Convert]] using tab separator .................. =[C-u]= =[C-u]= =[C-c]= =[|]=
|
||||||
|
[[org-table-create-or-convert-from-region][Convert]] using N spaces separator ........... =[C-u]= =INTEGER= =[C-c]= =[|]=
|
||||||
|
[[org-table-create-or-convert-from-region][Convert]] using regex to match separator ....... =[C-u]= =REGEX= =[C-c]= =[|]=
|
||||||
|
|
||||||
|
/SRC/
|
||||||
|
[[org-babel-tangle][write src block to file]] (=:tangle filename=) ......... =[C-c]= =[C-v]= =[t]=
|
||||||
|
|
||||||
|
For *Gnuplot* source blocks: Do not use =%= but =\\%= or in a format
|
||||||
|
command =\\%%=
|
||||||
|
- =%= starts a comment in LaTeX and therefore stops further
|
||||||
|
interpretations like a closing bracket =}= etc.
|
||||||
|
- Gnuplot graphics are imported as .tex (text, axis, legend) and
|
||||||
|
.eps (figure) files.
|
||||||
|
- =\\%= and =\\%%= can also be used for HTML SVG export
|
||||||
|
|
||||||
|
[[elisp:(my-org-article-help)][Article]] help
|
||||||
|
|
||||||
|
")
|
||||||
|
(my-org-help-mode)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(local-set-key (kbd "q") 'kill-buffer-and-window)
|
||||||
|
(local-set-key (kbd "C-g") 'kill-buffer-and-window)
|
||||||
|
(not-modified)
|
||||||
|
(read-only-mode))
|
||||||
|
(pop-to-buffer buffer-name '((display-buffer-below-selected)
|
||||||
|
(window-parameters . ((no-other-window . nil)))
|
||||||
|
(window-height . fit-window-to-buffer)))
|
||||||
|
(message "C-g - Quit, q - Quit")))
|
||||||
|
|
||||||
(defun my-eval-string (string)
|
(defun my-eval-string (string)
|
||||||
"Evaluate elisp code stored in a string."
|
"Evaluate elisp code stored in a string."
|
||||||
(eval (car (read-from-string (format "(progn %s)" string)))))
|
(eval (car (read-from-string (format "(progn %s)" string)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user