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. JScript中的条件注释详解(转载自网络)

    JScript中的条件注释详解-转载 这篇文章主要介绍了JScript中的条件注释详解,本文讲解了@cc_on.@if.@set.@_win32.@_win16.@_mac等条件注释语句及可用于条件编 ...

  2. javascript 中 !~ 什么意思

    快过年放假了,也终于闲下来了.每天游览于各种技术文章中,这种状态好极了.下午看篇关于js的文章,其中有如下这么一段引起了我的注意. (function () { var names = []; ret ...

  3. SharePoint2013 此产品的试用期已结束

    今天使用SharePoint 2013创建页面的时候,突然提示“此产品的试用期已结束 ”. 网上解决办法: “将IIS的‘应用程序池’下网站集对应的‘宿主应用程序’的‘应用程序池标识’改为‘域管理员或 ...

  4. sqlite学习1

    Architecture  就像编译器一样,结构分为前端.虚拟机.后端 性能和限制(limitations) 使用B树来做indexes,用B+树来做table.和其他数据库一样 由于不需要鉴权.网 ...

  5. 【代码笔记】iOS-判断是否是iPhone5

    一,代码. #import "RootViewController.h" // 判断是否是iPhone5 #define iPhone5 ([UIScreen instancesR ...

  6. 【读书笔记】iOS网络-底层网络

    在iOS上,有一个库叫做Core Foundation networking或CFNetwork,它是对原始Socket的轻量级封装,不过它很快对于大多数常见场景来说变得非常笨重了.最后,添加了另一层 ...

  7. android开发练习:天气应用

    来源:网易云课堂GeekBand第七次作业 作业要求: 做一个天气应用 接口参考: http://apistore.baidu.com/apiworks/servicedetail/880.html, ...

  8. 使用PL/SQL编写存储过程访问数据库

    一.实验目的 熟悉使用存储过程来进行数据库应用程序的设计. 二.实验内容 对学生-课程数据库,编写存储过程,完成下面功能: 1.统计离散数学的成绩分布情况,即按照各分数段统计人数: 2.统计任意一门课 ...

  9. Javascript之旅——第六站:看看writable特性

    说起js中的那些特性标记,总觉得有些怪怪的,那为什么要说到这个attribute,起源于对一个问题的疑问,我们都知道window对象其实就是 浏览器窗口的一个实例,既然是一个实例,那这个实例就应该有“ ...

  10. 烂泥:linux文件同步之rsync学习(一)

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 这几天刚好有空就打算开始学习linux下的文件同步软件rsync,在学习rsync时,我们可以分以下几个步骤进行: 1. rsync是什么 2. rsy ...