darkrc/vim/ftplugin/ruby.vim

24 lines
994 B
VimL
Raw Normal View History

augroup RUBY
if b:undo_ftplugin
2021-01-28 13:58:41 +00:00
let b:undo_ftplugin .= " | "
else
2021-01-28 13:58:41 +00:00
let b:undo_ftplugin = ""
end
let b:undo_ftplugin .= "augroup RUBY | au! | augroup END"
2021-01-28 13:58:41 +00:00
" comm! -buffer AsyncLint call AsyncLint(bufnr("%"), substitute(b:linter, "%", expand("%"), "g"))
comm! -buffer AsyncLint call AsyncLint(bufnr("%"), substitute(substitute(b:linter, "$0", "\\\\$0", "g"), "%", expand("%"), "g"))
let b:undo_ftplugin .= " | delcommand AsyncLint"
2021-01-28 13:58:41 +00:00
comm! -buffer Lint silent exec "%!".substitute(substitute(b:linter, "$0", "\\\\$0", "g"), "%", expand("%"), "g")
let b:undo_ftplugin .= " | delcommand Lint"
2021-01-28 13:58:41 +00:00
let b:linter = "sh -c \"standardrb --auto-correct -o /dev/null --stdin % 2>/dev/null | awk 'BEGIN { header=0 } // && header==1 { print $0 } /^====================$/ { header=1 }'\""
let b:undo_ftplugin .= " | unlet b:linter"
2021-01-28 13:58:41 +00:00
set complete=t,.,kspell,i
aut BufWritePost <buffer> Defer timeout 5 ripper-tags -R
2020-08-27 09:14:38 +00:00
2020-08-20 13:33:23 +00:00
" au InsertLeave <buffer> AsyncLint
" au BufWritePre <buffer> Lint
augroup END