| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「Visual Studio Code」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の25版が非表示)
1行目: 1行目:
 +
| [[Electron]] | [[Visual Studio]] |
 +
==[[Visual Studio Code]]==
 
{{amazon|4297112019}}
 
{{amazon|4297112019}}
==[[Visual Studio Code]]==
+
 
 
*[http://qiita.com/TakahiRoyte/items/cdab6fca64da386a690b 【Windows版】VS Code キーボードショートカット一覧]
 
*[http://qiita.com/TakahiRoyte/items/cdab6fca64da386a690b 【Windows版】VS Code キーボードショートカット一覧]
 
*[http://qiita.com/aoinu/items/681f932ce0b162cd9520 Visual Studio Code チートシート]
 
*[http://qiita.com/aoinu/items/681f932ce0b162cd9520 Visual Studio Code チートシート]
 
*[http://sourcechord.hatenablog.com/entry/2015/05/06/230003 VisualStudio Codeの各種操作メモ]
 
*[http://sourcechord.hatenablog.com/entry/2015/05/06/230003 VisualStudio Codeの各種操作メモ]
 
*https://code.[[vi]]sualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
 
*https://code.[[vi]]sualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
 
+
===キーボードショートカット===
 
[[Android Studio]]
 
[[Android Studio]]
 
====一般====
 
====一般====
16行目: 18行目:
 
|
 
|
 
|コマンドパレット
 
|コマンドパレット
 +
|-
 +
|Ctrl+k s
 +
|
 +
|キーボードショートカット一覧
 +
|-
 +
|Ctrl+ ,
 +
|
 +
|設定を開く
 
|-
 
|-
 
|}
 
|}
100行目: 110行目:
 
|Command+Shift+K
 
|Command+Shift+K
 
|行の削除
 
|行の削除
 +
|-
 +
|Ctrl+j
 +
|Command+j
 +
|行のマージ
 
|-
 
|-
 
|Ctrl+Shift+P -> Sort Lines Ascending
 
|Ctrl+Shift+P -> Sort Lines Ascending
 
|Command+Shift+P -> Sort Lines Ascending
 
|Command+Shift+P -> Sort Lines Ascending
 
|行の昇順並べ替え
 
|行の昇順並べ替え
 +
|-
 +
|Ctrl+k, Ctrl+f
 +
|Command+k, Command+f
 +
|コードフォーマット、書式整形
 +
|-
 +
|Ctrl + Space
 +
|Command+Space
 +
※ Spotlight無効化 システム環境設定 - キーボード-ショートカット - Spotlight - Spotlight検索を表示のチェックを外す
 +
|コード補完
 
|-
 
|-
 
|}
 
|}
163行目: 186行目:
 
|}
 
|}
  
====設定====
+
===設定===
=====Workspace=====
+
====Workspace====
 
*File - Preference - Settings - Workspaceタブ
 
*File - Preference - Settings - Workspaceタブ
  
=====MacでPATHを通す1=====
+
====MacでPATHを通す====
 
*以下を~/.bash_profile に追記
 
*以下を~/.bash_profile に追記
 
  export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
 
  export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"
198行目: 221行目:
 
=====実行=====
 
=====実行=====
 
  dotnet run
 
  dotnet run
 +
 +
==Extension==
 +
===Remote SSH===
 +
----
 +
*リモートのワークスペースに接続
 +
 +
[[File:vs_remote_ssh.png|600px]]
 +
===Remote Containers===
 +
----
 +
*https://techblog.roxx.co.jp/entry/2021/04/19/132838
 +
[[File:vscode_extension_remote_container.png|600px]]
 +
 +
===Rest Client===
 +
----
 +
*https://marketplace.visualstudio.com/items?itemName=humao.rest-client
 +
[[File:vscode_restclient.png|600px]]
 +
*cmd + option + r で送信
 +
*複数を区切る時には、###
 +
<pre>
 +
GET https://example.com/comments/1 HTTP/1.1
 +
 +
###
 +
 +
GET https://example.com/topics/1 HTTP/1.1
 +
 +
###
 +
 +
POST https://example.com/comments HTTP/1.1
 +
content-type: application/json
 +
 +
{
 +
    "name": "sample",
 +
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
 +
}
 +
</pre>
 +
 +
===[[PlantUML]]===
 +
====[[Mac]]====
 +
*[[Java SE|Java]]のインストール
 +
<pre>
 +
$ brew install graphviz
 +
</pre>
 +
 +
[[File:plantuml_vc.png | 600px]]
 +
*tcp.pu
 +
*option + d でプレビュー
 +
<pre>
 +
@startuml
 +
title TCP コネクション確立
 +
クライアント -> サーバ: 1.SYN
 +
サーバ --> クライアント: 2.SYN/ACk
 +
