Emacs: Enable yas-minor-mode in org-mode.

This commit is contained in:
tastytea 2020-08-24 01:40:30 +02:00
parent 50c2ba38f1
commit 05800505f8
1 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
;;; common.el --- Common settings for text files. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-08-22T20:54:31+0200>
;; Time-stamp: <2020-08-24T01:19:01+0200>
;;; Commentary:
@ -155,12 +155,20 @@
(if company-candidates
(company-complete-selection)
(yas-next-field)))
(yas-reload-all))
(yas-reload-all)
(defun my/string-to-var (string)
"Replace characters that usually are illegal in variable names in STRING with _."
(interactive)
(replace-regexp-in-string
"[[:space:]]" "_"
(replace-regexp-in-string "[^[:ascii:]]" "_" string))))
:bind (:map yas-keymap
("<tab>" . my/tab-yas-or-company)
("TAB" . my/tab-yas-or-company))
:hook (prog-mode . yas-minor-mode))
:hook ((prog-mode . yas-minor-mode)
(org-mode . yas-minor-mode)))
;; Install snippet-collection but don't use it.
(use-package yasnippet-snippets