Abbrev就是缩写的意思, 在Emacs里Abbrev能方便的输入这种缩写. 比如, 定义好, mgmt
是management
的缩写,
那以后你输入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.
我将Abbrev文件放到github方便管理.