Emacs 学习

emacs基础使用指南

打开关闭

//打开
emacs -nw   不启动窗口
//关闭
ctrl-x ctrl-c

光标移动

‘基本/行/句子/页/文件 的光标移动


//basic_cursor control
|                ctrl-p (to previous)
|                          |
|   ctrl-b(to backward) -------- ctrl-f(to forword)
|                          |
|                ctrl-n(to mext)
|
ctrl-p  will be same colum,except there is no words
ctrl-b  at the head of one line,cursor will be up to same colum(if there are words)

//basic_move between sentences move
alt-f  sentence forward
alt-b  sentence backword

//basic_move ahead and end
ctrl-a (line ahead/front)--------------ctrl-e (line end)
alt-a (sentence ahead/front)=================alt-e(sentence end)

//turn page
|         ctrl-v(up one page)
|
|         ctrl-l (set cursor to the mid)
|
|         alt-v(down one page)

//basic_move file front and end
|       alt-shift-,(file top)
|
|
|       alt-shift-.(file end)

//basic_move with param
ctrl-u  8 ctr-f//this is a sample move forward 8 chars,other contrl can with params.
ctrl-u 2 ctrl-p //up 2 line

//cancel control running or inputting
ctrl-g
if you press <ESC> the right style to cancel is press 2 times <ESC>

窗口使用

//打开新窗口

//只保留一个窗口
 ctrl-x 1

插入与删除

//普通插入敲击键盘即可,特殊的可以输入参数
gctrl-u 8 *  //可输入八个*

//删除
ctrl-d //删除官表后一个字符
alt-d  //移除光标后的一个词

ctrl-k //移除光标到行尾的字符
alt-k  //移除光标到句尾的字符

//召回
ctrl-y b
alt-y  可以召回前几次移除的文字

选中 复制 剪切 粘贴

ctrl-@  //选中,本来ctrl-space ,但是用于中英文切换了
alt-w   //复制
ctrl-w  //剪切
ctrl-y  //粘贴

撤销

ctrl-x u 撤销当前操作

文件

ctrl-x ctrl-f               寻找一个文件
//ctrl-x f 设置行宽度
ctrl-x ctrl-s               save a file
ctrl-x ctrl-b               show the current buffers 
ctrl-x b  filename      switch current  buffer
ctrl-x  s                       save all buffers

命令扩展

ctrl-x    
alt-x

自动保存与恢复

alt-x recover filenmae   恢复文件

搜索

ctrl-s  向前搜索
ctrl-r  向后搜索
ctrl-g  回到起始位置

多窗格

ctrl-x 2  分成2个窗口
ctrl-alt-v **下边的窗口向下翻页**
ctrl-x o 光标移动到下边窗口
ctrl-x 4 ctrl-f file 在新窗口中打开文件

emacs搭建c++开发环境

猜你喜欢

转载自blog.csdn.net/writeeee/article/details/64922038