3

cl <TAB> outputs console.log(': ', );

How do I change the default behavior from using single quotes to double? It would be best if I can set a setting in my .vimrc file.

If not then perhaps it is possible to patch ~/.vim/bundle/vim-snippets/snippets/javascript/javascript.snippets myself:

235 snippet cl "console.log"
236   console.log(${0});

I could not see any single quotes that I could replace with double. Any idea how this can be fixed?

martins
  • 9,669
  • 11
  • 57
  • 85

1 Answers1

2

The expected behaviour is:

cl               type 'cl'
<Tab>            press '<Tab>'
console.log(|);  replace the 'cl' stub with 'console.log()',
                 with the cursor between the parentheses.

You are simply not supposed to see anything between the parentheses until you start typing.

Either…

  • You have a mapping or something of your own interfering with Snipmate:

    1. look up the output of :verbose imap, :verbose smap, and :verbose vmap,
    2. disable your mappings and autocommands to see if the problem persists.
  • You have another plugin interfering with Snipmate:

    1. disable all your plugin to see if the faulty behaviour changes,
    2. if it does, try bisecting your plugins until you find the culprit… and act accordingly.
  • You have stumbled upon a bug in Snipmate:

    1. set up a minimal reproducible case,
    2. use the plugin's issue tracker to report the bug and help getting it fixed.
romainl
  • 186,200
  • 21
  • 280
  • 313