unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56630: (yasnippet) how to disable TAB <tab> C-i?
@ 2022-07-18 15:29 edgar
  2022-07-18 15:32 ` edgar
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: edgar @ 2022-07-18 15:29 UTC (permalink / raw)
  To: 56630

Hello,

as per: https://github.com/joaotavora/yasnippet, I am sending an e-mail 
to you to ask for help.

I really like yasnippets, because it makes my workflow more productive, 
but I have not been able to disable the autocompletion with the TAB key:

* What I have tried
(use-package yasnippet :defer t :commands (yas-minor-mode)
   :bind
   (:map
    yas-minor-mode-map
    ("TAB" . nil)
    ("<tab>" . nil)
    ;; Expand with C-c m
    ;; (how?? yas--direct-{keymaps,org-mode})
    ("C-c m". yas-expand)
    ;; Change C-S-i to navigate back
    ("ESC TAB" . yas-prev-field)
    :map
    esc-map
     ;; Disable this to enable C-S-i to navigate back
     ;; (previously defined in bindings.el)
     ("\t" . nil)))

(with-eval-after-load 'yasnippet
   (setq yas-snippet-dirs (list "~/snippets/"))
   (yas--load-snippet-dirs)
   ;; allow to insert a snippet within a snippet
   (setq yas-triggers-in-field t)
   ;; Testing (above)
   ;; ;; Change trigger key
   ;; (define-key yas-minor-mode-map (kbd "C-i") nil)
   ;; (define-key yas-minor-mode-map (kbd "C-c m") 'yas-expand)
   ;; (define-key yas-minor-mode-map [(tab)]        nil)
   ;; (define-key yas-minor-mode-map (kbd "TAB")    nil)
   ;; (define-key yas-minor-mode-map (kbd "<tab>")  nil)
   )

* Current behaviour
1. I launch a snippet with C-c m
2. Inside, I type the name of another snippet, for clarity, assume it is 
tuk
3. I type [TAB], C-i
4. tuk gets expandedtuk

* Expected behaviour
1. I launch a snippet with C-c m
2. Inside, I type the name of another snippet, for clarity, assume it is 
tuk
3. I type [TAB], C-i
4. I get out of ttukhe first snippet (tuk does not get expanded).

tuk is this:
# -*- mode: snippet -*-
# name: latex-inline
# key: tuk
# expand-env: ((yas-indent-line 'fixed))
# --
\\($1\\)$0

How do I configure yasnippet so that snippets get expended with C-c m 
*only*? Thanks!

-------------------------------------------------
This free account was provided by VFEmail.net - report spam to abuse@vfemail.net
 
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-11-08 14:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 15:29 bug#56630: (yasnippet) how to disable TAB <tab> C-i? edgar
2022-07-18 15:32 ` edgar
2022-07-18 15:34   ` bug#56630: Fwd: " edgar
2022-07-23  8:05 ` bug#56630: " Lars Ingebrigtsen
2022-07-24 17:07   ` edgar
2022-07-26 12:07     ` Lars Ingebrigtsen
2022-07-31 22:32       ` Noam Postavsky
2022-08-01 20:00         ` edgar
2022-11-08 14:09 ` edgar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-08 14:10   ` edgar via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).