记录个人用到的 VSCode 技能。
0x1 搜索
tab 字符
无论是单个文件内搜索,还是全局搜索; 输入
后, 需要 勾选正则匹配(.*
那个icon):
0x2 搜索行尾空格字符
s$
0x3 使用GitLens插件
可以方便的查看最近commit的修改内容,对比分支等
0x4 ~/.gitconfig
中配置 VSCode 为默认编辑器:
[core]
#editor = vim
#editor = subl -n w # sublime
#editor = notepad++ -multiInst -nosession # notepad++
#editor = 'C:\Program Files (x86)\Microsoft VS Code\code.exe' -w # vscode
#editor = 'E:\soft\VSCode-Insider\Code - Insiders.exe' -w # vscode-insiders
editor = code-insiders -w # recommend VSCode with GitLens especially rebase -i moment
以后 git commit 时候编辑起来比 vim 方便多了, 例如多列编辑。 对于 rebase,由于装了 git lens 插件, 直接是 GUI 方式选择, 太方便了。
0x5 vscode cpptools 插件过大,C盘空间不足
官方说法是,里面的 ipch 缓存文件,是给 intellisense 用的, 可以设置最大大小, 也可以改存放路径:
https://code.visualstudio.com/docs/cpp/faq-cpp#_what-is-the-ipch-folder
0x6 全局搜索和替换
按大佬们的引导,新技能get
- 展开VSCode全局搜索里的“替换”
- 输入要查的typo
- 改成正确的写法
- 全局替换