0%

VSCode Tips

最近VSCode真香中…人老了就感觉不喜欢话时间再折腾一些生产工具, 当然Emacs/Vim还是用的很多,但是越来越多在source code reading 的时候会更倾向与打开vscode了。

换一种编辑器最大问题在于熟悉快捷键(反之一款好编辑器就应该让快捷键很直观,就像”The design of Everyday Everything” 中有提到的那样, 符合人们的mentor model)

分享一些不常用但很有用的快捷键, 根据个人喜好可以改一下和系统的冲突。 有新发现的会继续更新

官方的文档可以通过Ctrl-P然后输入”> help keyboard shortcuts” 获取
文档

Select

原生支持:

  1. Expand Select

    1
    Shift + Alt + RightArrow
  2. Shrink Select

    1
    Shift + Alt + LeftArrow
  3. Select In Words

    这个我一直习惯用Ctrl+Alt+Left/Right, 但是和Ubuntu的workspace切换冲突了..

    1
    Ctrl + Shift + Right/LeftArrow

    插件:

  4. “Quick and Simple Text Selection” by David Bankier. 支持更多的快速选择

    Ctrl+k 之后再按一个以下字符,可以选择被包括在其中的字符串

    1
    2
    3
    4
    5
    6
    7
    8
    Ctrl + K ' select everything between single quotes
    Ctrl + K " select everything between double quotes
    Ctrl + K ` select everything between back ticks
    Ctrl + K ( select everything inside parenthesis
    Ctrl + K ) select everything inside parenthesis and include them
    Ctrl + K [ or ] select everything between square brackets and include them
    Ctrl + K { or } select everything between curly braces and include them
    Ctrl + K < or > select everything between angle brackets and include them

Windows management

原生支持:

  1. Re-open a closed editor
    1
    Ctrl+Shift+T
    这个操作和Chrome浏览器一样, Nice~!

Text Edition

原生支持

1. Move line up/down

1
Alt + Up/DownArrow


Further Reading

  1. vscode power user tips

References

21 VSCode Shortcuts To Code Faster and Funner


欢迎在留言补充更多Tricks;)