Emacs: Enable yas-minor-mode in org-mode.
This commit is contained in:
parent
50c2ba38f1
commit
05800505f8
|
@ -1,6 +1,6 @@
|
||||||
;;; common.el --- Common settings for text files. -*- lexical-binding: t; -*-
|
;;; 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:
|
;;; Commentary:
|
||||||
|
|
||||||
|
@ -155,12 +155,20 @@
|
||||||
(if company-candidates
|
(if company-candidates
|
||||||
(company-complete-selection)
|
(company-complete-selection)
|
||||||
(yas-next-field)))
|
(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
|
:bind (:map yas-keymap
|
||||||
("<tab>" . my/tab-yas-or-company)
|
("<tab>" . my/tab-yas-or-company)
|
||||||
("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.
|
;; Install snippet-collection but don't use it.
|
||||||
(use-package yasnippet-snippets
|
(use-package yasnippet-snippets
|
||||||
|
|
Loading…
Reference in New Issue
Block a user