Giter VIP home page Giter VIP logo

Comments (4)

hlissner avatar hlissner commented on May 26, 2024

after! takes the name of a package. There is no package named snippets. If you replace it with yasnippet, then it should work.

from snippets.

recifx avatar recifx commented on May 26, 2024

I changed the line (after! snippets to (after! yasnippet but I still have the same issue. M-x menu-bar-open YASnippet>pyhton-mode for example seems to show only the snippets in the python-mode subdirectories of .doom.d/snippets and the doom-snippets repo.

I also had a couple of other questions:

  1. Is it possible to selectively disable snippets defined in the doom-snippets repo? I have a snippet with keyword fr for \frac{$1}{$2} in LaTeX mode, but fr<TAB> shows a menu with the selection from the doom-snippets repo also displayed.

  2. Can the precedence for <TAB> be yas-expand then company-complete if no snippet expansion is found? Right now the company completion popup appears on pressing <TAB>, even if the text before corresponds to a snippet keyword, and snippet expansion is often only possible if I can press <TAB> before the company delay. If that is not possible, how should I disable company mode? I tried (remove-hook 'LaTeX-mode-hook #'company!) but that seems to work only partially.

Thanks for your help.

from snippets.

hlissner avatar hlissner commented on May 26, 2024

Can the precedence for be yas-expand then company-complete if no snippet expansion is found?

This is already the case, unless you've disabled :config (default +bindings) or remapped TAB yourself.

Is it possible to selectively disable snippets defined in the doom-snippets repo?

This should also already be the case, unless you've disabled :editor snippets OR you've cloned doom-snippets to ~/.doom.d/snippets. Otherwise, if you have a private snippet in ~/.doom.d/snippets with the same name as a built-in snippet, yours will shadow the built-in one (it won't prompt about it, it'll just use yours, unless you have duplicates in your private snippet library).

from snippets.

recifx avatar recifx commented on May 26, 2024

I fixed most of the issues by disabling company-mode for tex files, as I use yasnippets and cdlatex in any case for most of the expansions, and the shadowing issue by duplicating the file from the doom repo and giving it a different trigger-key. However, snippets defined by

(after! yasnippet
  (yas-define-snippets
   'asy-mode
   '(
     ("gm" "import geometry;\n$0" "i_geometry")
     ("PI" "path ${1:P} = ${2:pA}--${3:pB};\n$0" "pathI"))))

are not recognized in asy mode, although they are when converted to individual snippets in the doom.d/snippets/asy-mode directory. As yas-define-snippets is not widely used and probably giving rise to an obscure error, I will look into converting the snippet definitions to individual files.

from snippets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.