VS Code
VS Code
VS Code(Visual Studio Code)是由微软研发的一款免费、开源的跨平台文本(代码)编辑器。几乎完美的编辑器。
官网:https://code.visualstudio.com
文档:https://code.visualstudio.com/docs
源码:https://github.com/Microsoft/vscode
本文所使用VS Code版本:1.2.0,1.3.1
如果从官网下载的vscode为英文版(1.39.2),可以安装语言包
集成Git
支持git提交
vscode默认已集成git,支持git提交,查看修改列表。

Git History
地址:https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
安装:ext install githistory
Features
- View the details of a commit, such as author name, email, date, committer name, email, date and comments.
- View a previous copy of the file or compare it against the local workspace version or a previous version.
- View the changes to the active line in the editor (Git Blame).
- Configure the information displayed in the list
- Use keyboard shortcuts to view history of a file or line
同步vs code 扩展和设置
让vs code的设置,偏好,快捷键设置,扩展等等数据在多台机器上保持同步。
把vs code的数据托管在github的gist服务器,其它机器就可以同步配置和扩展。
扩展:settings sync
文档:https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync
安装:ext install code-settings-sync
1. 上传配置到gist
1、Shift + Alt + u 输入在github为vs code创建的 Personal Access Tokens,回车
2、保存 gist id
3、Shift + Alt + u 保存过一次之后,再按此快捷键就是同步数据
更换电脑之后,可以继续使用之前创建的personal access tokens
2. 下载配置到本地
1、Shift + Alt + d 打开输入框,[输入在github为vs code创建的 Personal Access Tokens,回车] vscode 1.10版本无需此步骤
2、输入 gist id
3、等待配置及扩展同步到本地

github的gist服务
创建Personal Access Tokens:https://github.com/settings/tokens
使用感受
1. github创建的Personal Access Tokens ,创建成功之后是可以再次编辑的
2. 一定要保存好 github创建的 Personal Access Tokens
2. 一定要保存好 code setting sync的gist id。这个id用于在多台机器上保持同步。
文本编辑及快捷键
多列编辑
Shift + Alt +鼠标左键
Markdown
默认已支持实时预览,我使用的vs code1.2版本
预览:Ctrl + K ,V 在右侧窗口打开预览,支持实时预览改动部分
Ctrl + Shift + V 快速预览当前文档
文档:https://code.visualstudio.com/docs/languages/markdown
配置或查看快捷键
选择 文件 - 首选项 - 键盘快捷方式 打开keybinding.json,可以修改或查看vscode的快捷键

打开命令行 (>)
Ctrl + Shift + P
常用快捷键
Ctrl + P 打开扩展管理器
Ctrl + Shift + K 删除当前行
Ctrl + B 显示/隐藏侧边栏
离线安装vs code扩展
以安装 vscode-instant-markdown 为例:https://marketplace.visualstudio.com/items?itemName=dbankier.vscode-instant-markdown
Mac & Linux
cd $HOME/.vscode/extensions
git clone https://github.com/dbankier/vscode-instant-markdown.git
cd vscode-instant-markdown
npm install
Windows
cd %USERPROFILE%\.vscode\extensions
git clone https://github.com/dbankier/vscode-instant-markdown.git
cd vscode-instant-markdown
npm install

'npm' 不是内部或外部命令…
如果你在安装时,出现上述提示,那么你需要安装nodejs
1. 打开nodejs的官网下载:https://nodejs.org/en/
2. 运行安装程序,进行安装,会自动配置环境变量和安装npm package manager
3. 再次安装vs code 扩展

vs code 扩展
1. vs code安装扩展
1、在vs code中按 Ctrl + P,打开扩展管理器
2、输入安装代码: ext install 扩展名 ,键盘选择要安装的扩展,按回车

3、安装完成后,会提示重启

2. 浏览插件库
https://marketplace.visualstudio.com/VSCode
3. csharp
地址:https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp
安装:ext install csharp
安装之后报错:The .NET CLI tools cannot be located. .NET Core debugging will not be enabled. Make sure .NET CLI tools are installed and are on the path.

4. HTML CSS Class Completion
说明:我安装的vs code默认已支持css,javascript。可检查css,html语法错误
地址:https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion
安装:ext install html-css-class-completion
5. PowerShell
地址:https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell
安装:ext install PowerShell
6. Lua
地址:https://marketplace.visualstudio.com/items?itemName=keyring.Lua
安装:ext install Lua
7. Java Snippets
地址:https://marketplace.visualstudio.com/items?itemName=tushortz.java-snippets
安装:ext install java-snippets
8. python
地址:https://marketplace.visualstudio.com/items?itemName=donjayamanne.python
安装:ext install python
9. Project Manager
功能:Manage your projects right inside Visual Studio Code. Easily access and switch between them.
使用方法
1、ctrl +shift + p 打开命令行,输入:project save ,选择Project Manager: Save Project

2、输入要保存当前工程的名字

3、查看或修改保存的工程
ctrl +shift + p 打开命令行,输入:project edit,选择Project Manager: Edit Project

