Linux 安装VSCode
创建文件夹保存vscode
1 | mkdir /vscode |
进入目录
1 | cd /vscode |
下载linux版本的vscode 到刚创建的目录
1 | wget https: //az764295 .vo.msecnd.net /stable/f9d0c687ff2ea7aabd85fb9a43129117c0ecf519/code-stable-code_1 .9.1-1486597190_amd64. tar .gz |
解压 tar.gz文件
1 | tar –xzf code-stable-code_1.9.1-1486597190_amd64. tar .gz |
移动到/usr/local/目录
1 | sudo mv VScode-linux-x64 /usr/local/ |
给文件可执行权限
1 | chmod +x /usr/local/VSCode-linux-x64/code |
如果需要在终端任何地方启动Code,我们就需要创建/user/local/VSCode-linux-x64/code的一个链接/usr/local/bin/code
1 | ln -s /user/local/VSCode-linux-x64/code /usr/local/bin/code |
复制一个VScode图标文件到 /usr/share/icons/目录
1 | cp /usr/local/VSCode-linux-x64/resources/app/resources/linux/code .png /usr/share/icons |
创建一个桌面启动程序,文件扩展名为.desktop.
1 | vi /usr/share/applications/VSCode .desktop |
然后,粘贴下面的行到那个文件中
1 2 3 4 5 6 7 8 9 | [Desktop Entry] Name=Visual Studio Code Comment=Multi-platform code editor for Linux Exec= /usr/local/VSCode-linux-x64/code Icon= /usr/share/icons/code .png Type=Application StartupNotify= true Categories=TextEditor;Development;Utility; MimeType=text /plain ; |