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),可以安装语言包

1.打开“vscode” ,按快捷键“Ctrl+Shift+P”。
2.在搜索框中输入“configure language”,按回车键,如果没有安装语言包,会提示安装。
3.安装完成后,会提示重启和设置新安装的语言

集成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服务

如何看待 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的更多相关文章

  1. Visual Studio Code 代理设置

    Visual Studio Code (简称 VS Code)是由微软研发的一款免费.开源的跨平台文本(代码)编辑器,在十多年的编程经历中,我使用过非常多的的代码编辑器(包括 IDE),例如 Fron ...

  2. 我们是怎么做Code Review的

    前几天看了<Code Review 程序员的寄望与哀伤>,想到我们团队开展Code Review也有2年了,结果还算比较满意,有些经验应该可以和大家一起分享.探讨.我们为什么要推行Code ...

  3. Code Review 程序员的寄望与哀伤

    一个程序员,他写完了代码,在测试环境通过了测试,然后他把它发布到了线上生产环境,但很快就发现在生产环境上出了问题,有潜在的 bug. 事后分析,是生产环境的一些微妙差异,使得这种 bug 场景在线下测 ...

  4. 从Script到Code Blocks、Code Behind到MVC、MVP、MVVM

    刚过去的周五(3-14)例行地主持了技术会议,主题正好是<UI层的设计模式——从Script.Code Behind到MVC.MVP.MVVM>,是前一天晚上才定的,中午花了半小时准备了下 ...

  5. 在Visual Studio Code中配置GO开发环境

    一.GO语言安装 详情查看:GO语言下载.安装.配置 二.GoLang插件介绍 对于Visual Studio Code开发工具,有一款优秀的GoLang插件,它的主页为:https://github ...

  6. 代码的坏味道(14)——重复代码(Duplicate Code)

    坏味道--重复代码(Duplicate Code) 重复代码堪称为代码坏味道之首.消除重复代码总是有利无害的. 特征 两个代码片段看上去几乎一样. 问题原因 重复代码通常发生在多个程序员同时在同一程序 ...

  7. http status code

    属于转载 http status code:200:成功,服务器已成功处理了请求,通常这表示服务器提供了请求的网页 404:未找到,服务器未找到 201-206都表示服务器成功处理了请求的状态代码,说 ...

  8. Visual Studio Code——Angular2 Hello World 之 2.0

    最近看到一篇用Visual Studio Code开发Angular2的文章,也是一篇入门教程,地址为:使用Visual Studio Code開發Angular 2專案.这里按部就班的做了一遍,感觉 ...

  9. WebStorm 2016 最新版激活(activation code方式)

    WebStorm 2016 最新版激活(activation code方式) WebStorm activation code WebStorm 最新版本激活方式: 今天下载最新版本的WebStorm ...

  10. docker4dotnet #3 在macOS上使用Visual Studio Code和Docker开发asp.net core和mysql应用

    .net猿遇到了小鲸鱼,觉得越来越兴奋.本来.net猿只是在透过家里那田子窗看外面的世界,但是看着海峡对岸的苹果园越来越茂盛,实在不想再去做一只宅猿了.于是,.net猿决定搭上小鲸鱼的渡轮到苹果园去看 ...

随机推荐

  1. ie8不兼容rgba的解决

    借鉴................. 在调试ie8兼容性的问题时,发现ie8不支持rgba. 关于rgba(),即为颜色设置的方法函数,rgb代表颜色,a代表透明度. 如rgba(0,0,0,0.1 ...

  2. CRM 2015 快速抓取表单上字段

    var table='<table><tr><td>序号</td><td>字段名</td><td>Schema名称& ...

  3. [javascript svg fill stroke stroke-width x y rect rx ry 属性讲解] svg fill stroke stroke-width rect 绘制具有圆角矩形属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  4. disable-the-loopback-check-for-specific-host-names-on-all-sharepoint-web-and-application-servers/

    Microsoft has introduced new feature – Loopback Security Check in Windows Server 2003 SP1 to prevent ...

  5. 实现微信浏览器内打开App Store链接(已被和谐,失效了)

    微信浏览器是不支持打开App Store 页面的,不知道微信为什么这么做.比如你页面写 <a href=”http://itunes.apple.com/us/app/id399608199″& ...

  6. Android 播放在线视频

    首先开启电脑上的tomcat,将视频文件放在Tomcat 7.0\webapps\ROOT中 不用修改代码,直接输入地址即可,运行如下: 播放在线视频,必须要求手机支持当前的格式,才可以播放 播放的原 ...

  7. 【代码笔记】iOS-伸缩式动画

    一,效果图. 二,代码. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the ...

  8. C中的流程控制

    一. 流程控制 l 顺序结构:默认的流程结构.按照书写顺序执行每一条语句. l 选择结构:对给定的条件进行判断,再根据判断结果来决定执行哪一段代码. l 循环结构:在给定条件成立的情况下,反复执行某一 ...

  9. Android实用代码七段(五)

      前言  每次分享意味着每次都有进步,本系列以实用为主,欢迎和我分享和推荐好用的代码段~~ 声明 欢迎转载,但请保留文章原始出处:)  博客园:http://www.cnblogs.com 农民伯伯 ...

  10. 【原】iOS优秀开源项目总结

    网上此类帖子博客不少,不过自己没整理过的东西始终是别人,现开此贴加以总结,持续更新!站在巨人的肩膀上才能站得高看得远. 第一部分:UI类 1.毛玻璃模糊效果 RNFrostedSidebar 一个iO ...