VSCode tips

11.18'24

Web

vscode for the Web

Monaco Editor: vscode 底层的代码编辑器,支持web

VSCodeVim: capture group in replace

旧版本 VSCodeVim 支持的是 JavaScript 正则表达式语法 $1

新版本则支持 Vim 正则表达式语法 \1

:%s/te(.)t/$1/g

:%s/te(.)t/\1/g

VSCodeVim: newline

当前版本 1.51

  • 支持搜索 /\n...
  • 不支持替换 :s/\n/...

需要使用原始的 Vim

Extension

安装运行入门模板

使用 Yeoman 初始化模板代码。

npm i -g yo generator-code
yo code

# ? What type of extension do you want to create? New Extension (TypeScript)
# ? What's the name of your extension? HelloWorld
### Press <Enter> to choose default for all options below ###

# ? What's the identifier of your extension? helloworld
# ? What's the description of your extension? LEAVE BLANK
# ? Initialize a git repository? Yes
# ? Bundle the source code with webpack? No
# ? Which package manager to use? npm

code ./helloworld

按下 F5,会在新窗口中编译、运行扩展

打开命令窗口输入 Hello World, 可以看到消息提示

文件结构

  • package.json

    • Contribute
  • extension.ts

📖