{"id":7631,"date":"2015-09-23T04:59:32","date_gmt":"2015-09-23T04:59:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/09\/23\/dscleaver-sbt-quickfix\/"},"modified":"2015-09-23T04:59:32","modified_gmt":"2015-09-23T04:59:32","slug":"dscleaver-sbt-quickfix","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/09\/23\/dscleaver-sbt-quickfix\/","title":{"rendered":"dscleaver\/sbt-quickfix"},"content":{"rendered":"<p>This is an sbt plugin that generates a quickfix file that can be used with Vim.<\/p>\n<p>Inspired by Alois Cochard\u2019s blog post on setting up quickfix using a bash wrapper around sbt\u2026<\/p>\n<h2>Usage<\/h2>\n<p>Add this to your <code>~\/.sbt\/0.13\/plugins\/plugins.sbt<\/code>:<\/p>\n<pre><code>addSbtPlugin(\"com.dscleaver.sbt\" % \"sbt-quickfix\" % \"0.4.1\")\n<\/code><\/pre>\n<p><em>Note: this plugin was built for sbt 0.13 use version 0.3.1 for sbt 0.12<\/em><\/p>\n<h2>Vim Integration<\/h2>\n<p>If your vim is setup to use Pathogen, then the vim-sbt plugin can be installed with this command:<\/p>\n<pre><code>sbt installVimPlugin  #'sbt install-vim-plugin' for older versions of sbt...\n<\/code><\/pre>\n<p>This command will replace the plugin files whenever it is run, so it is recommended when upgrading versions of the plugin.<\/p>\n<h3>Using the files in Vim<\/h3>\n<p>After a compile or test, assuming there was an error, a quickfix file will be created that Vim can use.<\/p>\n<p>If your copy of Vim was compiled with +clientserver and you\u2019ve enabled the <code>vim-enable-server<\/code> flag in your SBT project (default is <code>true<\/code>), then this plugin will automatically load the quickfix file into Vim once it\u2019s been created.<\/p>\n<p>If you don\u2019t have +clientserver enabled in Vim, or you have disabled the <code>vim-enable-server<\/code> feature of the plugin, then you can use a Vim mapping to load the file. By default the mapping is <code>ff<\/code>, but you can change this if you wish.<\/p>\n<h3>Installation Location<\/h3>\n<p>By default the plugin will install to <code>~\/.vim\/bundle<\/code>. This plugin base directory can be added to your global config (e.g. <code>~\/.sbt\/0.13\/global.sbt<\/code>) as follows:<\/p>\n<p>QuickFixKeys.pluginBaseDirectory := file(\u201cintended\/directory\u201d)<\/p>\n<p>You can disable the vim-enable-server flag in the global.sbt as follows:<\/p>\n<p>QuickFixKeys.vimEnableServer := false<\/p>\n<h3>Previous Integration<\/h3>\n<p>The initial version of this plugin required that you add the following lines to your <code>~\/.vimrc<\/code>:<\/p>\n<pre><code>set errorformat=%E\\ %#[error]\\ %#%f:%l:\\ %m,%-Z\\ %#[error]\\ %p^,%-C\\ %#[error]\\ %m\nset errorformat+=,%W\\ %#[warn]\\ %#%f:%l:\\ %m,%-Z\\ %#[warn]\\ %p^,%-C\\ %#[warn]\\ %m\nset errorformat+=,%-G%.%#\n\nnoremap  ff :cf target\/quickfix\/sbt.quickfix\nnoremap  fn :cn\n<\/code><\/pre>\n<p>These lines should be removed from `~\/.vimrc\u2019<\/p>\n<h2>To Do<\/h2>\n<p>Items that I want to look into in the future:<\/p>\n<ul>\n<li>Possibly reformat log output for easier consumption<\/li>\n<li>Add ctags generation possibly turning this into a full vim plugin<\/li>\n<li>Allow vim server name to be overridden by system property<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is an sbt plugin that generates a quickfix file that can be used with Vim. Inspired by Alois Cochard\u2019s blog post on setting up quickfix using a bash wrapper around sbt\u2026 Usage Add this to your ~\/.sbt\/0.13\/plugins\/plugins.sbt: addSbtPlugin(&#8220;com.dscleaver.sbt&#8221; % &#8220;sbt-quickfix&#8221; % &#8220;0.4.1&#8221;) Note: this plugin was built for sbt 0.13 use version 0.3.1 for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7631","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7631"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7631\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}