vscode操作笔记
ctrl shif p 打开命令窗口
修改vscode左边搜索框或者文件名字显示的字体的方法(设置里面不包含,只有自己改css文件)
找到workbench.desktop.main.css文件,修改以下属性
.monaco-workbench .part>.content{font-size:14px;font-family:'YouYuan'}
我使用的插件有
C/C++
C/C++ Extension Pack
C/C++ Themes
Bookmarks
Search in Current File Plus
background-cover
Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code
highlight-words
Power Mode
Remote - SSH
Remote - SSH: Editing Configuration Files
Remote Explorer
跳转不到变量函数的定义是由于没有添加对应的文件路径
ctrl shift p修改c_cpp_properties.json文件增加相应的跳转地址,就可以实现两个文件关联解析
一般我用的是
"${workspaceFolder}/**",
"${workspaceFolder}/../BlowSnow/source/",
"${workspaceFolder}/../UniServerCommon/Version5Protocol",
"${workspaceFolder}/../UniServerCommon/ServerCommon/BackMode/"
Vscode程序可跑可编译但是出现“未定义标识符”
ctrl + p
打开settings.json文件
{
"makefile.extensionOutputFolder": "./.vscode",
"C_Cpp.errorSquiggles": "disabled",
"[cpp]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"editor.quickSuggestions": {
"other": "on",
"comments": "off",
"strings": "off"
}
},
"[c]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"editor.quickSuggestions": {
"other": "on",
"comments": "off",
"strings": "off"
}
}
个人设置习惯settings.json
{
// "workbench.colorTheme": "Visual Studio Light",
// "remote.SSH.remotePlatform": {
// "192.168.220.128": "linux"
// },
"git.ignoreLegacyWarning": true,
// "terminal.integrated.fontFamily": "Consolas, 'Courier New', monospace",
"terminal.integrated.fontFamily": "YouYuan",
// 控制字体系列。
"editor.fontFamily": "Fira Code Retina",
// 启用字体连字
"editor.fontLigatures": true,
// 以像素为单位控制字号。
"editor.fontSize": 15,
// 控制字体粗细。
"editor.fontWeight": "551",
"editor.codeLensFontFamily": "Fira Code Retina",
"editor.inlayHints.fontFamily": "Fira Code Retina",
"editor.unicodeHighlight.nonBasicASCII": false,
"workbench.startupEditor": "none",
"security.workspace.trust.untrustedFiles": "open",
"markdown.preview.fontFamily": "-apple-system, Fira Code Retina, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",
"files.autoGuessEncoding": true,
"search.showLineNumbers": true,
"workbench.sideBar.location": "left",
"workbench.colorCustomizations": {
"[Default Light+]": {
"editor.selectionHighlightBackground": "#13b5f5",
"editor.selectionBackground": "#13b5f5",
"editor.background": "#C7EDCC",
"editorGutter.background": "#C7EDCC",
"editorCursor.foreground": "#ff0000",
"editor.lineHighlightBorder": "#006eff",
"editor.findRangeHighlightBackground": "#1c2e3f",
"editor.symbolHighlightBackground": "#fffb00",
//工作区设置---工作区值的是行,列,刻个,字符编码的那一小栏
"statusBar.background": "#C7EDCC",
"statusBar.foreground": "#1c2e3f",
//状态栏设置---状态栏值的是工作区左边的那一小段
"statusBarItem.remoteBackground": "#C7EDCC",
"statusBarItem.remoteForeground": "#1c2e3f",
//活动栏设置---活动栏指的是,最左边搜索图标,文件图标,远程图标,leetcode图标的那一栏
"activityBar.activeBackground": "#077eee", //活动项的活动栏背景颜色
"activityBar.border": "#1c2e3f", //活动栏分隔侧边栏的边框颜色
"activityBar.background": "#C7EDCC", //活动栏背景色(背景色是指活动栏字体或者图标所处的位置的颜色)
"activityBar.foreground": "#fffb00", //活动栏前景色(前景色是指活动栏字体或者图标的颜色)
"activityBar.activeBorder": "#fffb00", //活动项的活动栏边框颜色
"activityBar.inactiveForeground": "#1c2e3f", //活动栏项在非活动时的前景色
//活动选项卡设置----活动选项卡值的是打开的文件,比如settings.Json文件
"tab.inactiveForeground": "#1c2e3f", //打开了但是没看的文件名字的颜色
"tab.inactiveBackground": "#C7EDCC", //打开了但是没看的文件名标签背景的颜色
"tab.activeBackground": "#75a0d8", //选中的搜索框等的颜色
"tab.activeForeground": "#fffb00", //打开了正在看的文件的名字的颜色
"tab.border": "#1c2e3f", //于将选项卡彼此分隔开的边框
//侧边栏设置-----侧边栏指的是活动栏和打开的文件窗口中间的那一栏,也就是显示文件名字的那一栏
"sideBar.background": "#C7EDCC", //侧边栏背景色
"sideBar.border": "#1c2e3f", //侧边栏分隔编辑器的边框颜色
"sideBar.dropBackground": "#1c2e3f", //
"sideBar.foreground": "#1c2e3f", //侧边栏前景色
"sideBarTitle.foreground": "#1c2e3f", //侧边栏标题前景色
"sideBarSectionHeader.foreground": "#1c2e3f", //侧边栏部分标题前景色
//导航路径设置---导航路径值的是你在文件名字下面看函数名字的那一栏
"breadcrumb.background": "#C7EDCC",
//菜单项设置--菜单是点击设置,文件,编辑没选择,查看等按钮
"menu.background": "#C7EDCC", //菜单项的背景颜色
"menu.selectionBorder": "#ff0000", //菜单中所选菜单项的边框颜色
"menu.border": "#1c2e3f", //菜单的边框颜色
"menu.foreground": "#1c2e3f", //菜单项的前景颜色
// "menu.selectionBackground": "#ff0000",
// "menu.selectionForeground": "#ff0000",
"menu.separatorBackground": "#1c2e3f", //菜单中分隔线的颜色
//迷你地图设置--迷你地图是指文件和右边文件进度条中间的那个长条的,显示当夜文件进度的长矩形
"minimap.background": "#C7EDCC", //迷你地图背景颜色
//标题栏设置--标题栏值的是最上边文件,编辑,选择,查看那一栏
"titleBar.border": "#1c2e3f", //标题栏边框颜色
"titleBar.activeBackground": "#C7EDCC", //窗口处于活动状态时的标题栏背景色
"titleBar.activeForeground": "#1c2e3f", //窗口处于活动状态时的标题栏前景色
"titleBar.inactiveBackground": "#C7EDCC", //窗口处于非活动状态时的标题栏背景色
"titleBar.inactiveForeground": "#1c2e3f", //窗口处于非活动状态时的标题栏前景色
//输入框设置,输入框指的是ctrl f等打开的框
"input.background": "#C7EDCC",
"input.border": "#C7EDCC", //输入框边框
"input.foreground": "#1c2e3f", //输入框前景色
"inputOption.activeBorder": "#1c2e3f", //输入字段中已激活选项的边框颜色
"inputOption.activeForeground": "#1c2e3f", //输入字段中已激活的选项的前景色
"editorWidget.background": "#C7EDCC", //ctrl F跳出的搜索框的外圈的背景
"editorWidget.border": "#1c2e3f", //编辑器小部件的边框颜色
"editorWidget.foreground": "#1c2e3f", //编辑器小部件的前景色
"editorWidget.resizeBorder": "#C7EDCC", //编辑器小部件大小调整条的边框颜色
//其他
"foreground": "#1c2e3f", //左边列出的文件名名字,输入的字符等等的颜色
"icon.foreground": "#1c2e3f", //工作台中图标的默认颜色
}
},
"editor.tokenColorCustomizations": {
"[Default Light+]": {
"comments": "#0c9c18",
"strings": "#b500bb",
"functions": "#0025fa",
"keywords": "#a200ff",
"variables": "#000000",
"numbers": "#e21d1d",
"textMateRules": [
{
"name": "Operator",
"scope": "keyword.operator",
"settings": {
"foreground": "#e21d1d",
"fontStyle": "bold"
}
},
{
"name": "Punctuation",
"scope": "punctuation",
"settings": {
"foreground": "#a207fc",
"fontStyle": "bold"
}
}
],
}
},
"editor.gotoLocation.multipleDefinitions": "gotoAndPeek",
"editor.gotoLocation.multipleTypeDefinitions": "gotoAndPeek",
"editor.definitionLinkOpensInPeek": true,
"update.mode": "none",
"update.enableWindowsBackgroundUpdates": false,
"powermode.enabled": true,
"powermode.presets": "simple-rift",
"powermode.explosions.duration": 100,
"powermode.shake.intensity": 0,
"powermode.shake.enabled": false,
"powermode.combo.location": "off",
"powermode.combo.counterEnabled": "hide",
"workbench.colorTheme": "Default Light+",
"remote.SSH.remotePlatform": {
"192.168.220.128": "linux"
},
"html.format.enable": false,
"C_Cpp.formatting": "vcFormat",
"security.workspace.trust.enabled": false,
"highlightwords.colors": [
{
"light": "#ff0000",
"dark": "red"
},
{
"light": "#ff7d00",
"dark": "orange"
},
{
"light": "#ffff00",
"dark": "yellow"
},
{
"light": "#00ff00",
"dark": "green"
},
{
"light": "#0000ff",
"dark": "blue"
},
{
"light": "#00ffff",
"dark": "cyan"
},
{
"light": "#ff00ff",
"dark": "purple"
},
{
"light": "#ffffff",
"dark": "white"
}
],
"editor.minimap.enabled": false,
"C_Cpp.vcFormat.indent.accessSpecifiers": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"backgroundCover.imagePath": "e:\\svngqq\\image\\vscodeimage.jpg",
"backgroundCover.opacity": 0.5,
"backgroundCover.defaultOnlinePage": "",
}
个人快捷键设置keybindings.json
[
{
"key": "f8",
"command": "-editor.action.marker.nextInFiles",
"when": "editorFocus"
},
{
"key": "f8",
"command": "highlightwords.addHighlight"
},
{
"key": "ctrl+shift+pageup",
"command": "-workbench.action.moveEditorLeftInGroup"
},
{
"key": "ctrl+shift+pageup",
"command": "editor.action.transformToUppercase"
},
{
"key": "ctrl+shift+pagedown",
"command": "-workbench.action.moveEditorRightInGroup"
},
{
"key": "ctrl+shift+pagedown",
"command": "editor.action.transformToLowercase"
},
{
"key": "ctrl+shift+oem_minus",
"command": "workbench.action.zoomOut"
},
{
"key": "ctrl+oem_minus",
"command": "-workbench.action.zoomOut"
},
{
"key": "ctrl+shift+oem_plus",
"command": "workbench.action.zoomIn"
},
{
"key": "ctrl+oem_plus",
"command": "-workbench.action.zoomIn"
},
{
"key": "alt+left",
"command": "-workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "alt+left",
"command": "-workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "shift+enter",
"command": "editor.action.previousMatchFindAction",
"when": "editorFocus"
},
{
"key": "shift+f3",
"command": "-editor.action.previousMatchFindAction",
"when": "editorFocus"
},
{
"key": "ctrl+oem_minus",
"command": "workbench.action.navigateBack"
},
{
"key": "ctrl+oem_plus",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "alt+right",
"command": "-workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "f1 f1",
"command": "bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+k",
"command": "-bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "ctrl+f1",
"command": "bookmarks.jumpToPrevious",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+j",
"command": "-bookmarks.jumpToPrevious",
"when": "editorTextFocus"
},
{
"key": "ctrl+f2",
"command": "-editor.action.changeAll",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+f2",
"command": "bookmarks.jumpToNext",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+l",
"command": "-bookmarks.jumpToNext",
"when": "editorTextFocus"
},
{
"key": "ctrl+k ctrl+o",
"command": "-workbench.action.files.openLocalFolder",
"when": "remoteFileDialogVisible"
},
{
"key": "ctrl+k ctrl+o",
"command": "-workbench.action.files.openFolder",
"when": "openFolderWorkspaceSupport"
},
{
"key": "ctrl+k ctrl+o",
"command": "C_Cpp.SwitchHeaderSource",
"when": "editorTextFocus && editorLangId =~ /^(c|(cuda-)?cpp)$/ && !(config.C_Cpp.intelliSenseEngine =~ /^[dD]isabled$/)"
},
{
"key": "alt+o",
"command": "-C_Cpp.SwitchHeaderSource",
"when": "editorTextFocus && editorLangId =~ /^(c|(cuda-)?cpp)$/ && !(config.C_Cpp.intelliSenseEngine =~ /^[dD]isabled$/)"
},
{
"key": "shift+f",
"command": "search-in-current-file.searchInCurrentFile",
"when": "editorFocus"
},
{
"key": "ctrl+shift+f",
"command": "search-in-current-file.searchInAllFiles",
}
]