1. 安装
ubuntu下在终端中输入emacs,若未安装,会提示安装命令
sudo apt install emacs
2. 简易配置
;; 主题
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(custom-enabled-themes '(tango-dark))
'(ispell-dictionary nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;; 显示时间
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
;; 菜单栏,工具栏, 滚动条
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; 启动界面
(setq inhibit-startup-message t)
;; 显示行号
(global-linum-mode t)
;; 高亮当前行
(global-hl-line-mode 1)
3. 常用快捷键
- 个人常用
操作 | 按键 |
---|---|
退出emacs | C-x C-c |
保存 | C-x C-s |
复制 | M-w |
粘贴 | C-y |
撤销 | C-x u |
打开文件 | C-x C-f |
划分当前窗口2*1 | C-x 2 |
划分当前窗口1*2 | C-x 3 |
关闭当前窗口 | C-x 0 |
多个窗口间切换光标 | C-x o |
切换buffer | C-x b |
列出所有buffer | C-x C-b |
关闭buffer | C-x k |
前向搜索 | C-s |
后向搜索 | C-r |
跳转到buffer开始位置 | C-Home |
跳转到buffer结束位置 | C-End |
标记光标位置到buffer开始位置之间的区域 | C-M-Home |
跳转到句首 | M-a |
跳转到句末 | M-e |
添加标记 | C-space |
删除标记区域 | C-w |
- 汇总
图片来源:https://blog.csdn.net/u010164190/article/details/123058810