Skip to content

Commit

Permalink
Update: Add syntax; Add setting
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Jan 19, 2015
1 parent 409b27d commit afc0f7e
Show file tree
Hide file tree
Showing 41 changed files with 4,061 additions and 319 deletions.
1 change: 1 addition & 0 deletions .vim/UltiSnips/groovy.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends java
7 changes: 7 additions & 0 deletions .vim/UltiSnips/nasm.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ _start:
$0
endsnippet

snippet loop "loop" !b
${1:.loop}:
push ecx
pop ecx
loop ${1}
endsnippet

snippet int "int 0x80"
int 0x80
endsnippet
Expand Down
39 changes: 39 additions & 0 deletions .vim/compiler/eruby.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
" Vim compiler file
" Language: eRuby
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" URL: https://github.com/vim-ruby/vim-ruby
" 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:
39 changes: 39 additions & 0 deletions .vim/compiler/rake.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
" Vim compiler file
" Language: Rake
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>

if exists("current_compiler")
finish
endif
let current_compiler = "rake"

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=rake

CompilerSet errorformat=
\%D(in\ %f),
\%\\s%#from\ %f:%l:%m,
\%\\s%#from\ %f:%l:,
\%\\s%##\ %f:%l:%m,
\%\\s%##\ %f:%l,
\%\\s%#[%f:%l:\ %#%m,
\%\\s%#%f:%l:\ %#%m,
\%\\s%#%f:%l:,
\%m\ [%f:%l]:,
\%+Erake\ aborted!,
\%+EDon't\ know\ how\ to\ build\ task\ %.%#,
\%+Einvalid\ option:%.%#,
\%+Irake\ %\\S%\\+%\\s%\\+#\ %.%#

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: nowrap sw=2 sts=2 ts=8:
33 changes: 33 additions & 0 deletions .vim/compiler/rspec.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
" Vim compiler file
" Language: RSpec
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>

if exists("current_compiler")
finish
endif
let current_compiler = "rspec"

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=rspec

CompilerSet errorformat=
\%f:%l:\ %tarning:\ %m,
\%E%.%#:in\ `load':\ %f:%l:%m,
\%E%f:%l:in\ `%*[^']':\ %m,
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
\%E\ \ %\\d%\\+)%.%#,
\%C\ \ \ \ \ %m,
\%-G%.%#

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: nowrap sw=2 sts=2 ts=8:
45 changes: 45 additions & 0 deletions .vim/compiler/ruby.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
" Vim compiler file
" Language: Ruby
" Function: Syntax check and/or error reporting
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ----------------------------------------------------------------------------

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:
35 changes: 35 additions & 0 deletions .vim/compiler/rubyunit.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
" Vim compiler file
" Language: Test::Unit - Ruby Unit Testing Framework
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" URL: https://github.com/vim-ruby/vim-ruby
" 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 makeprg=ruby\ -Itest
" CompilerSet makeprg=m

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:
1 change: 1 addition & 0 deletions .vim/ftdetect/blade.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
au BufNewFile,BufRead *.blade.php set filetype=blade
2 changes: 2 additions & 0 deletions .vim/ftdetect/jade.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
" Jade
autocmd BufNewFile,BufReadPost *.jade set filetype=jade
71 changes: 71 additions & 0 deletions .vim/ftdetect/ruby.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
function! s:setf(filetype) abort
if &filetype !=# a:filetype
let &filetype = a:filetype
endif
endfunction

" Ruby
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')

" Ruby on Rails
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')

" Rakefile
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')

" Rantfile
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')

" IRB config
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')

" Pry config
au BufNewFile,BufRead .pryrc call s:setf('ruby')

" Rackup
au BufNewFile,BufRead *.ru call s:setf('ruby')

" Capistrano
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')

" Bundler
au BufNewFile,BufRead Gemfile call s:setf('ruby')

" Guard
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')

" Chef
au BufNewFile,BufRead Cheffile call s:setf('ruby')
au BufNewFile,BufRead Berksfile call s:setf('ruby')

" Vagrant
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')

" Autotest
au BufNewFile,BufRead .autotest call s:setf('ruby')

" eRuby
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')

" Thor
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')

" Rabl
au BufNewFile,BufRead *.rabl call s:setf('ruby')

" Jbuilder
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')

" Puppet librarian
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
"
" Buildr Buildfile
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')

" Appraisal
au BufNewFile,BufRead Appraisals call s:setf('ruby')

" CocoaPods
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')

" vim: nowrap sw=2 sts=2 ts=8 noet:
8 changes: 8 additions & 0 deletions .vim/ftdetect/scala.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fun! s:DetectScala()
if getline(1) == '#!/usr/bin/env scala'
set filetype=scala
endif
endfun

au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
au BufRead,BufNewFile * call s:DetectScala()
Loading

0 comments on commit afc0f7e

Please sign in to comment.