Ubuntu 14.04 下使用微软的跨平台轻量级开发神器 Visual Studio Code

因为 Visual Studio Code 不断更新,官方最新 v1.32 的 .deb 包已经不能用于 Ubuntu 14.04 直接安装了。

下载 v1.31 的 deb 包安装即可:https://code.visualstudio.com/updates/v1_31  (兼容 Ubuntu 14.04,并且支持 Vim 插件)

下载 v1.30 的 deb 包安装即可:https://code.visualstudio.com/updates/v1_30

如果要用最新版,在官网下载免安装版 .tar.gz : https://code.visualstudio.com/#alt-downloads

需要首先安装 libnss3,

sudo apt-get install libnss3

直接解压缩 .tar.gz 到 /opt,设置环境变量即可使用。

目前已安装的插件记录如下: (Version: 1.32.3)

 

Atom One Dark Theme

Atom One Light Theme

Auto Close Tag

Auto Rename Tag

Beautify

Bracket Pair Colorizer

C/C++

Code Runner

Dracula At Night

Dracula Theme

ESLint

Git History

GitLens

HTML Boilerplate

JS-CSS-HTML Formatter  (x)

Path Autocomplete

Path intellisense

Python

Python Extension Pack

Vim  (v1.32)

vimStyle  (v1.30)

 

暂时这些,其它可参考这里: 

https://blog.csdn.net/shenxianhui1995/article/details/81604818

https://blog.csdn.net/win7583362/article/details/79315055/

 

X1. 插件的配置

File -> Preferences -> Settings -> User Settings -> Extensions -> Run Code configurations -> Executor Map (Edit in settings.json)

例如,

{
    "workbench.colorTheme": "Default Light+",
    "editor.fontFamily": "'ubuntu mono', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
    "editor.fontSize": 18,
    "editor.minimap.enabled": false,
    "editor.rulers": [
        120
    ],
    "files.autoSave": "off",
    "update.enableWindowsBackgroundUpdates": false,
    "update.mode": "manual",
    "update.showReleaseNotes": false,

    "code-runner.executorMap": {
        "javascript": "node",
        // "php": "C:\\php\\php.exe",
        "python": "python3",
        // "perl": "perl",
        // "ruby": "C:\\Ruby23-x64\\bin\\ruby.exe",
        // "go": "go run",
        "html": "/usr/bin/firefox",
        // "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
        "c": "cd $dir && clang $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "cpp": "cd $dir && clang++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    },
    "code-runner.clearPreviousOutput": true,
    "code-runner.saveFileBeforeRun": true,
}

注意:调试 html 时,先手动把 firefox 打开,然后在 vscode 里可多次 run html 文件,否则如果依赖 vscode 打开 firefox,则下一次 run 同样的文件,会显示 code is already running 而不会更新 firefox 内容。

 

X2. 增加 Editor ruler

File -> Preferences -> Settings -> 搜索 ruler -> Editor:Rulers (Edit in settings.json),加入 如下配置(注意,可配置多条 ruler 线,如下配置两条),

 

"editor.rulers":[80, 120],

 

X3. 设置 Jedi 为 Python 的默认补全引擎

安装 Python Extension Pack 之后,Python 的默认补全引擎是 Microsoft Python Analysis Engine, 每次启动 vscode 都会下载或更新,并且导致下载更新阶段 Python 补全不能用。所以这里直接禁掉默认引擎,而使用 Jedi 进行补全。

设置方法: File -> Preferences -> Settings -> 搜索 jedi ->  勾选 Jedi Enable  -> 再搜索 auto update language server -> 取消 Automatically update the language server -> 回到主界面 Extension -> Disable 掉 Visual Studio IntelliCode.

 

X4. jshint 的安装配置

首先通过 Terminal 安装 jshint library,

$ sudo npm install -g jshint

安装完成后,jshint 会在 /usr/bin/jshint,而库文件在 /usr/lib/node_modules 下的 jshint.

通过 VScode 安装 jshint 插件,然后在settings.json 中设置,

    "jshint.nodePath" : "/usr/lib/node_modules",

这样就能通过 jshint 实时检查 javascript 的 warning ,error 等信息了。

 

注:既然有这个免费的杂牌军,就不用到处找 WebStrom 的 Lincense 了 ;-p

 

转载于:https://www.cnblogs.com/gaowengang/p/10589534.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值