SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Emacs 介绍和使用
Jian QIN
September 22, 2013
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Outline
Emacs
基本使用简介
使用
配置与定制
结束
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Emacs
▶ 官方网站 http://www.gnu.org/software/emacs/
▶ Learning Curve
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
自己
▶ 只是日常简单使用, 非专家
▶ 小拇指确实受不了, 多用手掌
▶ learn-emacs-in-ten-years
http://edward.oconnor.cx/2009/07/
learn-emacs-in-ten-years
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
个人观点
1. 功能可扩展, 满足基本需求 -> 需求比较基本 -> 基本
满足需求
2. 减少使用鼠标和方向键的干扰
3. 基本键位多个平台通用或者支持:Mac OS, Unix
Terminal, Eclipse, VS
4. C/C++/C# -> MS VS/Mono ; Java -> Eclipse ; 其他
-> Emacs ;
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
用户
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
用户 (续)
1. Python 作者 - Guido van Rossum
2. Ruby 作者 - Yukihiro Matsumoto
3. Linux 作者 - Linus Torvalds [使用自己的定制版, 非
GNU Emacs]
4. Erlang 作者 - Joe Armstrong
5. Tex 作者 - Donald Knuth
6. Google 搜索部主任 - Peter Norvig
7. 黑客五部曲作者 - Eric Raymond
8. GNU Emacs 作者 - Richard Stallman
9. 维基解密作者 - Julian Assange
10. And … http://wenshanren.org/?p=418 [英文版]
http://wenshanren.org/?p=386 [中文版]
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
移动
C-n/C-p 行
C-f/C-b 字符
A-f/A-b 单词
C-v/A-v 页
C-e/C-a 行后/行尾
C-l 屏幕位置
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
编辑
C-k 删除到行尾
C-y 粘贴
C-space 标注
A-w/C-w 复制/剪切
C-x u /C-z 撤销
C-d 删除后面字符
A-d 删除后面单词
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
窗口/文件
C-x o 下个窗口
C-x b 下个文件
C-x 1/2/3 关闭其他/横向切割/纵向切割
C-x k 关闭文件
C-x C-b 全部打开文件的情况
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
其他
C-g
中断目前的操作
执行其他未绑定的功能
Meta-x 功能名 不同环境下 Meta 可能是 Esc/Alt/Win
另 Win 键也会是 Super 键。
宏
C-x ( 开始
C-x ) 结束
C-x e 执行
另可以命名保存下来,之后利用 M-x 调用。
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
几个名词
▶ Frame
窗口
▶ Buffer
文件
▶ Minibuffer
下面的反馈区
▶ Major Mode/ Minor Mode
1 Major Mode + N Minor Modes
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
教程
1. C-h t 在中文环境下会有中文版本, 教程中使用的默认
键被改动也会有说明.
2. http://www.ppurl.com/?s=emacs
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
10 Specific Ways to Improve Your Productivity
With Emacs
1. Swap Caps-Lock and Control
2. Invoke M-x without the Alt key
3. Prefer backward-kill-word over Backspace
4. Use incremental search for Navigation
5. Use Temp BuffersMaster the buffer and window
commands
6. Lose the UI
7. Learn the most important help functions
8. Master Emacs’s regular expressions
9. Master the fine-grained text manipulation commands
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
文本编辑
1. 使用 flyspell 进行英文拼写检查
利用 ispell-word + i + y 可以增加私人词典. OR
~/.dic 文件, 一行一词.
2. 利用 gpg 加密文档内容
epa-encrypt-file AND epa-decrypt-file
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Org-Mode
笔记和文档
1. 记录
2. 发布
3. 支持嵌入代码  公式
∑
i (yi − f(xi))2
(
N
∑
i xi
∑
i xi
∑
i x2
i
) (
ω0
ω1
)
=
( ∑
i yi
∑
i xiyi
)
(1)
GTD
可以计时追踪, 定 schedule, deadline 等等.
▶ http://members.optusnet.com.au/~charles57/
GTD/gtd_workflow.html
▶ http://www.mastermindcn.com/2012/02/org_
mode_quite_a_life/
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Org-Mode (续)
导出功能
支持如下格式:
1. iCalendar
2. HTML
3. LaTex -> PDF (需要安装 texlive)
4. Plain Text
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
邮件
mew [目前使用]
文档参阅:http://www.mew.org/en/
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
c/c++
▶ yas-snippet
▶ auto-complete
▶ auto-complete-clang OR auto-complete-clang-async
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
GDB
http://emacser.com/emacs-gdb.htm
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Slide
本 Slide 使用 org-mode+beamer 创建, 加入如下内容在 org
文件头部:
1 #+OPTIONS: H:2
2 #+LATEX_CLASS: beamer
3 #+LATEX_CLASS_OPTIONS: [presentation]
4 #+BEAMER_COLOR_THEME: beaver
5 #+BEAMER_THEME: Goettingen
6
7 #+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) %8BEAME
8
9 #+LATEX_HEADER: usepackage{xeCJK}
10 #+LATEX_HEADER: usepackage{minted}
11 #+LaTeX_HEADER: usemintedstyle{emacs}
12 #+LATEX_HEADER: setCJKmainfont[BoldFont=SimHei,ItalicFont=SimHei]{WenQuanYi Micro
13 #+LaTeX_HEADER: setCJKmonofont{SimHei}
使用命令:
1 (org-beamer-export-to-pdf)
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Slide [续]
使用
1. 两个窗口
2. 一个打开.org 文件, 一个打开.pdf 文件
3. .pdf 文件打开 auto-revert-moe
其他
可以导出为 html+js 的幻灯片
▶ http://sachachua.com/blog/2013/04/
how-to-present-using-org-mode-in-emacs/
▶ http://www.youtube.com/watch?v=Ho6nMWGtepY
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
IDE of Python
To be continued……
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
VIM 键绑定
evil from package list
Get its description from:
http://www.emacswiki.org/emacs/Evil
[自己没用过]
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
安装和管理插件包
emacs24+ 内置包管理系统,支持添加源,方便管理、升
级、删除
M-x package-list-packages, then
u 升级
d 删除
x 执行操作
p 上
n 下
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
starter-kit
提供基本的功能.
https://github.com/eschulte/emacs24-starter-kit
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
快捷键自定义
1. C-h m 查看所有的快捷键功能
2. C-h k 查看希望绑定的快捷键
3. 改写配置文件
1 (global-set-key (kbd "<f11>") 'toggle-fullscreen)
2 (local-set-key (kbd "RET") 'newline-and-indent)
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
Emacs Lisp
http:
//www.gnu.org/software/emacs/manual/elisp.html
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
我的配置
基于 starter-kit, 简单增加内容.
1 git clone https://github.com/qinjian623/emacs-config.git ~/.emacs.d
2 rm .emacs
▶ branch dev. 个人配置文件, 欢迎 pull.
▶ 自己大部分使用环境是 Xubuntu 13.04 / Mac OS X
10.6, 无法保证其他环境
▶ 一直是私人使用, 所以达不到工程要求
▶ 基本上可以达到 clone 后即可用
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
引用来源和各种链接
▶ http://zh.wikipedia.org/wiki/Emacs
▶ http://lifegoo.pluskid.org/upload/blog/152/
Survive.in.Emacs.pdf
▶ http://scc.ustc.edu.cn/zlsc/czxt/200910/
W020100308601210472906.pdf [基本使用]
▶ http://refcards.com/docs/gildeas/gnu-emacs/
emacs-refcard-a4.pdf [Cheat Sheet]
▶ http://emacser.com/
▶ http://blog.binchen.org/ [墙外]
▶ http://ergoemacs.org/emacs/emacs.html 李杀
Emacs
▶ https://sites.google.com/site/steveyegge2/
effective-emacs
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
引用来源和各种链接(续)
▶ http://www.gnu.org/software/emacs/
▶ http://blog.jobbole.com/44932/ [Emacs Lisp 快速
入门]
▶ http://www.slideshare.net/yukihiro_matz/
how-emacs-changed-my-life Ruby 作者的 slide [墙
外]
▶ http:
//www.newsmth.net/bbsdoc.php?board=Emacs 水木
Emacs 版
▶ http://edward.oconnor.cx/2009/07/
learn-emacs-in-ten-years
▶ http://wenshanren.org/?p=418 [英文版]
▶ http://wenshanren.org/?p=386 [中文版]
▶ 宏使用
Emacs 介绍和使用
Jian QIN
Emacs
基本使用简介
使用
配置与定制
结束
. . . . . .
引用来源和各种链接(续)
▶ http://www.hartwork.org/beamer-theme-matrix/
[beamer 的主题和颜色预览]
▶ http://members.optusnet.com.au/~charles57/
GTD/gtd_workflow.html
▶ http://www.mastermindcn.com/2012/02/org_
mode_quite_a_life/
▶ http://www.ppurl.com/?s=emacs
▶ http://www.mew.org/en/
▶ http://emacser.com/emacs-gdb.htm
▶ https://github.com/brianjcj/
auto-complete-clang?source=c
▶ http://blog.waterlin.org/articles/
using-emacs-to-encry-file.html

Weitere ähnliche Inhalte

Andere mochten auch

Code4vn - Linux day - linux boot process
Code4vn - Linux day - linux boot processCode4vn - Linux day - linux boot process
Code4vn - Linux day - linux boot processCường Nguyễn
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my lifeyukihiro_matz
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境についてKazuhiro Hara
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs董 伟明
 

Andere mochten auch (7)

Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Code4vn - Linux day - linux boot process
Code4vn - Linux day - linux boot processCode4vn - Linux day - linux boot process
Code4vn - Linux day - linux boot process
 
How Emacs changed my life
How Emacs changed my lifeHow Emacs changed my life
How Emacs changed my life
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について(IDEユーザのための) ClojureのEmacs開発環境について
(IDEユーザのための) ClojureのEmacs開発環境について
 
我在豆瓣使用Emacs
我在豆瓣使用Emacs我在豆瓣使用Emacs
我在豆瓣使用Emacs
 
Rhel6 vs rhel7
Rhel6 vs rhel7Rhel6 vs rhel7
Rhel6 vs rhel7
 

Ähnlich wie My Emacs Configs

Emacs Introduction
Emacs IntroductionEmacs Introduction
Emacs IntroductionMarch Liu
 
Avm2虚拟机浅析与as3性能优化(陈士凯)
Avm2虚拟机浅析与as3性能优化(陈士凯)Avm2虚拟机浅析与as3性能优化(陈士凯)
Avm2虚拟机浅析与as3性能优化(陈士凯)FLASH开发者交流会
 
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)Shanda innovation institute
 
