yasnippet

Yasnippet: How to expand on “ or” but not on “-or”

谁说胖子不能爱 提交于 2019-12-12 18:46:55
问题 Title says it, is it possible to alter yasnippets behavior so that it is not possible to expand on "-or" but it is possible to expand on "[newline]or" or "[tab]or" only? I would like this because I am trying to expand my yasnippets automatically when expansion is possible, and there is only ever confliction when I am writing variable names. 回答1: I got the solution here: http://ergoemacs.org/emacs/emacs_tip_yasnippet_expand_whole_hyphenated_word.html There is variable (defvar yas-key-syntaxes

Unset 'Tab' binding for yasnippet?

醉酒当歌 提交于 2019-12-01 17:52:10
The Tab keybinding of yasnippet often overwrites other useful keys. Is there a way to disable Tab binding of Yasnippet to enable other Tab usage? These will remove yasnippet's key binding: (define-key yas-minor-mode-map [(tab)] nil) (define-key yas-minor-mode-map (kbd "TAB") nil) Should work. Or you can bind tab to another command. I'm late for the party but came upon the accepted answer in this question which... didn't work. Experimented a bit and finally found a solution. Thought I should contribute an answer that does work: ;; It is crucial you first activate yasnippet's global mode. (yas

Unset 'Tab' binding for yasnippet?

橙三吉。 提交于 2019-12-01 16:33:26
问题 The Tab keybinding of yasnippet often overwrites other useful keys. Is there a way to disable Tab binding of Yasnippet to enable other Tab usage? 回答1: These will remove yasnippet's key binding: (define-key yas-minor-mode-map [(tab)] nil) (define-key yas-minor-mode-map (kbd "TAB") nil) Should work. Or you can bind tab to another command. 回答2: I'm late for the party but came upon the accepted answer in this question which... didn't work. Experimented a bit and finally found a solution. Thought

About auto complete and yasnippet in emacs

微笑、不失礼 提交于 2019-11-30 19:25:51
I'm using auto-complete and yasnippet in Emacs and I am confused by their settings. I placed the following code in my .emacs : (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") (require 'yasnippet) (yas/global-mode 1) (global-set-key (kbd "C-i") 'yas/expand) (setq yas/also-auto-indent-first-line t) (add-to-list 'load-path "~/.emacs.d/plugins/autocomplete/") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/autocomplete/ac-dict") (ac-config-default) (setq ac-use-menu-map t) (define-key ac-menu-map "\C-n" 'ac-next) (define-key ac-menu-map "\C-p"

About auto complete and yasnippet in emacs

久未见 提交于 2019-11-30 03:51:43
问题 I'm using auto-complete and yasnippet in Emacs and I am confused by their settings. I placed the following code in my .emacs : (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") (require 'yasnippet) (yas/global-mode 1) (global-set-key (kbd "C-i") 'yas/expand) (setq yas/also-auto-indent-first-line t) (add-to-list 'load-path "~/.emacs.d/plugins/autocomplete/") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/autocomplete/ac-dict") (ac-config