454 lines
11 KiB
Markdown
454 lines
11 KiB
Markdown
|
|
# Table of Contents
|
|
|
|
1. [Installation](#installation)
|
|
2. [Packages](#packages)
|
|
1. [Org](#org)
|
|
2. [Multiple cursors](#multiple-cursors)
|
|
3. [Other packages](#other-packages)
|
|
3. [Information](#information)
|
|
4. [Errors](#errors)
|
|
5. [TODOs](#todos)
|
|
|
|
This is an ongoing evolution of Emacs configuration files, inspired by
|
|
a bunch of online resources.
|
|
|
|
|
|
<a id="installation"></a>
|
|
|
|
# Installation
|
|
|
|
Run one of the following install script commands (using curl, wget or fetch).
|
|
|
|
sh -c "$(curl -fsSL http://gogs.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
|
sh -c "$(wget -O- http://gogs.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
|
sh -c "$(fetch -o - http://gogs.weseng.de/daniel/emacs/raw/master/scripts/install.sh)"
|
|
|
|
Installation path is `~/.config/emacs`. See details and other
|
|
installed linux packages as requirements inside `sripts/install.sh`.
|
|
|
|
|
|
<a id="packages"></a>
|
|
|
|
# Packages
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
<caption class="t-above"><span class="table-number">Table 1:</span> General key bindings and functions</caption>
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left">M-></td>
|
|
<td class="org-left">end-of-buffer</td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">M-<</td>
|
|
<td class="org-left">beginning-of-buffer</td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-x h</td>
|
|
<td class="org-left">mark-whole-buffer</td>
|
|
<td class="org-left">mark the whole buffer</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-x TAB</td>
|
|
<td class="org-left">indent-rigidly</td>
|
|
<td class="org-left">indent selected region</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-x RET f</td>
|
|
<td class="org-left">set-buffer-file-coding-system</td>
|
|
<td class="org-left">e. g. set to utf-8</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">decode-coding-region</td>
|
|
<td class="org-left">e. g. decode to utf-8 (郭富城Aaron Kwok)</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">diff-buffer-with-file</td>
|
|
<td class="org-left">show a diff between buffer and file</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-h v</td>
|
|
<td class="org-left">counsel-describe-variable</td>
|
|
<td class="org-left">help text of variable</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-h f</td>
|
|
<td class="org-left">counsel-describe-funtion</td>
|
|
<td class="org-left">help text of function</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-r</td>
|
|
<td class="org-left">query-replace-regexp</td>
|
|
<td class="org-left">replace text. (former isearch-backward)</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-x C-b</td>
|
|
<td class="org-left">ibuffer</td>
|
|
<td class="org-left">list buffers (former list-buffers)</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-x |</td>
|
|
<td class="org-left">toggle-window-split</td>
|
|
<td class="org-left">toggle horizontal/vertical 2 window split</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">M-up</td>
|
|
<td class="org-left">move-line-up</td>
|
|
<td class="org-left">move current line up</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">M-down</td>
|
|
<td class="org-left">move-line-down</td>
|
|
<td class="org-left">move current line down</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">mouse-6</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">scroll right</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">mouse-7</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">scroll left</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">mouse-8</td>
|
|
<td class="org-left">previous-buffer</td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">mouse-9</td>
|
|
<td class="org-left">next-buffer</td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<a id="org"></a>
|
|
|
|
## Org
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
<caption class="t-above"><span class="table-number">Table 2:</span> Org key bindings and functions</caption>
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left">C-c |</td>
|
|
<td class="org-left">org-table-create-or-convert-from-region</td>
|
|
<td class="org-left">convert seperator 1. TAB, 2. comma, 3. space</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-u C-c |</td>
|
|
<td class="org-left">org-table-create-or-convert-from-region</td>
|
|
<td class="org-left">convert using comma (CSV) seperator</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-u C-u C-c |</td>
|
|
<td class="org-left">org-table-create-or-convert-from-region</td>
|
|
<td class="org-left">convert using TAB</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-u N C-c |</td>
|
|
<td class="org-left">org-table-create-or-convert-from-region</td>
|
|
<td class="org-left">convert using N spaces</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-u REGEX C-c |</td>
|
|
<td class="org-left">org-table-create-or-convert-from-region</td>
|
|
<td class="org-left">convert using regex to match seperator</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-c C-x \</td>
|
|
<td class="org-left">org-toggle-pretty-entries</td>
|
|
<td class="org-left">e. g. displays <code>\pm</code> as ±</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">Org table</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">S-right</td>
|
|
<td class="org-left">org-shiftright</td>
|
|
<td class="org-left">move a single cell right</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">S-left</td>
|
|
<td class="org-left">org-shiftleft</td>
|
|
<td class="org-left">move a single cell left</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-c SPC</td>
|
|
<td class="org-left">org-table-blank-field</td>
|
|
<td class="org-left">clear cell</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">Org src block</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-c C-v t</td>
|
|
<td class="org-left">org-babel-tangle</td>
|
|
<td class="org-left">create a file with the content of the block, use in header: :tangle filename</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">Org export</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left"> </td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">f5</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">in org export to html</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">f6</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">in org export to LaTeX</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
**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
|
|
|
|
Links
|
|
|
|
- <https://tex.stackexchange.com/questions/167583/include-custom-file-into-header-with-org-mode/201674>
|
|
- <https://orgmode.org/manual/LaTeX-specific-export-settings.html>
|
|
|
|
|
|
<a id="multiple-cursors"></a>
|
|
|
|
## Multiple cursors
|
|
|
|
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
|
<caption class="t-above"><span class="table-number">Table 3:</span> Multiple cursors key bindings and functions</caption>
|
|
|
|
<colgroup>
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
|
|
<col class="org-left" />
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="org-left">M-m s m a</td>
|
|
<td class="org-left">mc/mark-all-dwim</td>
|
|
<td class="org-left">try to mark all at point</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-v</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">jump to next cursor</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">M-v</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">jump to previous cursor</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="org-left">C-’</td>
|
|
<td class="org-left"> </td>
|
|
<td class="org-left">hide/unhide lines without a cursor</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<a id="other-packages"></a>
|
|
|
|
## Other packages
|
|
|
|
- **rainbow-mode.el:** <https://elpa.gnu.org/packages/rainbow-mode.html>
|
|
rainbow-mode is a minor mode for Emacs which displays strings representing
|
|
colors with the color they represent as background.
|
|
|
|
|
|
<a id="information"></a>
|
|
|
|
# Information
|
|
|
|
Interlock symlinks and auto-save files.
|
|
Be aware that symbolic links of the form “.#\*” are not auto-save files
|
|
but interlocks to prevent the simultaneous editing of the same
|
|
file. See [Interlocking](https://www.emacswiki.org/info-ref?find=Interlocking) in the [EmacsManual](https://www.emacswiki.org/emacs/EmacsManual) for details.
|
|
|
|
|
|
<a id="errors"></a>
|
|
|
|
# Errors
|
|
|
|
- failed execution of bibtex2html
|
|
- see bib2htmlxxxxxx.blg for errors, e.g.
|
|
- I couldn’t open style file acmu.bst
|
|
- copy/merge the texmf directory into your home directory.
|
|
- when using this in an Org mode buffer:
|
|
`#+HEADER: :fit yes :imagemagick yes :iminoptions -density 300`
|
|
- can leads to:
|
|
- ``convert: attempt to perform an operation not allowed by the security policy `gs' @ error/delegate.c/ExternalDelegateCommand/378.``
|
|
- ``convert: no images defined `DESY_logo_tikz.png' @ error/convert.c/ConvertImageCommand/3282.``
|
|
- edit `/etc/ImageMagick-7/policy.xml` and comment out
|
|
- `<policy domain="delegate" rights="none" pattern="gs" />`
|
|
|
|
|
|
<a id="todos"></a>
|
|
|
|
# TODOs
|
|
|
|
- Org / global configuration
|
|
- Page formatting
|
|
- Modify HTML styling
|
|
- Printed page layout, white styled figures
|
|
- Custom export function for HTML and \(\LaTeX\), with;
|
|
- `Shift` - `<f5>`, `Shift` - `<f6>` with open file
|
|
- delete temp. generated export files
|
|
- Figures
|
|
- Gnuplot
|
|
- plot transposed files/tables
|
|
- preamble in function and call this function for every gnuplot block either
|
|
manually or automatically with a hook?!
|
|
- Tables
|
|
- Wrap Table in div element. For smartphone scrolling.
|
|
- Table of contents
|
|
- \(\LaTeX\); currently headers with no-number property means not included in TOC
|
|
- HTML; currently generated list, like lot and lol, are not included in toc
|
|
but own headers without numbers are.
|
|
- Equation cancel/strike out with color line
|
|
- hcancel[color]{}
|
|
- Example: `\(\hcancel[red]{f_{X_2}(x_2)}}\)`
|
|
- Definition:
|
|
- Preamle: `#+LATEX_HEADER: \usepackage{cancel}`
|
|
`#+LATEX_HEADER: \newcommand\hcancel[2][black]{\setbox0=\hbox{$#2$}%`
|
|
`#+LATEX_HEADER: \rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}}#2}`
|
|
- `hcancel: [\"{\\\\setbox0=\\\\hbox{$#2$}\\\\rlap{\\\\raisebox{.45\\\\ht0}{\\\\textcolor{#1}{\\\\rule{\\\\wd0}{1pt}}}}#2}\",2]`
|
|
|
|
MathJax.Ajax.config.path[\"Contrib\"] = \"https://cdn.mathjax.org/mathjax/contrib\";
|
|
MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () {
|
|
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
|
|
cancel: [\"Extension\",\"cancel\"],
|
|
bcancel: [\"Extension\",\"cancel\"],
|
|
xcancel: [\"Extension\",\"cancel\"],
|
|
cancelto: [\"Extension\",\"cancel\"]
|
|
});
|
|
});
|
|
|