Skip to content

Instantly share code, notes, and snippets.

@ngn999
Created September 21, 2012 11:47
Show Gist options
  • Save ngn999/3761037 to your computer and use it in GitHub Desktop.
Save ngn999/3761037 to your computer and use it in GitHub Desktop.
Emacs Abbrev

Abbrev是神马

Abbrev就是缩写的意思, 在Emacs里Abbrev能方便的输入这种缩写. 比如, 定义好, mgmtmanagement的缩写,
那以后你输入mgmt, 加一非字母数字符号, 就自动扩展成management. 很好用.

如何使用

定义:

`C-x a g' 定义一个全局的.  
 Define an abbrev, using one or more words before point as its
 expansion (`add-global-abbrev').

`C-x a l'  定义一个属于某major mode的缩写
 Similar, but define an abbrev specific to the current major mode
 (`add-mode-abbrev').

具体操作: 将foo定义成find outer otter的缩写, 输入find outer otter, 然后, 输入: C-u 3 C-x a g f o o <RET>

保存到文件, 以后使用:

`M-x write-abbrev-file <RET> FILE <RET>'
 Write a file FILE describing all defined abbrevs.
@ngn999
Copy link
Author

ngn999 commented Sep 21, 2012

我将Abbrev文件放到github方便管理.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment