{"componentChunkName":"component---src-templates-blog-post-js","path":"/install-sublime-linter/","result":{"data":{"site":{"siteMetadata":{"title":"星雨之夜"}},"markdownRemark":{"id":"4e01b6e2-a346-573d-a683-f15aac51b5c1","excerpt":"前阵子终于搞定 SublimeLinter 让它正常工作了，却一直没时间去记录折腾的经历（没错，其实是懒）。这么一拖，微软居然就发布了 Visual Studio Code，看到大多数评价都是“赞赞赞”、“快快快”、“巨硬大法好”，让吾等 Sublime…","html":"<p>前阵子终于搞定 SublimeLinter 让它正常工作了，却一直没时间去记录折腾的经历（没错，其实是懒）。这么一拖，微软居然就发布了 Visual Studio Code，看到大多数评价都是“赞赞赞”、“快快快”、“巨硬大法好”，让吾等 Sublime 党的内心产生了动摇。在彻底叛变之前我还是决定来写完这篇心得体会（以作纪念）。</p>\n<p>因为项目上用 Coffeescript 来写 JS，所以这里以 coffeelint 为例。APM 流派的用户慎用，安装之后会有轻微的卡顿感。</p>\n<h2>安装 coffeelint</h2>\n<p>参照 <a href=\"https://github.com/SublimeLinter/SublimeLinter-coffeelint#linter-installation\">Linter Installation</a> 的 <strong>前两个</strong> 步骤。</p>\n<h2>安装 SublimeLinter</h2>\n<p>参照 <a href=\"http://sublimelinter.readthedocs.org/en/latest/installation.html#installing-via-pc\">Installing via Package Control</a> 的步骤。</p>\n<h2>关联 coffeelint 到 SublimeLinter</h2>\n<h3>确定路径</h3>\n<p>参照 <a href=\"http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable\">Finding a linter executable</a>，使用 <code class=\"language-text\">which coffeelint</code> 命令。</p>\n<h3>关联路径</h3>\n<p>可以通过以下两种方式进行关联：</p>\n<ol>\n<li><strong>通过 SublimeLinter 的配置文件</strong></li>\n</ol>\n<p>打开 <code class=\"language-text\">Preferences</code> - <code class=\"language-text\">Package Settings</code> - <code class=\"language-text\">SublimeLinter</code> - <code class=\"language-text\">Settings</code> - <code class=\"language-text\">User</code>，在 <code class=\"language-text\">paths</code> 中添加刚刚找到的路径，比如我的路径是这样的：</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token property\">\"paths\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"linux\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"/home/twinkle/.nvm/v0.10.38/bin\"</span>\n  <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"osx\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"windows\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<ol start=\"2\">\n<li><strong>通过 shell 启动脚本</strong></li>\n</ol>\n<p>我同时使用 <code class=\"language-text\">nvm</code> 和 <code class=\"language-text\">zsh</code>，所以按照 <a href=\"https://github.com/SublimeLinter/SublimeLinter-coffeelint#linter-installation\">Linter Installation</a> 的第三步，将 <code class=\"language-text\">~/.nvm/nvm.sh</code> 写入 <code class=\"language-text\">.zshenv</code> 文件中，使 Node 和 coffeelint 的路径能够被正确载入。</p>\n<p>其他情况请参照 <a href=\"http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#augmenting-path\">Augmenting PATH</a> 的步骤。</p>\n<p>重启 Sublime Text 或者重新登录系统即可生效，记录完毕。</p>","frontmatter":{"title":"整理 SublimeLinter 的安装步骤","date":"2015 年 05 月 04 日","description":"在彻底叛变到 VS Code 之前，整理一下安装 SublimeLinter 的步骤。"}}},"pageContext":{"slug":"/install-sublime-linter/","previous":{"fields":{"slug":"/xfce-settings/"},"frontmatter":{"title":"记录 Xfce 的一些配置"}},"next":{"fields":{"slug":"/web-crawler-for-hitokoto/"},"frontmatter":{"title":"Hitokoto.us（一言）的 API 爬虫"}}}}}