Visual Studio and Visual Studio Code (vscode)

更新 : 2021-02-13

auto refresh when save 

https://dev.to/juxant/auto-refresh-with-dotnet-watch-for-asp-net-core-projects-20no

option > Project and Solution > Asp.net core > auto buuld refresh options 选 after save change

只有在 non debug mode 才管用哦

 

vs code 不需要看到 refrence 

把 editor.codeLens 关掉就可以了

 

 

更新 : 2017-03-01 

https://marketplace.visualstudio.com/items?itemName=HookyQR.beautify 

这个插件可以让 html 整理起来比较好看. 

 

调东西 : 

左上角 File -> Preferences -> Workspace Settings ( User Settings 也可以, 它是 for 所有的 project, Workspace 是针对目前这个 project )

1. hide .js, .map when use .ts 

    and node_mudules, debug.log 

     "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        // add on
        "**/node_modules/": true,
        "**/npm-debug.log*/": true,
        "**/*.js.map": true,
        "**/*.js": {"when": "$(basename).ts"}
    }

2.Zoom with mouse Wheel

 "editor.mouseWheelZoom": true   

 

2.1 scroll bar 旁边的小图

"editor.minimap.enabled": true

 

 

3.修改热键 

https://code.visualstudio.com/Docs/customization/keybindings

File > Preferences > Keyboard Shortcuts. (Code > Preferences > Keyboard Shortcuts on Mac)

// Place your key bindings in this file to overwrite the defaults
[
    { 
        "key": "ctrl+l",
        "command": "editor.action.deleteLines",
        "when": "editorTextFocus && !editorReadonly"
    },
    { 
        "key": "ctrl+k ctrl+f",
        "command": "editor.action.format",
        "when": "editorHasFormattingProvider && editorTextFocus && !editorReadonly" 
    },  
    { 
        "key": "ctrl+w",   //本来是 ctrl+d, 而本来的 ctrl+w 是close window (看左边参考)
        "command": "editor.action.addSelectionToNextFindMatch",
        "when": "editorFocus"
    }     
]


// Fold (Ctrl+Shift+[) folds the innermost uncollapsed region at the cursor
// Unfold (Ctrl+Shift+]) unfolds the collapsed region at the cursor
// Fold All (Ctrl+K Ctrl+0) folds all region in the editor
// Unfold All (Ctrl+K Ctrl+J) unfolds all regions in the editor

 

 

4. 常用 hotkeys (vscode and vs2015)

 
ctrl enter / ctrl shift enter 插入空行
ctrl w               select current full text 
ctrl k f                            整理代码
ctrl l             delete row 
ctrl .             c# auto quick namespace
ctrl space          智能提示
ctrl shift m          打开 error list
ctrl up donw        scrool
ctrl shift s         save all document
ctrl h            replace string
shift f12         找指针
 
vs code only
ctrl shift { = vs2015 里面的 ctrl + m + m 把{...}收起来
 
vs2015 only
ctrl k d = 整面整理代码
 
 
5.TypeScript version 
refer : http://stackoverflow.com/questions/39668731/what-typescript-version-is-visual-studio-code-using-how-to-update-it
要知道当前使用的 version 可以打开一个 .ts file 看右下角
要全场升级或者单个特定版本参考上面链接 
 
 
6. 开发 angular2 常用插件 : 
-https://marketplace.visualstudio.com/items?itemName=danwahlin.angular2-snippets 
-https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory
 

 

posted @ 2016-09-13 18:37  兴杰  阅读(881)  评论(0编辑  收藏  举报