Emacs First Day

Source: Internet
Author: User
Tags save file

emacsbinw64.sourceforge.net Windows emacs Download place (green software)

Learn Quick Start

C-h T Quick Start Help documentation

Cursor Movement shortcut keys:

C-f forward a grid
C-b back a grid
C-n Down Line
C-p Up line
C-a Line Start
C-E End of Line
C-k Delete the current position to the end of the line
Check the win on the Edit shortcut keys these shortcuts in the Mac is the global shortcut keys

Note changes: Caps Lock to Ctrl

C-G Interrupt command (do not want to continue this instruction)

s represents the Super key s for the SHIFT key

M-x Linum-mode Display line number

Open File C-x c-f
Save File C-x C-s is also called function (Save-buffer)

Emacs Anything (for example: shortcut keys) you can query it.
C-h v A variable
C-h k Query shortcut key binding function (shortcut keys just call the corresponding function quickly)
C-h f a function
All shortcuts are in a map and correspond to specific functions (query shortcut keys see)

Learn Elisp learnxinyminutes.com

Buffer scratch inside can execute elisp command (because the default is Lisp major mode)
C-x c-e Execution (below is the result of execution) or c-j (the next line is the result of the execution)
The area displayed in the Minibuffer
Inside The beginning indicates that the comment c-h m can view all minor mode

Inside can turn off auto indent Elecreic-indent-mode
M-x Elecreic-indent-mode off.

Define a variable (setq my-name "Zilongshanren") every time c-x c-e run
Output this variable (message my-name)
(insert "Hello,emacs") Hello,emacs
(insert "Hello, I AM" my-name) Hello, I am Wanglei

Define a function (defun my-func () function without parameters (to place the mouse behind the last parenthesis and then c-x C-E)
(Message My-name))
(MY-FUNC) Executes the function

(Defun My-func ()
(Message "Hello,world%s" My-name))
(My-func)

(Defun Hello (name) (insert "Hello" name)) function with parameters
(Hello "You") the invocation of a function with parameters

If you want to call this function in M-x at this point, it doesn't work.
(Defun My-func ()
(interactive) means to define it as an interactive function
(Message "Hello,world%s" My-name))
If you want to know the Help cursor for the message function, place it above and c-h F (the cursor character is grabbed by default)
(My-func)

If you want to bind a shortcut key to a function
(Global-set-key (kbd "<f2>") ' My-func) binds the function to the shortcut key

If you restart Emacs, these configurations are dead.

~/.emacs.d/init.el (the file is not c-x by default c-f after you create it)

Opening each file will open a major mode company-->complete anything

What syntax rules major mode should provide to parse its core functions, such as syntax highlighting and indenting shortcut keys

Open this file:
If you don't want the top toolbar,
(tool-bar-mode-1) This is a minor mode a file can activate at most one major mode

Multiple Minie mode
(scroll-bar-mode-1) scroll bar off
(elecreic-indent-mode-1) Close indent
(Global-linum-mode T) global display of line numbers
(setq Inhibit-splash-screen t) close the default startup page

(Defun open-init-file ()
(interactive)
(find-file "~/.emacs.d/init.el")) function to open the file Find-file code to use the name of the letter

(Global-set-key (kbd "<f2>") ' Open-init-file)

Package system installation company Meta N/P Select
(Global-company-mode t) Open prompt no matter 25.1 useful
(setq cursor-type ' bar)

Showing Minior mode c-h m

Org-mode c-c c-t GTD tool (getting thing done)

The Elpa directory is used to store the package installation items

ORG mode * below the heading

Create a new buffer called *test*.
(Switch-to-buffer-other-window "*test*")
' C-XC-E ' The screen will now display two windows, while the cursor is in *test* buffer

Clicking on the buffer above will cause the cursor to move back.
Or you can use c-x o to make the cursor jump to another window

You can use the PROGN command to combine the S-style:
(Progn
(Switch-to-buffer-other-window "*test*")
(Hello "You")) This hello is the parameter function defined above.

Clears the specified buffer
(Progn
(Switch-to-buffer-other-window "*test*")
(Erase-buffer)
(hello "There")
)

After installing company for completion of the installation in the. EMACS.D Directory
Generate Elpa directory for saving the package's source files and compiled files

After that, you can use the full complement function.
M-x company-mode instal c-n c-p can select the content of the complement

But there's only a full complement to this file.
M-x Global-company-mode is valid for all files

Major mode will only have one display where
C-h m can display all minor mode

Learnxinyminutes Tutorial https://learnxinyminutes.com/docs/elisp/

Org-mode
C-c c-t to turn an item into TODO
GTD (getting thing done)

The difference between SETQ and Setq-default
The buffer local variable has a copy of the value in each buffer
If the variable setq-default is valid for the global and SETQ only valid for the current

Disable backup files (if the file is already on GitHub)
(setq make-backup-files Nil)

C-x 2 split the screen below
C-x 3 split screen on the right

#+begin_src Emacs-lisp
(setq make-backup-files Nil)
#+end_src

C-c ' (past and back) into another buffer

Let the above comment inside the keyword has highlighted in the configuration file to add
(Require ' org)
(setq org-src-fontify-natively T)

Emacs First Day

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.