# emacs-config
**Repository Path**: deerrider/emacs-config
## Basic Information
- **Project Name**: emacs-config
- **Description**: 骑鹿人的暗黑风EMACS配置
- **Primary Language**: Emacs Lisp
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2019-06-01
- **Last Updated**: 2021-11-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## Features
* Multi-language support, multi-platform
* Handy splited window control (C-x o a\~z; M-1\~9)
* Friendly to new emacsers, customizable, productive
* Integrated with many useful developing tools (magit, slime, etc.)
* Magical theme the matrix
## Supported Language
* Ruby / Clojure / Python / Haskell
* Erlang / Lisp / Mozart Oz / Coq
* Js / Coffeescript / PHP / Html
* CSS / LESS / SASS / SCSS
* HAML / Markdown / Textile / ERB
## Emacs Cheatsheet
| Basic |
| Minimize |
C-z |
Exit Emacs |
C-x C-c |
| Run command |
M-x |
|
|
| File |
| Read a file |
C-x C-f |
Save a file |
C-x C-s |
| Toggle read-only status |
C-x C-q |
Save all files |
C-x s |
| Replace this file with.. |
C-x C-v |
Save as.. |
C-x C-w |
| Buffer |
| Switch to buffer.. |
C-x b |
List all buffers |
C-x C-b |
| Insert a file to buffer |
C-x i |
Kill buffer |
C-x k |
| Kill some buffers |
M-x kill-some-buffers |
Last/Next buffer |
C-x ←/→ |
| Minibuffer |
| Auto Complete |
TAB |
Complete and execute |
RET |
| Fetch previous input |
M-p |
Fetch later input |
M-n |
| Regexp backward/forward search through history |
M-r |
M-s |
| Abort minibuffer |
C-g |
Redo last command |
C-x Esc Esc |
| Error Recovery |
| Recover file |
M-x recover-session |
Undo tree |
C-x u |
| Restore buffer |
M-x revert-buffer |
Undo once |
C-/ or C-_ |
| Windows |
| Delete all other windows |
C-x 1 |
Delete current window |
C-x 0 |
| Split horizontally |
C-x 2 |
Split vertically |
C-x 3 |
| Scroll other window |
C-M-v |
Switch to <a-z> |
C-x o <a-z> |
| Switch to <1-9> |
M-<1-9> |
Find file in other window |
C-x 4 f |
| Open buffer in other window |
C-x 4 b |
|
| Marking |
| Set mark point |
C-@ |
Exchange point and mark |
C-x C-x |
| Mark word by word |
M-@ |
Mark paragraph |
M-h |
| Mark page |
C-x C-p |
Mark sexp |
C-M-@ |
| Mark function |
C-M-h |
Mark entire buffer |
C-x h |
| Copy and Paste |
| Cut region to kill ring |
C-w |
Copy region to kill ring |
M-w |
| Cut through next char |
M-z <char> |
Paste (yank back) |
C-y |
| Replace last paste (yank) with previous kill |
M-y |
| Transpose |
| Transpose characters |
C-t |
Transpose words |
M-t |
| Transpose lines |
C-x C-t |
Transpose sexps |
C-M-t |
| Case Change |
| Uppercase word |
M-u |
Lowercase word |
M-l |
| Capitalize word |
M-c |
Uppercase region |
C-x C-u |
| Lowercase region |
C-x C-l |
|
Cursor Motion
|
Operation |
| Move |
Delete |
| Amount |
Forward |
Backward |
Forward |
Backward |
| Characters |
C-f |
C-b |
C-d |
DEL |
| Words |
M-f |
M-b |
M-d |
M-DEL |
| Lines |
C-n |
C-p |
C-k (to EOL) |
C-SPC C-a C-w |
| Sentences |
M-e |
M-a |
M-k |
C-x DEL |
| Expressions |
C-M-f |
C-M-b |
C-M-k |
C-M-DEL |
| Section |
C-M-a |
C-M-e |
|
| Paragraphs |
M-} |
M-{ |
| Screen |
M-v |
C-v |
| End or Start of |
| Line |
C-e |
C-a |
| Buffer |
M-> |
M-< |
| Defun |
C-M-a |
C-M-e |
| Special Motion |
| Go to line |
M-g g |
| Go to Char |
M-g c |
| Back to indentation |
M-m |
| Scroll current line to center/top/bottom |
C-l |
| Search |
| Search forward |
C-s |
Search backward |
C-r |
| Regexp forward |
C-M-s |
Regexp backward |
C-M-r |
| Replace |
| Start query replace |
M-% |
Query replace word |
C-u M-% |
| Query replace by regexp |
M-x query-replace-regexp |
Replace once |
y |
| Skip once |
n |
Replace all |
! |
| Back up to previous match |
^ |
Exit query Replace |
RET |
| Help |
| Tutorial |
C-h t |
Search command by word |
C-h a |
| Describe bindings |
C-h b |
Describe keys |
C-h k |
| Describe functions |
C-h f |
Find function on keys |
C-h K |
| Get mode information |
C-h m |
Describe packages |
C-h P |
| Programming |
| Toggle node |
C-, |
Comment a region |
C-M-; |
| Insert comment line |
M-; |
Find next error |
C-x ' |
| Start a shell in a window |
C-x t |
Start slime |
C-x j |
| Toggle <xxx>-mode |
M-x <xxx>-mode |
Compile window |
M-x compile |
| Shell |
| Execute a shell command |
M-! |
Execute asynchronously |
M-& |
| Run command on a region |
M-| |
filter a region through a command |
C-u M-| |
| Paredit |
| Before |
After |
Key |
| (foo (bar |baz) quux zot) |
(foo (bar |baz quux) zot) |
C-<right> |
| (foo (bar |baz quux) zot) |
(foo (bar |baz) quux zot) |
C-<left> |
| (foo bar (baz| quux) zot) |
(foo (bar baz| quux) zot) |
C-M-<left> |
| (foo (bar baz |quux) zot) |
(foo bar (baz |quux) zot) |
C-M-<right> |
| Ediff |
| Start ediff |
M-x ediff |
Suspend/Quit |
z/q |
| Move Around |
| Pervious diff |
p or DEL |
Next diff |
n or SPC |
| Jump to diff |
j |
Goto X's point |
gx |
| Recenter |
C-l |
Scroll up/down |
v/V |
| Scroll lt/rt |
</> |
Swap Variants |
~ |
| Toggle Features |
| Vert/Horiz split |
| |
Highlighting |
h |
| Auto-refinement |
@ |
Ignore whitespaces |
## |
| Ignore case |
#c |
Focus/hide regions |
#f/#h |
| read-only in buf X |
X |
wide display |
m |
Manipulate
|
| Copy A/B's region to B/A |
a/b |
Restore buf X's old diff |
rx |
| Refine current region |
* |
Update diff regions |
! |
| Save buf x |
wx |
Save diff output |
wd |
| System |
| Show registry |
R |
Diff output |
D |
| Status information |
i |
Compare regions |
= |
## Prerequisites
1. When programming with Haskell, you need to install Haskell syntax checking tool Stack (and GHC 8.0.2 +). Run:
```shell
# Install Stack
wget -qO- https://get.haskellstack.org/ | sh
# Install Haskell
stack setup --install-ghc
```
This GHC will not replace former versions.
Warning : Lacking of Stack will cause Emacs fail to respond for seconds when editing .hs files.
2. Proof-general for Coq (or others).
Proof-general is already exists in "~/.emacs.d/site-lisp/". You should indicate the Coq path on Windows.
3. Mozart-Oz. You can find Mozart-Oz on its Official Website.
If you are installing an rpm package (only i386 version is avaliable), you need to convert it to amd64 version.
After installation, you can weak up Mozart Oz by:
```elisp
M-x run-oz
```
Or change current mode to oz-mode by:
```elisp
M-x oz-mode
```
## Plug-in List
## Attention
global-git-commit-mode may slows the reative of some operations in some low performance hard disks. You can block up this package in init-git.el.
In init-windows.el, windmove-defualt-keybindings is set to 'control and it is conflicted with paredit. Now you can edit parenthesis with C-\, C-\, etc.