define new keys for yas-expand

39 views
Skip to first unread message

Ronald Reynolds

unread,
Apr 20, 2017, 1:56:24 AM4/20/17
to YASnippet Discussion Group
I have used yasnippet for quite some time and now after an O.S. change and a new yasnippet install   yasnippet  20170418.351 I'm getting a different behavior which I need to fix.  
I use the following elisp expressions to define new keys "R" and "J"  for yas-expand:
 (define-key yas-minor-mode-map (kbd "<tab>") nil)
 (define-key yas-minor-mode-map (kbd "TAB") nil)
 (define-key yas-minor-mode-map (kbd "r") 'yas-expand)
 (define-key yas-minor-mode-map (kbd "j") 'yas-expand)

this has always worked well and I could still type in an R or J  unless it was following a snippet expansion key sequence, in which case it would expand the snippet.  Now after the new install the R and J will only do yas-expand.  I cannot type in R's and J's at other places like before.  Please Help.  I really need it to work that way. 

Anders Eurenius

unread,
Apr 20, 2017, 2:46:36 AM4/20/17
to YASnippet Discussion Group
That's a pretty interesting setup. I'd like to hear the answer to this too.


​cheers
Anders

Ronald Reynolds

unread,
Apr 20, 2017, 5:33:02 PM4/20/17
to YASnippet Discussion Group
I found out the solution.    in the lines such as (define-key yas-minor-mode-map (kbd "r") 'yas-expand)  I have to write yas-maybe-expand (no quote mark) instead of 'yas-expand
Reply all
Reply to author
Forward
0 new messages