首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使vim代码片段的console.log使用双引号而不是单引号

如何使vim代码片段的console.log使用双引号而不是单引号
EN

Stack Overflow用户
提问于 2017-12-28 08:29:30
回答 1查看 389关注 0票数 3

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

如何将默认行为从使用单引号更改为双引号?最好能在我的.vimrc文件中设置一个设置。

如果没有,那么也许可以自己修补~/.vim/bundle/vim-snippets/snippets/javascript/javascript.snippets

代码语言:javascript
复制
235 snippet cl "console.log"
236   console.log(${0});

我看不到任何单引号,我可以用双引号代替。知道怎么解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2017-12-28 13:39:56

预期的行为是:

代码语言:javascript
复制
cl               type 'cl'
<Tab>            press '<Tab>'
console.log(|);  replace the 'cl' stub with 'console.log()',
                 with the cursor between the parentheses.

在开始键入之前,您根本不应该在括号之间看到任何内容。

要么是…

  • 你有一张地图或者你自己的东西干扰了Snipmate:
代码语言:javascript
复制
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.

  • 还有一个插件干扰了Snipmate:
代码语言:javascript
复制
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.

  • 你偶然发现了一只窃听器:
代码语言:javascript
复制
1. set up a minimal reproducible case,
2. use the plugin's issue tracker to report the bug and help getting it fixed.

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48004137

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档