An extensible, customizable, free/libre text editor — and more.
学会了Emacs,你就能够:linux
Lisp
了。GNU Emacs
成为一个好的编辑器和 IDE
别人都没有的我有
有点想知道是那个淡散的人写的
C-p/f/w/n ;; 系列
C-x 123 ;; 系列
projectile 和 neo-tree
M-x shell
query-\([a-z]*\)-regexp xx-\1-yy
例如,直接经过 ssh 编辑远端文件,sudo 身份编辑本地文件。git
C-x f /ssh:user@host:path C-x f /sudo::/etc/hosts
参考:github
Tramp Mode
生成 TAGSweb
etags `find . -name "*.[chS]"` etags `find . -name "*.h" -o "*.cpp"` etags `find . -name "*.[he]rl"`
载入 TAGS:shell
M-x visit-tags-table
通常用法:数组
M-. %% 跳转 M-* %% 返回跳转 C-u M-. %% 下一个位置
在 go-mode, auto-complete, go-autocomplete,同时安装好 gofmt 和 gocode。bash
(require 'go-mode) (add-hook 'before-save-hook 'gofmt-before-save) (require 'auto-complete-config) (require 'go-autocomplete) (add-hook 'go-mode-hook '(lambda() (setq tab-width 4) (linum-mode 1) (auto-complete-mode t)))
提示: Emacs 对代码的跳转补全依赖第三方语法分析工具,若是有工具,就可以很好的接入。
Emacs > 24加入了本身的包管理,绝对是炫酷)。ssh
记得首先设置路径。编辑器
(add-to-list 'package-archives '("popkit" . "http://elpa.popkit.org/packages/"))
而后 M-x list-package
函数
只要你能数清括号,就能学会 Lisp :D
ELisp 是一门的语言。而且支持 GC。
丰富的库。
几乎全部的扩展程序都是纯 ELisp 程序。
(set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (prefer-coding-system 'utf-8) (defconst *is-a-mac* (eq system-type 'darwin))
(defun large-file-hook () "If the size of given file is lager than 2 MB, to make the buffer read only." (when (> (buffer-size) (* 2 1024 1024)) (setq buffer-read-only t) (buffer-disable-undo) (buffer-disable-undo) (linum-mode 0) (font-lock-mode 0) (fundamental-mode)))
针对不一样的字符配置不一样的字体。
(when (and (eq system-type 'gnu/linux)) (set-face-attribute 'default nil :family "Ubuntu mono" :height 160) (dolist (charset '(kana han symbol cjk-misc bopomofo)) (set-fontset-font (frame-parameter nil 'font) charset (font-spec :family "Noto Sans CJK TC light" :height 160))))
cd /usr/share/emacs/*/lisp/play
C-x h, t ;; 查看自带的教程。
一个很是好的参考资料。
A reasonable Emacs config
Emacs Lisp 简明教程