简体   繁体   English

在emacs 23中手动安装ya-snippet

[英]installing ya-snippet in emacs 23 manualy

I an new to emacs...so i was trying to install ya-snippets for this first i downloaded the ya-snippet tar file and then uzipped it and then kept it .emacs.d/packages/ and then added the following code to my .emacs file 我是emacs的新手...所以我尝试为此安装ya-snippets,首先我下载了​​ya-snippet tar文件,然后解压缩,然后将其保存为.emacs.d / packages /,然后将以下代码添加到我的.emacs文件

;; yasnippet                                                                    
(add-to-list 'load-path                                                         
          "~/.emacs.d/packages/yasnippet")                                  
(require 'yasnippet)
(yas-global-mode 1)

but my obtaining the following error ... 但我得到以下错误...

Warning (initialization): An error occurred while loading `/home/nitesh/.emacs':

Symbol's function definition is void: yas-global-mode

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

please tell me the error and as i am new to emacs and please tell what each line is doing my .emacs file written to configure yasnippet ? 请告诉我错误信息,因为我是emacs的新手,请告诉我每一行正在执行我的.emacs文件,该文件编写为配置yasnippet吗? and please tell me what to add to .emacs file for ya -snippet to use all c/c++ snippets that comes default with it? 并请告诉我要添加到.emacs文件中的ya -snippet,以使用默认附带的所有c / c ++代码段吗?

Step One : Place the following two lines near the top of your .emacs file and restart Emacs: 第一步 :将以下两行放在.emacs文件顶部附近,然后重新启动Emacs:

(require 'package)
(package-initialize)

Step Two : Mx list-packages 第二步Mx list-packages

Step Three : Select Yasnippet with the left mouse click and then click Install , and click Yes . 第三步 :用鼠标左键选择Yasnippet ,然后单击Install ,然后单击Yes

Step Four : Open up your .emacs file and place this underneath package-initialize 第四步 :打开您的.emacs文件,并将其放在package-initialize

(require 'yasnippet)

(yas-global-mode 1)

Step Five : Restart Emacs and have fun coding. 第五步 :重新启动Emacs并享受有趣的编码。 The mode-line will display yas when that minor mode is active. 当次要模式处于活动状态时,模式行将显示yas

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM