Skip to content

elken/yasnippet-capf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

yasnippet-capf

A simple capf (Completion-At-Point Function) for completing yasnippet snippets.

Install

Manual

Download somewhere and add to your load-path and add yasnippet-capf to completion-at-point-functions.

use-package

For Doom specifically use the following and use use-package! instead.

packages.el

(package! yasnippet-capf
  :recipe (:host github :repo "elken/yasnippet-capf"))

Use the below recipe for use-package managers

(use-package yasnippet-capf
  :after cape
  :config
  (add-to-list 'completion-at-point-functions #'yasnippet-capf))

If you’re struggling to get completions using this approach, or you only want them available in certain modes, you might have better luck instead registering a hook.

(use-package yasnippet-capf
  :after cape
  :init
  (defun my/yasnippet-capf-h ()
    (add-to-list 'completion-at-point-function #'yasnippet-capf))
  :hook
  (emacs-lisp-mode . my/yasnippet-capf-h))

Configuration

The following options are available to customise:

yasnippet-capf-lookup-by

Which lookup method to use to query snippets. By default, this uses the key to query against but if preferred you can also set this to use the name of the snippet.

(setq yasnippet-capf-lookup-by 'name) ;; Prefer the name of the snippet instead

About

Completion-At-Point Extension for YASnippet

Topics

Resources

License

Stars

Watchers

Forks