高逼格程序员:提高visual studio炫技攻略

.NET
484
0
0
2022-07-28
标签   .NET程序员

高逼格程序员:提高visual studio炫技攻略

工欲善其事,必先利其器。

很多人认为,visual studio是最牛逼的编译器。也有很多人吐槽,visual studio过于庞大,不够精简,其中就包括比尔盖茨对自家产品的吐槽。这里我们不去讨论visual studio是不是最好的编译器,我们这里主要是负责帮你提高visual studio的使用逼格,显得高大上一些。

另外说一下,搞visual studio编译器的团队,随便拿出几个人在Github上玩玩,搞个vs code,一不小心就搞了个第一。可见,微软就想是沉睡的雄狮,那帮工程师就想闭关修炼的高手,与世无争。

使用一个ide,最厉害的就是常用的快捷键应该炉火纯青。

  • VS常用来提高逼格的快捷键:

1 代码自动对齐

ctrl + k + f

2 调用智能提示

ctrl +j 或 ctrl+->

3 快速隐藏或显示当前代码段

ctrl + m + m

4 注释

ctrl + k + c

5 取消注释

ctrl + k + u

  • 统计出VS整个工程的行数

1.鼠标停靠在你的项目解决方案附近

2.组合键:ctrl + shift + F

3.出现查找和替换选项卡 输入b*[^:b#/]+.*$ 查找选项选 :正则表达式

  • 改变visual studio配色方案

你是不是被一些使用Linux 系统和Mac系统的同事鄙视吗? 咱们用VS的可以搞一下:

简单调整:

工具->选项:

高逼格程序员:提高visual studio炫技攻略

这样就可以根据自己的喜好改变了,但是对于审美能力不高的程序员来说,选一个更加科学的配置方案更好一些,这里要隆重推出一个网址:

http://studiostyl.es/

例如下载:

wekeroad-ink.vssettings

接下来就是如何导入我们的vs2015了。

选择:工具->导入导出设置:

高逼格程序员:提高visual studio炫技攻略

选择:导入选定的环境变量

高逼格程序员:提高visual studio炫技攻略

选择:否,仅导入新设置,覆盖我的当前设置

高逼格程序员:提高visual studio炫技攻略

选择:浏览

高逼格程序员:提高visual studio炫技攻略

最后,大功告成,看看效果,是不是逼格上来了:

高逼格程序员:提高visual studio炫技攻略

  • 连体字(Fira code)

Fira Code ,这是一个开源的字体库,专为代码排版优化的等宽字体。

开源地址:

https://github.com/tonsky/FiraCode

clone后,找到ttf文件夹,然后安装该文件夹中的字体文件。

一定要记得重新启动vs~~~~~~~

然后进入VS,选择TOOLS->Options->Fonts and Colors,选择Fira code即可:

高逼格程序员:提高visual studio炫技攻略

下面就是炫技的效果:

高逼格程序员:提高visual studio炫技攻略

  • 多行编辑(MixEdit)

MixEdit

下载地址:

https://marketplace.visualstudio.com/items?itemName=MarcoAlamia-CodingLabs.MixEdit

MixEdit is aVisual Studio extension that allows simultaneous editing of multiple parts of the text at the same time. Making the same change several times is more frustrating thancreating multiple carets to the right places and then make a single change to all of them, and MixEdit allows you to do exactely that! Renaming variables and refactoring are now simple and fast, and you can achieve bigger changes with just a few key strokes.

下载完双击安装就行:

高逼格程序员:提高visual studio炫技攻略

安装完成后,vs中就会出现

高逼格程序员:提高visual studio炫技攻略

下面开始就是炫技的效果:

高逼格程序员:提高visual studio炫技攻略

Multiple selection

Multi carets

高逼格程序员:提高visual studio炫技攻略

快捷键

  • Control + D - Select current word / Expand selection to next same word
  • Control + Shift + D - Select current word / Expand selection to next same whole word
  • Control + Alt + D - Undo the last "Select current word" command
  • Control + Shift+ K - Skip a word next time Control + D or Control + Shift + D is used
  • Control + Shift + Alt + L - Splits any selection that spans across multiple lines into separate selections per line
  • Control + Alt + W - Select all current words / Expand selection to all same words
  • Control + Alt + Shift + W - Select all current exact words / Expand selection to all exact same words
  • Alt + Click - Add new caret / Remove existing caret/selection
  • Alt + Double Click - Select the double clicked word and add the selection to the existing selections list
  • Alt + Shift + Arrow Up - Create a new caret immediately above the existing ones
  • Alt + Shift + Arrow Down - Create a new caret immediately below the existing ones