[
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 Yuta Nagamiya\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# Vim RuboCop\n\nThe **Vim RuboCop** plugin runs [RuboCop](https://github.com/bbatsov/rubocop) and displays the results in Vim.\n\n## Requirements\n\nPlease note that the current version of the Vim RuboCop plugin requires RuboCop 0.12.0 or later.\n\n## Installation\n\nObtain a copy of this plugin and place `rubocop.vim` in your Vim plugin directory.\n\n## Usage\n\nYou can use the `:RuboCop` command to run RuboCop and display the results.\n\nYou can also use the `:RuboCop` command together with options. For example, `:RuboCop -l`, `:RuboCop -a` and so on.\n\n### Configuration File\n\nTo run with the specified configuration file, add the following line to your `.vimrc` file:\n\n```viml\nlet g:vimrubocop_config = '/path/to/rubocop.yml'\n```\n\n### Keyboard Shortcuts\n\nCredit for Shortcuts: [Ack.vim](https://github.com/mileszs/ack.vim)\n\nIn the quickfix window, you can use:\n\n    o    to open (same as enter)\n    go   to preview file (open but maintain focus on ack.vim results)\n    t    to open in new tab\n    T    to open in new tab silently\n    h    to open in horizontal split\n    H    to open in horizontal split silently\n    v    to open in vertical split\n    gv   to open in vertical split silently\n    q    to close the quickfix window\n\nAdditionally, the plugin registers `<Leader>ru` in normal mode\nfor triggering it easily. You can disable these default mappings by setting\n`g:vimrubocop_keymap` in your `.vimrc` file, and then remap them differently.\n\nFor instance, to trigger RuboCop by pressing `<Leader>r` you can put the following in\nyour `.vimrc`:\n\n```viml\nlet g:vimrubocop_keymap = 0\nnmap <Leader>r :RuboCop<CR>\n```\n\n## License\n\nThe Vim RuboCop plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n"
  },
  {
    "path": "plugin/rubocop.vim",
    "content": "\" The \"Vim RuboCop\" plugin runs RuboCop and displays the results in Vim.\n\"\n\" Author:    Yuta Nagamiya\n\" URL:       https://github.com/ngmy/vim-rubocop\n\" Version:   0.4\n\" Copyright: Copyright (c) 2013 Yuta Nagamiya\n\" License:   MIT\n\" ----------------------------------------------------------------------------\n\nif exists('g:loaded_vimrubocop') || &cp\n  finish\nendif\nlet g:loaded_vimrubocop = 1\n\nlet s:save_cpo = &cpo\nset cpo&vim\n\nif !exists('g:vimrubocop_rubocop_cmd')\n  let g:vimrubocop_rubocop_cmd = 'rubocop '\nendif\n\n\" Options\nif !exists('g:vimrubocop_config')\n  let g:vimrubocop_config = ''\nendif\n\nif !exists('g:vimrubocop_extra_args')\n  let g:vimrubocop_extra_args = ''\nendif\n\nif !exists('g:vimrubocop_keymap')\n  let g:vimrubocop_keymap = 1\nendif\n\nlet s:rubocop_switches = ['-l', '--lint', '-R', '--rails', '-a', '--auto-correct']\n\nfunction! s:RuboCopSwitches(...)\n  return join(s:rubocop_switches, \"\\n\")\nendfunction\n\nfunction! s:RuboCop(current_args)\n  let l:extra_args     = g:vimrubocop_extra_args\n  let l:filename       = @%\n  let l:rubocop_cmd    = g:vimrubocop_rubocop_cmd\n  let l:rubocop_opts   = ' '.a:current_args.' '.l:extra_args.' --format emacs'\n  if g:vimrubocop_config != ''\n    let l:rubocop_opts = ' '.l:rubocop_opts.' --config '.g:vimrubocop_config\n  endif\n\n  let l:rubocop_output  = system(l:rubocop_cmd.l:rubocop_opts.' '.l:filename)\n  if !empty(matchstr(l:rubocop_opts, '--auto-correct\\|-\\<a\\>'))\n    \"Reload file if using auto correct\n    edit\n  endif\n  let l:rubocop_output  = substitute(l:rubocop_output, '\\\\\"', \"'\", 'g')\n  let l:rubocop_results = split(l:rubocop_output, \"\\n\")\n  cexpr l:rubocop_results\n  copen\n  \" Shortcuts taken from Ack.vim - git://github.com/mileszs/ack.vim.git\n  exec \"nnoremap <silent> <buffer> q :ccl<CR>\"\n  exec \"nnoremap <silent> <buffer> t <C-W><CR><C-W>T\"\n  exec \"nnoremap <silent> <buffer> T <C-W><CR><C-W>TgT<C-W><C-W>\"\n  exec \"nnoremap <silent> <buffer> o <CR>\"\n  exec \"nnoremap <silent> <buffer> go <CR><C-W><C-W>\"\n  exec \"nnoremap <silent> <buffer> h <C-W><CR><C-W>K\"\n  exec \"nnoremap <silent> <buffer> H <C-W><CR><C-W>K<C-W>b\"\n  exec \"nnoremap <silent> <buffer> v <C-W><CR><C-W>H<C-W>b<C-W>J<C-W>t\"\n  exec \"nnoremap <silent> <buffer> gv <C-W><CR><C-W>H<C-W>b<C-W>J\"\nendfunction\n\ncommand! -complete=custom,s:RuboCopSwitches -nargs=? RuboCop :call <SID>RuboCop(<q-args>)\n\n\" Shortcuts for RuboCop\nif g:vimrubocop_keymap == 1\n  nmap <Leader>ru :RuboCop<CR>\nendif\n\nlet &cpo = s:save_cpo\n"
  }
]