Mysql mmm演讲--冯浩
Mysql mmm演讲--冯浩Mysql mmm演讲--冯浩
Mysql mmm演讲--冯浩chinafenghao
 
Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩chinafenghao
 
Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩chinafenghao
 
GNU Autoconf / Automake #4
GNU Autoconf / Automake #4GNU Autoconf / Automake #4
GNU Autoconf / Automake #4imacat .
 
[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through VimPayton Chou
 
Cfengine培训文档 刘天斯
Cfengine培训文档 刘天斯Cfengine培训文档 刘天斯
Cfengine培训文档 刘天斯liuts
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理frankwsj
 
Node.js從無到有 基本課程
Node.js從無到有 基本課程Node.js從無到有 基本課程
Node.js從無到有 基本課程Simon Su
 
Avm2虚拟机浅析与as3性能优化
Avm2虚拟机浅析与as3性能优化Avm2虚拟机浅析与as3性能优化
Avm2虚拟机浅析与as3性能优化Harvey Zhang
 
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)King Hom
 
Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Chu-Siang Lai
 
makefile20141121
makefile20141121makefile20141121
makefile20141121Kevin Wu
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIChu-Siang Lai
 
Skan it 6.0 user manual chinese
Skan it 6.0 user manual chineseSkan it 6.0 user manual chinese
Skan it 6.0 user manual chineseLenin TaMe
 

