vscode的使用(高亮、搜索、代码同步、svn操作等)

资源:https://download.csdn.net/download/qq_39660930/93054646
1、安装vscode或者trae(字节AI版本)
2、安装高亮插件(rsbondi.highlight-words-0.1.4.vsix)并配置
(1)、crtl shift p,输入settings.json,打开用户json配置
修改或增加:

    "highlightwords.colors": [
        {"dark": "yellow" },
        {"dark": "Cyan" },
        {"dark": "Pink" },
        {"dark": "LightGreen" },
        {"dark": "LightSteelBlue" },
        {"dark": "Plum" }
    ],
    "highlightwords.box": {
        "light": true,
        "dark": false
    },
    "highlightwords.defaultMode": 0,
    "highlightwords.showSidebar": true,

(2)、crtl shift p,输入 Highlight Toggle Current,然后修改对应的快捷键为F8
(3)、crtl shift p,输入 Highlight Remove All,然后修改对应的快捷键为Shift F8
(4)、关闭vscode自带的单词高亮,settings.json修改或增加:

    "editor.occurrencesHighlight": "off",

(5)、修改vscode搜索时的单词高亮,settings.json修改或增加:

    "workbench.colorCustomizations": {
        // 当前选中的匹配项(光标所在位置)背景色设为透明
        "editor.findMatchBackground": "#00000000",
        // 其他非当前匹配项的背景色设为透明
        "editor.findMatchHighlightBackground": "#00000000", 
        // 当前选中的匹配项(光标所在位置)边框颜色
        "editor.findMatchBorder": "#FF0000",
        // 其他非当前匹配项的边框颜色
        "editor.findMatchHighlightBorder": "#FF8800"
    },

3、搜索快捷键配置
(1)、crtl shift p,输入查找下一个,修改editorFocus、editorFocus && findInputFocussed为F4
(2)、crtl shift p,输入查找上一个,修改editorFocus、editorFocus && findInputFocussed为F3
4、global配置
(1)、将global的bin目录添加到系统环境变量后,重启IDE
(2)、安装插件 C/C++ GNU Global(vscode-gnu-global-0.3.5.vsix)
(3)、扩展设置:Auto Update:Disabled,Completion:Disabled
(4)、全局重建:crtl shift p,输入 rebuild database,选择gtags,然后设置为Alt Shift A。
(5)、增量重建设置为Alt Shift S:
crtl shift p,输入Tasks: 打开用户任务 → 选 Create tasks.json file from template → Others

    "tasks": [
        {
            "label": "GNU Global: Update (global -u)",
            "type": "shell",
            "command": "global",
            "args": ["-u"],
            "options": {
                "cwd": "${workspaceFolder}"   // 强制在项目根目录执行
            },
            "problemMatcher": [],
            "group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
        }
    ]

crtl shift p,输入键盘快捷键,打开keybindings.json

    {
        "key": "alt+shift+s",          // 你喜欢的组合键
        "command": "workbench.action.tasks.runTask",
        "args": "GNU Global: Update (global -u)"
    },

命令运行失败:管理员PowerShell执行 Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
5、在资源管理器打开
tasks.json增加:

        {
			"label": "explorer",
			"type": "shell",
			"command": "explorer",
			"args": ["/select,${file}"],
			"options": {},
			"problemMatcher": [],
			"group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
		}

keybindings.json增加:

    {
		"key": "alt+1",
		"command": "workbench.action.tasks.runTask",
		"args": "explorer"
    },

6、svn操作
tasks.json增加:

		{
			"label": "SVN Diff (Current File)",
			"type": "shell",
			"command": "D:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe",
			"args": [
				"/command:diff",
				"/path:${file}"
			],
			"problemMatcher": [],
			"group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
		},
		{
			"label": "SVN Show Log (Current File)",
			"type": "shell",
			"command": "D:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe",
			"args": [
				"/command:log",
				"/path:${file}"
			],
			"problemMatcher": [],
			"group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
		},
		{
			"label": "SVN Show Log (Workspace)",
			"type": "shell",
			"command": "D:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe",
			"args": [
				"/command:log",
				"/path:${workspaceFolder}"
			],
			"problemMatcher": [],
			"group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
		},
		{
			"label": "SVN Commit (Workspace)",
			"type": "shell",
			"command": "D:\\Program Files\\TortoiseSVN\\bin\\TortoiseProc.exe",
			"args": [
				"/command:commit",
				"/path:${workspaceFolder}"
			],
			"problemMatcher": [],
			"group": "none",
            "presentation": {
                "reveal": "never",
                "focus": false
            }
		}

keybindings.json增加:

    {
		"key": "alt+2",
		"command": "workbench.action.tasks.runTask",
		"args": "SVN Diff (Current File)"
    },
    {
		"key": "alt+3",
		"command": "workbench.action.tasks.runTask",
		"args": "SVN Show Log (Current File)"
    },
    {
		"key": "alt+4",
		"command": "workbench.action.tasks.runTask",
		"args": "SVN Show Log (Workspace)"
    },
    {
		"key": "alt+5",
		"command": "workbench.action.tasks.runTask",
		"args": "SVN Commit (Workspace)"
    },

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员阿周

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值