project.json
[
{
"label": "simpleframework",
"description": "d:\\Unity3D\\SimpleFramework_NGUI\\Assets"
}
]
地址:https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
安装:ext install project-manager
10. Bookmarks
功能:Mark lines in the editor and easily jump to them.
地址:https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
安装:ext install Bookmarks
VS Code的更多相关文章
- Visual Studio Code 代理设置
Visual Studio Code (简称 VS Code)是由微软研发的一款免费.开源的跨平台文本(代码)编辑器,在十多年的编程经历中,我使用过非常多的的代码编辑器(包括 IDE),例如 Fron ...
- 我们是怎么做Code Review的
前几天看了<Code Review 程序员的寄望与哀伤>,想到我们团队开展Code Review也有2年了,结果还算比较满意,有些经验应该可以和大家一起分享.探讨.我们为什么要推行Code ...
- Code Review 程序员的寄望与哀伤
一个程序员,他写完了代码,在测试环境通过了测试,然后他把它发布到了线上生产环境,但很快就发现在生产环境上出了问题,有潜在的 bug. 事后分析,是生产环境的一些微妙差异,使得这种 bug 场景在线下测 ...
- 从Script到Code Blocks、Code Behind到MVC、MVP、MVVM
刚过去的周五(3-14)例行地主持了技术会议,主题正好是<UI层的设计模式——从Script.Code Behind到MVC.MVP.MVVM>,是前一天晚上才定的,中午花了半小时准备了下 ...
- 在Visual Studio Code中配置GO开发环境
一.GO语言安装 详情查看:GO语言下载.安装.配置 二.GoLang插件介绍 对于Visual Studio Code开发工具,有一款优秀的GoLang插件,它的主页为:https://github ...
- 代码的坏味道(14)——重复代码(Duplicate Code)
坏味道--重复代码(Duplicate Code) 重复代码堪称为代码坏味道之首.消除重复代码总是有利无害的. 特征 两个代码片段看上去几乎一样. 问题原因 重复代码通常发生在多个程序员同时在同一程序 ...
- http status code
属于转载 http status code:200:成功,服务器已成功处理了请求,通常这表示服务器提供了请求的网页 404:未找到,服务器未找到 201-206都表示服务器成功处理了请求的状态代码,说 ...
- Visual Studio Code——Angular2 Hello World 之 2.0
最近看到一篇用Visual Studio Code开发Angular2的文章,也是一篇入门教程,地址为:使用Visual Studio Code開發Angular 2專案.这里按部就班的做了一遍,感觉 ...
- WebStorm 2016 最新版激活(activation code方式)
WebStorm 2016 最新版激活(activation code方式) WebStorm activation code WebStorm 最新版本激活方式: 今天下载最新版本的WebStorm ...
- docker4dotnet #3 在macOS上使用Visual Studio Code和Docker开发asp.net core和mysql应用
.net猿遇到了小鲸鱼,觉得越来越兴奋.本来.net猿只是在透过家里那田子窗看外面的世界,但是看着海峡对岸的苹果园越来越茂盛,实在不想再去做一只宅猿了.于是,.net猿决定搭上小鲸鱼的渡轮到苹果园去看 ...
随机推荐
- C# 获得MP4时长
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using Sy ...
- 解决windows防火墙无法启动的问题
windows防火墙突然无法开启,找个各种方法,最后还是通过微软自动的修复工具修复的: 网址如下: https://support.microsoft.com/zh-cn/mats/windows_f ...
- Warning: Attempt to present on whose view is not in the window hierarchy!
当我想从一个VC跳转到另一个VC的时候,一般会用 - (void)presentViewController:(UIViewController *)viewControllerToPresent a ...
- Android保持屏幕常亮的方法
以前一直使用newWakeLock方法: this.powerManager = (PowerManager) this .getSystemService(Context.POWER_SERVICE ...
- 苹果IPSW文件提取软件
ipsw文件 提取系统文件 方法总结 由于修改运营商文件造成我的有锁4S无法使用移动卡了,在网上苦寻一番还是没有结果,最后萌生了从固件中提取文件的想法,于是便开始在网上搜集资料,最后文件终于提取成功并 ...
- 深入.net(文件操作)
自己进行数据的“持久化操作”: ----- 数据持久化技术:程序还运行过程中,所有的“中间数据”(加工或处理过程中数据)都存放在内存中,但内存的特点是掉电后数据无法保存,所以需要有种技术能够将存放在内 ...
- 【代码笔记】iOS-16进制颜色与UIColor互转
一,效果图 二,工程目录. 三,代码 RootViewController.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additio ...
- 理解 Statement 和 PreparedStatement
java,servlet中的PreparedStatement 接口继承了Statement,并与之在两方面有所不同:有人主张,在JDBC应用中,如果你已经是稍有水平开发者,你就应该始终以Prepar ...
- linux常用命名复习
ubuntu sysv-rc-conf 用来管理自启动项 centos chkconfig 1. ls命令ls命令是列出目录内容(List Directory Contents)的意思.运行它就 ...
- MySQL主主双机负载均衡
MySQL双机主主架构,其上辅以负载均衡设备,可以实现mysql数据库的负载均衡高性能和高可用性,负载均衡设备可以根据算法将数据库操作的负 载平均分到两台MySQL服务器上,这样对于每台服务器来说工作 ...