Ähnlich wie My Emacs Configs (20)

Emacs Introduction
Emacs IntroductionEmacs Introduction
Emacs Introduction
 
Avm2虚拟机浅析与as3性能优化(陈士凯)
Avm2虚拟机浅析与as3性能优化(陈士凯)Avm2虚拟机浅析与as3性能优化(陈士凯)
Avm2虚拟机浅析与as3性能优化(陈士凯)
 
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)
[Flash开发者交流][2010.05.30]avm2虚拟机浅析与as3性能优化(陈士凯)
 
Mysql mmm演讲--冯浩
Mysql mmm演讲--冯浩Mysql mmm演讲--冯浩
Mysql mmm演讲--冯浩
 
Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩
 
Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩Mysql mmm演讲-冯浩
Mysql mmm演讲-冯浩
 
GNU Autoconf / Automake #4
GNU Autoconf / Automake #4GNU Autoconf / Automake #4
GNU Autoconf / Automake #4
 
[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim[20081118] How To Trace Code Like Source Insight Through Vim
[20081118] How To Trace Code Like Source Insight Through Vim
 
Ipaq with linux
Ipaq with linuxIpaq with linux
Ipaq with linux
 
Cfengine培训文档 刘天斯
Cfengine培训文档 刘天斯Cfengine培训文档 刘天斯
Cfengine培训文档 刘天斯
 
自动化运维管理
自动化运维管理自动化运维管理
自动化运维管理
 
Node.js從無到有 基本課程
Node.js從無到有 基本課程Node.js從無到有 基本課程
Node.js從無到有 基本課程
 
Avm2虚拟机浅析与as3性能优化
Avm2虚拟机浅析与as3性能优化Avm2虚拟机浅析与as3性能优化
Avm2虚拟机浅析与as3性能优化
 
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)
 
Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)
 
makefile20141121
makefile20141121makefile20141121
makefile20141121
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CI
 
manual
manualmanual
manual
 
Skan it 6.0 user manual chinese
Skan it 6.0 user manual chineseSkan it 6.0 user manual chinese
Skan it 6.0 user manual chinese
 
Vim
VimVim
Vim
 

My Emacs Configs