-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1765289
commit 94f48fb
Showing
12 changed files
with
2,238 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
" Vim compiler file | ||
" Language: eRuby | ||
" Maintainer: Doug Kearns <dougkearns@gmail.com> | ||
" URL: http://vim-ruby.rubyforge.org | ||
" Anon CVS: See above site | ||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com> | ||
|
||
if exists("current_compiler") | ||
finish | ||
endif | ||
let current_compiler = "eruby" | ||
|
||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal | ||
command -nargs=* CompilerSet setlocal <args> | ||
endif | ||
|
||
let s:cpo_save = &cpo | ||
set cpo-=C | ||
|
||
if exists("eruby_compiler") && eruby_compiler == "eruby" | ||
CompilerSet makeprg=eruby | ||
else | ||
CompilerSet makeprg=erb | ||
endif | ||
|
||
CompilerSet errorformat= | ||
\eruby:\ %f:%l:%m, | ||
\%+E%f:%l:\ parse\ error, | ||
\%W%f:%l:\ warning:\ %m, | ||
\%E%f:%l:in\ %*[^:]:\ %m, | ||
\%E%f:%l:\ %m, | ||
\%-C%\tfrom\ %f:%l:in\ %.%#, | ||
\%-Z%\tfrom\ %f:%l, | ||
\%-Z%p^, | ||
\%-G%.%# | ||
|
||
let &cpo = s:cpo_save | ||
unlet s:cpo_save | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
" Vim compiler file | ||
" Language: Ruby | ||
" Function: Syntax check and/or error reporting | ||
" Maintainer: Tim Hammerquist <timh at rubyforge.org> | ||
" URL: http://vim-ruby.rubyforge.org | ||
" Anon CVS: See above site | ||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com> | ||
" ---------------------------------------------------------------------------- | ||
" | ||
" Changelog: | ||
" 0.2: script saves and restores 'cpoptions' value to prevent problems with | ||
" line continuations | ||
" 0.1: initial release | ||
" | ||
" Contributors: | ||
" Hugh Sasse <hgs@dmu.ac.uk> | ||
" Doug Kearns <djkea2@gus.gscit.monash.edu.au> | ||
" | ||
" Todo: | ||
" match error type %m | ||
" | ||
" Comments: | ||
" I know this file isn't perfect. If you have any questions, suggestions, | ||
" patches, etc., please don't hesitate to let me know. | ||
" | ||
" This is my first experience with 'errorformat' and compiler plugins and | ||
" I welcome any input from more experienced (or clearer-thinking) | ||
" individuals. | ||
" ---------------------------------------------------------------------------- | ||
|
||
if exists("current_compiler") | ||
finish | ||
endif | ||
let current_compiler = "ruby" | ||
|
||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal | ||
command -nargs=* CompilerSet setlocal <args> | ||
endif | ||
|
||
let s:cpo_save = &cpo | ||
set cpo-=C | ||
|
||
" default settings runs script normally | ||
" add '-c' switch to run syntax check only: | ||
" | ||
" CompilerSet makeprg=ruby\ -wc\ $* | ||
" | ||
" or add '-c' at :make command line: | ||
" | ||
" :make -c %<CR> | ||
" | ||
CompilerSet makeprg=ruby\ -w\ $* | ||
|
||
CompilerSet errorformat= | ||
\%+E%f:%l:\ parse\ error, | ||
\%W%f:%l:\ warning:\ %m, | ||
\%E%f:%l:in\ %*[^:]:\ %m, | ||
\%E%f:%l:\ %m, | ||
\%-C%\tfrom\ %f:%l:in\ %.%#, | ||
\%-Z%\tfrom\ %f:%l, | ||
\%-Z%p^, | ||
\%-G%.%# | ||
|
||
let &cpo = s:cpo_save | ||
unlet s:cpo_save | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
" Vim compiler file | ||
" Language: Test::Unit - Ruby Unit Testing Framework | ||
" Maintainer: Doug Kearns <dougkearns@gmail.com> | ||
" URL: http://vim-ruby.rubyforge.org | ||
" Anon CVS: See above site | ||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com> | ||
|
||
if exists("current_compiler") | ||
finish | ||
endif | ||
let current_compiler = "rubyunit" | ||
|
||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal | ||
command -nargs=* CompilerSet setlocal <args> | ||
endif | ||
|
||
let s:cpo_save = &cpo | ||
set cpo-=C | ||
|
||
CompilerSet makeprg=testrb | ||
|
||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, | ||
\%C%m\ [%f:%l]:, | ||
\%E\ %\\+%\\d%\\+)\ Error:, | ||
\%C%m:, | ||
\%C\ \ \ \ %f:%l:%.%#, | ||
\%C%m, | ||
\%Z\ %#, | ||
\%-G%.%# | ||
|
||
let &cpo = s:cpo_save | ||
unlet s:cpo_save | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
" Ruby | ||
au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec set filetype=ruby | ||
|
||
" Ruby on Rails | ||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs set filetype=ruby | ||
|
||
" Rakefile | ||
au BufNewFile,BufRead [rR]akefile,*.rake set filetype=ruby | ||
|
||
" Rantfile | ||
au BufNewFile,BufRead [rR]antfile,*.rant set filetype=ruby | ||
|
||
" IRB config | ||
au BufNewFile,BufRead .irbrc,irbrc set filetype=ruby | ||
|
||
" eRuby | ||
au BufNewFile,BufRead *.erb,*.rhtml set filetype=eruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
" Vim filetype plugin | ||
" Language: eRuby | ||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info> | ||
" URL: http://vim-ruby.rubyforge.org | ||
" Anon CVS: See above site | ||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com> | ||
|
||
" Only do this when not done yet for this buffer | ||
if exists("b:did_ftplugin") | ||
finish | ||
endif | ||
|
||
let s:save_cpo = &cpo | ||
set cpo-=C | ||
|
||
" Define some defaults in case the included ftplugins don't set them. | ||
let s:undo_ftplugin = "" | ||
let s:browsefilter = "All Files (*.*)\t*.*\n" | ||
let s:match_words = "" | ||
|
||
if !exists("g:eruby_default_subtype") | ||
let g:eruby_default_subtype = "html" | ||
endif | ||
|
||
if !exists("b:eruby_subtype") | ||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") | ||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') | ||
if b:eruby_subtype == '' | ||
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\)\+$','',''),'\.\zs\w\+$') | ||
endif | ||
if b:eruby_subtype == 'rhtml' | ||
let b:eruby_subtype = 'html' | ||
elseif b:eruby_subtype == 'rb' | ||
let b:eruby_subtype = 'ruby' | ||
elseif b:eruby_subtype == 'yml' | ||
let b:eruby_subtype = 'yaml' | ||
elseif b:eruby_subtype == 'js' | ||
let b:eruby_subtype = 'javascript' | ||
elseif b:eruby_subtype == 'txt' | ||
" Conventional; not a real file type | ||
let b:eruby_subtype = 'text' | ||
elseif b:eruby_subtype == '' | ||
let b:eruby_subtype = g:eruby_default_subtype | ||
endif | ||
endif | ||
|
||
if exists("b:eruby_subtype") && b:eruby_subtype != '' | ||
exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" | ||
else | ||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | ||
endif | ||
unlet! b:did_ftplugin | ||
|
||
" Override our defaults if these were set by an included ftplugin. | ||
if exists("b:undo_ftplugin") | ||
let s:undo_ftplugin = b:undo_ftplugin | ||
unlet b:undo_ftplugin | ||
endif | ||
if exists("b:browsefilter") | ||
let s:browsefilter = b:browsefilter | ||
unlet b:browsefilter | ||
endif | ||
if exists("b:match_words") | ||
let s:match_words = b:match_words | ||
unlet b:match_words | ||
endif | ||
|
||
runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim | ||
let b:did_ftplugin = 1 | ||
|
||
" Combine the new set of values with those previously included. | ||
if exists("b:undo_ftplugin") | ||
let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin | ||
endif | ||
if exists ("b:browsefilter") | ||
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter | ||
endif | ||
if exists("b:match_words") | ||
let s:match_words = b:match_words . ',' . s:match_words | ||
endif | ||
|
||
" Change the browse dialog on Win32 to show mainly eRuby-related files | ||
if has("gui_win32") | ||
let b:browsefilter="eRuby Files (*.erb, *.rhtml)\t*.erb;*.rhtml\n" . s:browsefilter | ||
endif | ||
|
||
" Load the combined list of match_words for matchit.vim | ||
if exists("loaded_matchit") | ||
let b:match_words = s:match_words | ||
endif | ||
|
||
" TODO: comments= | ||
setlocal commentstring=<%#%s%> | ||
|
||
let b:undo_ftplugin = "setl cms< " | ||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin | ||
|
||
let &cpo = s:save_cpo | ||
|
||
" vim: nowrap sw=2 sts=2 ts=8: |
Oops, something went wrong.