クライアント -> サーバ: 1.ACK
 +
@enduml
 +
</pre>
 +
[[File:plantuml_tcp.png | 800px]]
  
 
==[[Tips]]==
 
==[[Tips]]==
 
===[[文字コード]]自動判別===
 
===[[文字コード]]自動判別===
 
  "files.autoGuessEncoding": true
 
  "files.autoGuessEncoding": true
 +
 +
[[category:VisualStudio操作]]

2022年3月23日 (水) 13:22時点における最新版

| Electron | Visual Studio |

Visual Studio Code

キーボードショートカット

Android Studio

一般

操作(Windows) 操作(Mac) 内容
Ctrl+Shift+P コマンドパレット
Ctrl+k s キーボードショートカット一覧
Ctrl+ , 設定を開く

表示

操作(Windows) 操作(Mac) 内容
Ctrl+Q クイックオープンビュー
Ctrl+Shift+O メソッド一覧
Ctrl+B サイドバー(エクスプローラーなど)の開閉
Ctrl+Shift+E エクスプローラー
Ctrl+Shift+G ソースコード管理
Ctrl+\ Ctrl+Cmd+Option+¥ 画面分割
Ctrl+Shift+V Shft+Cmd+V Markdownをプレビュー

編集

操作(Windows) 操作(Mac) 内容
Alt+Click Option+Click マルチカーソルを追加する
Ctrl+Shift+Alt+矢印 Shift+Option+Command+矢印 矩形選択(キーボード)
Shift+Alt+ドラッグ Shift+Option+ドラッグ 矩形選択(マウス) 始点クリック→終点クリック
Ctrl+Shift+L Command+Shift+L 選択部分の全マッチを選択
Ctrl+K Ctrl+D 次のマッチに移動
Ctrl+F2 Command+F2 すべての出現箇所を変更
Ctrl+. クイック修正(波下線が表示されているエラーなど)
Alt+↑/↓ 行の移動
Shift+Alt+↑/↓ Shift+Option+↑/↓ 行のコピー
Ctrl+Shift+k Command+Shift+K 行の削除
Ctrl+j Command+j 行のマージ
Ctrl+Shift+P -> Sort Lines Ascending Command+Shift+P -> Sort Lines Ascending 行の昇順並べ替え
Ctrl+k, Ctrl+f Command+k, Command+f コードフォーマット、書式整形
Ctrl + Space Command+Space

※ Spotlight無効化 システム環境設定 - キーボード-ショートカット - Spotlight - Spotlight検索を表示のチェックを外す

コード補完

検索と置換

操作(Windows) 操作(Mac) 内容
Ctrl+K Ctrl+S キーボードショートカット一覧を表示
Ctrl+p Command+p ファイル名を検索
Ctrl+Shift+O Command+Shift+O シンボルを検索(メソッドなど)
Ctrl+P ファイルを検索して開く
Ctrl+T 全ファイルにまたがって参照検索して移動し、ファイルを開く
Ctrl+Shift+F 全ファイルから検索
Ctrl+Shift+J 検索詳細設定
Alt+C 大文字小文字区別の切り替え
Alt+R 正規表現要否の切り替え
Alt+W ワード選択の切り替え
Alt+Enter マッチ個所の全選択
Ctrl+G Ctrl+G 指定行へジャンプ

設定

Workspace

  • File - Preference - Settings - Workspaceタブ

MacでPATHを通す

  • 以下を~/.bash_profile に追記
export PATH="/Applications/Visual Studio Code.app/Contents/Resources/app/bin:$PATH"

デバッグ

Java

リファクタリング

操作 内容
メソッドの実装とオーバーライド コンテキストメニュー - Source Action - Override/Imprement methods

.NET Core

C# および Visual Studio Code の使用を開始する

シンプルなプロジェクト

プロジェクト作成
dotnet new console
ビルド
dotnet build
実行
dotnet run

Extension

Remote SSH


  • リモートのワークスペースに接続

Vs remote ssh.png

Remote Containers


Vscode extension remote container.png

Rest Client


Vscode restclient.png

  • cmd + option + r で送信
  • 複数を区切る時には、###
GET https://example.com/comments/1 HTTP/1.1

###

GET https://example.com/topics/1 HTTP/1.1

###

POST https://example.com/comments HTTP/1.1
content-type: application/json

{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}

PlantUML

Mac

  • Javaのインストール
$ brew install graphviz

Plantuml vc.png

  • tcp.pu
  • option + d でプレビュー
@startuml
title TCP コネクション確立
クライアント -> サーバ: 1.SYN
サーバ --> クライアント: 2.SYN/ACk
クライアント -> サーバ: 1.ACK
@enduml

Plantuml tcp.png

Tips

文字コード自動判別

"files.autoGuessEncoding": true