Skip to content

Latest commit

 

History

History
111 lines (78 loc) · 3.75 KB

BETA.org

File metadata and controls

111 lines (78 loc) · 3.75 KB

Basics

“M” means ALT key. “C” means CTRL key.

For example, “M-x” means pressing ALT and X key together in Emacs.

Download https://github.com/redguardtoo/hello.git and extracted somewhere, say “~/hello/”. It contains sample code files written in different programming languages.

By default, I use vim key bindings. You can “C-z” to toggle into Emacs key bindings.

Error message is always dumped into “\*Messages\*” buffer. You can “C-x C-b” to select buffer named “\*Messages\*” in order to get the error message.

BTW, README at https://github.com/redguardtoo/emacs.d has all the technical information you need.

Emacs version

In bash shell, run comand,

emacs --version

Start up

In bash shell, run command,

emacs -nw  --debug-init

Please “M-x toggle debug-on-error” after startup.

Usage

If there is any error please attached debug information in “\*Messages\*” buffer to your email.

Packages

Please back up and remove original ~/.emacs.d.

Download zip or git clone from https://github.com/redguardtoo/emacs.d

Use this as emacs setup.

  • Start Emacs, “M-x list-packages”, ignore any error in this step
  • restart Emacs, all packages should be downloaded and installed without any problem.

Org-mode

Open ~/hello/hello.org by “C-x C-f”.

Common operations for most programming languages

Code navigation: jump to the definition

For most languages, you need Ctags.

`ctags -e -R` in the shell.

Then `M-x find-tag` in Emacs

Code navigation: find the references

`M-x grep`

Code navigation: jump to the definition in current file

`M-x helm-imenu`

Goto last change

`M-x goto-last-change` and `M-x goto-last-change-reverse`

Undo/Redo

`M-x undo-tree-visualize`

Insert a sequence of numbers

Select a region, you can `M-x exchange-point-and-mark` to double check the actual column to insert.

Then `M-x rectangle-number-lines`. `C-u M-x rectangle-number-lines` give you more choices.

C

Open ~/hello/hello.c

insert single character “i” and press “M-j”, the text should be expanded by yasnippet.

Lua

Open ~/hello/hello.lua

C++ plus CMake

Make sure CMake installed and the executable “cmake” exists in environment variable PATH.

Finish One Minute tutorial.

Javascript

Open ~/hello/hello.js

Insert single character “l” and press “M-j”, the text should be expanded by yasnippet.

Please input some javascript with syntax error intentionally, the error will be highlighted immediately.

Place the cursor inside any function, input “lwf” and press “M-j”, text will be expanded by yasnippet.

“M-x helm-imenu” to display the function list in current buffer. AngularJS code preferred.

HTML

Open ~/hello/hello.html

Install “tidy” (check README), then intentionally input some invalid html tag, you should see the tag is highlighted

Install “aspell” and its English dictionary “aspell-en”, input some typo in html tag’s “value” attribute. The typo will be highlighted automatically.

Open an empty HTML file, input “html5” then “M-j”. Input “script” then “M-j”.

Ruby

Open ~/hello/hello.rb. It shoud be fine to edit the code.

Python

Open ~/hello/hello.py

Input “os.”, you will see the auto-completion of methods in two second. Python 2.x required.

Perl

Open ~/hello/hello.pl

Misc

Feel free to test any command at any environment. If I may suggest you can start from the commands which is assigned hotkey by “evil-leader/set-key”. These commands are my frequently used commands.

The only exception is tex related stuff. I don’t have tex environment for now.

Report

Email me,

  • the environment information (Emacs version, OS details)
  • any bug report
  • any general issues not covered by this document