工具安装
vscode配置
- 常用快捷键配置
设置-Keyboard Shortcuts,右上角进入json文件// Place your key bindings in this file to override the defaultsauto[] [ { "key": "ctrl+x", "command": "-editor.action.clipboardCutAction", "when": "textInputFocus && !editorReadonly" }, { "key": "ctrl+v", "command": "editor.action.clipboardPasteAction", "when": "textInputFocus && !editorReadonly" }, { "key": "ctrl+d", "command": "editor.action.deleteLines", "when": "editorTextFocus" }, { "key": "f12", "command": "editor.action.revealDefinitionAside", "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor" }, { "key": "ctrl+k f12", "command": "-editor.action.revealDefinitionAside", "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor" }, { "key":"ctrl+shift+/", "command": "editor.action.blockComment", "when": "editorTextFocus" } ]
- 字体大小设置
设置-Settings,右上角进入json文件
修改侧边栏字体大小:"editor.fontSize": 18, "terminal.integrated.fontSize": 18, "editor.tabSize": 4,
打开VSCode安装目录下的如下文件:VSCode\resources\app\out\vs\workbench\workbench.desktop.main.css
查找.part>.content - 常用插件
ESlint Vetur
Git History
GitLens //可以查看鼠标停留位置的代码提交信息
open in browser
Prettier //保存自动格式化代码 - 自动生成模板配置
设置-User Snippets-搜索vue.json{ "BaseTemp for Vue": { "prefix": "tem", "body": [ "<template>", "<div class=\"$1$TM_FILENAME_BASE-container\">", " $TM_FILENAME_BASE", "</div>", "</template>", "", "<script>", "export default {", " name: '$TM_FILENAME_BASE',", "", "}", "</script>", "", "<style lang='less' scoped>", " .$1$TM_FILENAME_BASE-container {", " ", " }", "</style>", ], "description": "BaseTemp for Vue" } }
yarn安装
- npm安装:npm i yarn -g
- 当npm install yarn –g 全局安装yarn之后,输入yarn install报错,解决:
搜索powershell,右键以管理员身份运行,执行:set-ExecutionPolicy RemoteSigned,选择是(Y)或者全是(A)
查看执行策略:get-ExecutionPolicy,执行策略更改为 RemoteSigned
git拉取代码
- https方式:可以不用去git网站上配置SSH Key,但是克隆、提交和拉取分支代码都需要输入用户名和密码,比较麻烦(新手推荐用这个)。
- SSH方式:可以免密登录,git拉取代码和提交分支都可以免密,但是要去git网站上配置SSH Key,添加自己生产的公钥。
(1)配置用户名:git config --global user.name “fantasy”
配置邮箱:git config --global user.email “2928361059@qq.com”
(2)生成公钥和私钥:ssh-keygen -t rsa -C “2928361059@qq.com”
按3次Enter
(3)查看公玥:cat ~/.ssh/id_rsa.pub
(4)gitlab添加公玥:个人-settings-SSH Keys
(5)测试配置是否正常:ssh -T git@192.168.1.105
nvm安装
- 安装前卸载已安装的nodejs
- 下载地址:https://github.com/coreybutler/nvm-windows/releases
选择nvm-setup.zip安装 - 解压之后安装,默认是C盘,可自定义安装路径
- 找到安装文件,在settings.txt文件里添加以下两行命令:
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/ - 管理员身份运行cmd
nvm -v :查看版本号
nvm list 或 nvm ls :查看已安装的node版本
nvm list available : 显示所有可下载的版本
nvm install 版本号 :安装指定node版本
nvm use 版本号 :切换到指定版本号
nvm current :查看当前使用的版本
nvm uninstall 版本号 :删除指定node版本