I can't get aas to work

Hello everyone. Been trying Doom for the last week, and had a good time so far, however I’ve tried to setup auto-activating snippets with the aas package from ymarco and I simply can’t get then to work. Following the guidelines on the readme and on tecosaur’s github lengthy guide, I’ve tried setting up my package-el with the following:

(package! aas :recipe (:host github :repo "ymarco/auto-activating-snippets"))

(use-package! aas
  (aas-set-snippets 'latex-mode
    :cond #'texmathp 
    "supp" "\\supp"
    "On" "O(n)")
)

My expectation is to reproduce my LaTeX workflow with neovim with auto-trigger math snippets and all that good stuff. I have the latex module enable and can run all the LaTeX commands already, and also snippets, so tab snippets work. The only thing that still doesn’t work are the auto-triggering snippets (supp and On there provided as minimal examples).

I might probably be doing something dumb, but I don’t know what. doom doctor does not return me any error or warning related to this problem specifically either.

Relevant info: My system is Arch Linux, the emacs package was just installed normally through my package manager and doom was installed by the git command with no special fiddling as well. I am using the daemon, and tried with and without the +lsp for LaTeX but no dice :frowning_face:. What am I doing wrong?


Loading data dump...

The use-package! part goes in config.el and not package.el. The only stuff in package.el should be packages to be installed which are declared using (package! ...). use-package! is for configuring these packages which is done in config.el. Also you probably want after! and not use-package! (or add the :config keyword after the package name i.e aas if you want to stick with use-package!).

2 Likes

Using use-package! in this context is correct (though yes it does need to go into the users config.el) Using config is also correct though you probably need to hook aas onto something, this can be dropped into the use package block quite simply.

  :hook (LaTeX-mode . aas-activate-for-major-mode)

or you can just use aas-global-mode

GitHub - ymarco/auto-activating-snippets: Snippets for Emacs that expand as you type here is the readme which has an example config

1 Like

@jeetelongname For some reason I couldn’t get it to work the first time using the readme config example, but now it worked. Probably because I wasn’t declaring the package in the correct place, I guess. I will accept your answer as the solution but @rahguzar helped as well. I knew it had to be something very trivial.

Thank you all, guys :slight_smile:.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.