第一步[root@localhost ~]# yum install dictd
第二步. 编写配置文件和下载字典数据库
现在本地dictd server还不能工作,你必须写两个配置文件dictd.conf和dict.conf(存储到/etc/目录下)他们的内容如下:
dictd.conf:
access {allow localhost allow *}
database Web1913 {data "/usr/share/dictd/web1913.dict.dz"
index "/usr/share/dictd/web1913.index"}
database wn {data "/usr/share/dictd/wn.dict.dz"
index "/usr/share/dictd/wn.index"}
~
上面的字典可以到ftp://ftp.dict.org/dict/pre/下载
dict.conf:
server localhost
第三步 [root@localhost ~]# /etc/init.d/dictd start
接下来:
你可以
[root@localhost ~]# dict word
查找到单词了吧,恭喜你。
然后编写
;;;;;辞典
(autoload 'dictionary-search "dictionary"
"Ask for a word and search it in all dictionaries" t)
(autoload 'dictionary-match-words "dictionary"
"Ask for a word and search all matching words in the dictionaries" t)
(autoload 'dictionary-lookup-definition "dictionary"
"Unconditionally lookup the word at point." t)
(autoload 'dictionary "dictionary"
"Create a new dictionary buffer" t)
(autoload 'dictionary-mouse-popup-matching-words "dictionary"
"Display entries matching the word at the cursor" t)
(autoload 'dictionary-popup-matching-words "dictionary"
"Display entries matching the word at the point" t)
(autoload 'dictionary-tooltip-mode "dictionary"
"Display tooltips for the current word" t)
(autoload 'global-dictionary-tooltip-mode "dictionary"
"Enable/disable dictionary-tooltip-mode for all buffers" t)
(global-set-key [mouse-3] 'dictionary-mouse-popup-matching-words)
(global-set-key [(control c)(d)] 'dictionary-lookup-definition)
(global-set-key [(control c)(s)] 'dictionary-search)
(global-set-key [(control c)(m)] 'dictionary-match-words)
;; choose a dictionary server
(setq dictionary-server "localhost")
;; for dictionary tooltip mode
;; choose the dictionary: "wn" for WordNet
;; "web1913" for Webster's Revised Unabridged Dictionary(1913)
;; so on
(setq dictionary-tooltip-dictionary "wn")
(global-dictionary-tooltip-mode t)
;(dictionary-tooltip-mode t)
添加到你的.emacs之中
重启emacs 光标放在某一个单词上C-c d 就可以查 字典了
没有评论:
发表评论