简体   繁体   中英

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

;; 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 ? and please tell me what to add to .emacs file for ya -snippet to use all c/c++ snippets that comes default with it?

Step One : Place the following two lines near the top of your .emacs file and restart Emacs:

(require 'package)
(package-initialize)

Step Two : Mx list-packages

Step Three : Select Yasnippet with the left mouse click and then click Install , and click Yes .

Step Four : Open up your .emacs file and place this underneath package-initialize

(require 'yasnippet)

(yas-global-mode 1)

Step Five : Restart Emacs and have fun coding. The mode-line will display yas when that minor mode is active.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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