emacs minimalist tutorial under noilinux

Foreword

The purpose of this article is not to teach you to use emacs, but to let you in noilinux to have a functional and easy to use no less favorable than devc ++ code editor

If you want to learn emacs you can turn left for another article
emacs study notes

This article is only for emacs under the gui version of noilinux

The following are tested at noilinux

Open emacs

Open emacs (actually noilinux software documentation is turned on by default emacs) - From the top left corner. "> Application Programming"

Set up

Since this article was started, so we try to make all the settings in gui

Although I wrote so long, in fact, the speed of light can be done (because their position is continuous)

One

Select "Options"
hook "HighLight Matching Parentheses" (highlight matching parentheses)
hook "Use CUA keys" (copy using Ctrl + C, Ctrl + X Cut, Ctrl + V paste)
point "Save Options" (save changes )

two

"Options-> Costumize Emacs-> Custom Themes "
choose a theme you like and then save the above

three

"Options-> Costumize Emacs-> All Settings Matching"
The search interface is set as emacs setup menu does not fit so much
input "linum"
to "Global Linum Mode" open (line number)
Enter "pair"
the "Electric Pair Mode" open (brackets complement)
the angle brackets in addition to the other can not fill the whole complement, and enter the closing parenthesis can jump out of their own

four

The only important settings can only be set in the configuration file,
open ~ / .emacs
you will find that there has been a lot of content (previous settings are written up)
plus

(global-set-key (kbd "RET") 'newline-and-indent)  

It simply is shortcuts covering the carriage to the new line and indented (default is not automatically a new line indented, indented line will only kick, a later version of emacs is not set)

Here has been very good with the
above settings should be completed within one minute
following which I feel no need of QAQ
anyway, I was too lazy to change

Preferences

Optional fonts

The default is Ubuntu Mono (I think it is very good), if you want to change the font, then follow the steps below
"Option-> Set Default Font"
option would be finished
I can not swallow the glass body injury

tab length

emacs default indentation is mandatory that the tab key has been changed to enter the tab indentation instead, so the change is actually indented length
because the indentation is achieved by a space, so two spaces to indent the habit would be better, because delete them faster, and will not let two spaces to indent write the code to break when pressure is like the sky
is set search interface
search "Offset"
to "C Basic Offset" select the latter option, the back filled into 4

Like windows shortcuts

And the above format, as written in the ~ / .emacs where you can

(global-set-key (kbd "C-a") 'mark-whole-buffer);;全选
(global-set-key (kbd "C-z") 'undo);;撤销
(global-set-key (kbd "C-s") 'save-buffer);;保存

A key to compile debugging

(global-set-key [f8] 'compile);;编译
(global-set-key [f5] 'gdb);;调试

operating

Direct write code on it

Basis shortcuts

This is based in part on emacs shortcuts no random change of
use of native emacs shortcuts
C-x hSelect
C-x sSave
C-/revoked
C-wcut
M-wcopy
C-yand paste
compared into windows style shortcuts can be less to write the configuration file

menu

There are actually able to understand the level of junior high school English

File

Is a file-related operations

Edit

Copy and paste not say
mainly there are search and replace

Option

Settings, set up after the general does not move

Buffers

Buffer
can switch the current existence of buffer
equivalent to the window
just some of the hidden window

Tools

Tool
it is important to compile (compile) and debug (debug)
Enter the following command to compile by the compiler, before closing emacs will remember
elaborate after specific compiler and debugger

Another important game QAQ

Action Bar

I do not know how to call, that is, below the menu bar piece
will have different buttons depending on the type of the current buffer, the specific role of the English look like
basically have is a fork closes the current buffer

Important shortcuts

C-g
To terminate the command, if you accidentally press the wrong stop and what can
be interrupted by continuous withdrawal effects achieved redo

Keyboard Shortcuts

C-x +/-Zoom

Split-screen shortcuts

If for some operations led to a split screen to QAQ will merge
or split-screen is what you want
C-x 0to close the current split-screen
C-x 1only keep the current split screen
C-x 2from top to bottom split screen
C-x 3left and right split screen

Compile

After compiling a compilation window opens, if the compiler fails to take a direct mouse click on an underlined position have to jump to that location, very convenient

A key comment / uncomment

Shortcuts C-c C-ccomment
C-u C-c C-cuncommented

Indent / Format

It says the tab has been replaced with indented, so direct press tab select the content on it

debugging

gdb emacs to have a good support
with tools inside or debug M-x gdbor self-defined shortcuts to start gdb
attention in the startup command parameter can not be deleted

After starting gdb
method using gdb alone run
automatically after running a split-screen source
will use the arrow shows the current line
can add / remove a breakpoint line number with the mouse
above a row of buttons that can be used, but also next You can use

gdb output to iobuffer, if the number of sub-screen is not enough these windows will jump around, it is advisable to open three split screen again gdb

Instruction may be used M-x gdb-many-windowsto open a multi-window mode
so that each use gdb window automatically opens 6

Operating window is the upper left, the upper right is the current position of all local variables, the code is left, the right is input and output, useless can kill the lower left, lower right breakpoint

If you are used there is so much information you can open

(setq gdb-many-windows t);;每次打开多窗口模式  

It can also be used to configure the operation to make an output to the window

There are some nice action

C-x C-a C-j
You can run the program directly to the cursor (ignoring the breakpoint)

terminal

M-x termOpen a terminal can
cooperate well with split-screen

Guess you like

Origin www.cnblogs.com/oiertkj/p/12207881.html