Emacs Yasnippet 安装

发布于 2024-12-17 07:29:48 字数 790 浏览 8 评论 0原文

尝试从 https://github.com/joaotavora/yasnippet 安装 yasnippet for emacs 23

首先我尝试快速安装,但用于“快速”安装的 yasnippet-bundle.el 似乎不在存储库中?

其次,我尝试了完整安装。

尝试进行完整安装时,出现以下错误:

[yas] Check your `yas/snippet-dirs': ~/.emacs.d/snippets is not a directory

我已下载最新的捆绑包 joaotavora-yasnippet-e53c41d/ 并解压到 .emacs.d/plugins/

我的“.emacs”的补充是:

(add-to-list 'load-path
              "~/.emacs.d/plugins/joaotavora-yasnippet-e53c41d")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/joaotavora-yasnippet-e53c41d/snippets")

基本上,安装说明似乎与最新的 src 不同步。有谁知道如何安装它?

trying to install yasnippet for emacs 23 from https://github.com/joaotavora/yasnippet

Firstly I attempted the quick install but the yasnippet-bundle.el for the 'quick' install doesn't seem to be in the repository?

Secondly I attempted the full install.

When trying to do the full install I get the following error:

[yas] Check your `yas/snippet-dirs': ~/.emacs.d/snippets is not a directory

I have downloaded the latest bundle joaotavora-yasnippet-e53c41d/ and unpacked in into .emacs.d/plugins/

the addition to my `.emacs' is:

(add-to-list 'load-path
              "~/.emacs.d/plugins/joaotavora-yasnippet-e53c41d")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/joaotavora-yasnippet-e53c41d/snippets")

Basically, the install instructions seem to have become out of sync with the latest src. Does anyone know how to install it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再浓的妆也掩不了殇 2024-12-24 07:29:48

您需要初始化yas/root-directory。这是我设置 yasnippet 的方法

(require 'yasnippet "~/emacs/addons/yasnippet.el")
(yas/initialize)
(setq yas/root-directory "~/emacs/snippets")
(yas/load-directory yas/root-directory)

You need to initialize yas/root-directory. Here is how I setup yasnippet

(require 'yasnippet "~/emacs/addons/yasnippet.el")
(yas/initialize)
(setq yas/root-directory "~/emacs/snippets")
(yas/load-directory yas/root-directory)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文