This is an old revision of the document!


apt install curl vim 
gem install rubocop

mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
echo 'execute pathogen#infect()' >> ~/.vimrc

cd ~/.vim/bundle && git clone --depth=1 https://github.com/vim-syntastic/syntastic.git
echo "let g:syntastic_ruby_checkers = ['rubocop', 'mri']" >> ~/.vimrc

cat ~/.vimrc

colorscheme delek
syntax on
set nu
" Load all plugins now.
" " Plugins need to be added to runtimepath before helptags can be generated.
packloadall
" " Load all of the helptags now, after plugins have been loaded.
" " All messages and errors will be ignored.
silent! helptags ALL
execute pathogen#infect()
let g:syntastic_ruby_checkers = ['rubocop', 'mri']

function! RubocopAutocorrect()
  execute "!rubocop -a " . bufname("%")
  call SyntasticCheck()
endfunction

let mapleader=","
map <silent> <Leader>c :call RubocopAutocorrect()<cr>

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

.rubocop.yml

AllCops:
  DisplayCopNames: true
  DisplayStyleGuide: true
  ExtraDetails: false
  TargetRubyVersion: 2.6


#https://blog.dnsimple.com/2018/06/quick-tips-for-practical-rubocop-workflow/
 
rubocop.1571237367.txt.gz · Last modified: 2019/10/16 16:49 (external edit)