Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit d2a15ef1bcdc1a9b8090185b732de2a43de2cd57 @nono committed Oct 15, 2008
22 COPYING
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) 2008 Bruno Michel
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
18 README
@@ -0,0 +1,18 @@
+= Merb.vim
+
+== Informations
+
+Author:: Bruno Michel <brmichel@free.fr>
+Licence:: MIT licence
+Homepage:: http://github.com/nono/merb.vim/tree
+
+This is a set of vim plugins for Merb, including Datamapper, jQuery and features.
+Currently, it's mostly composed of syntax files for Vim coloration.
+You can install it with `rake install`, or simply copy file to your vim directory.
+
+== Additional links
+
+ * The syntax file for HAML can be found here: http://www.vim.org/scripts/script.php?script_id=1773
+ * If you prefer Rspec stories to cucumber feature, you can use the vim-story plugin: http://github.com/agile/vim-story/tree
+ * Thanks to Tim Pope for its incredible Rails.vim: http://rails.vim.tpope.net/
+
@@ -0,0 +1,49 @@
+# http://github.com/ryanb/dotfiles/tree/master/Rakefile
+
+require 'rake'
+
+desc "install the dot files into user's home directory"
+task :install do
+ replace_all = false
+ Dir['**/*.vim'].each do |file|
+ if File.exist?(File.join(ENV['HOME'], ".vim", file))
+ if replace_all
+ replace_file(file)
+ else
+ print "overwrite ~/.vim/#{file}? [ynaq] "
+ case $stdin.gets.chomp
+ when 'a'
+ replace_all = true
+ replace_file(file)
+ when 'y'
+ replace_file(file)
+ when 'q'
+ exit
+ else
+ puts "skipping ~/.#{file}"
+ end
+ end
+ else
+ link_file(file)
+ end
+ end
+end
+
+def replace_file(file)
+ system %Q{rm "$HOME/.vim/#{file}"}
+ link_file(file)
+end
+
+def link_file(file)
+ puts "linking ~/.vim/#{file}"
+ dest = File.join(ENV['HOME'], ".vim", file)
+ dir = File.dirname(dest)
+ create_directory(dir) unless File.exists?(dir)
+ system %Q{ln -s "$PWD/#{file}" "#{dest}"}
+end
+
+def create_directory(dir)
+ parent = File.dirname(dir)
+ create_directory(parent) unless File.exists?(parent)
+ Dir.mkdir(dir)
+end
@@ -0,0 +1,2 @@
+inorea <buffer> == <%= %><Left><Left><Left>
+inorea <buffer> << <% -%><Left><Left><Left><Left>
@@ -0,0 +1,26 @@
+" This file is taken from the Rails.vim plugin by Tim Pope
+" http://rails.vim.tpope.net/
+
+" surround.vim
+if exists("g:loaded_surround")
+ " The idea behind the || part here is that one can normally define the
+ " surrounding to omit the hyphen (since standard ERuby does not use it)
+ " but have it added in Rails ERuby files. Unfortunately, this makes it
+ " difficult if you really don't want a hyphen in Rails ERuby files. If
+ " this is your desire, you will need to accomplish it via a rails.vim
+ " autocommand.
+ if !exists("b:surround_45") || b:surround_45 == "<% \r %>" " -
+ let b:surround_45 = "<% \r -%>"
+ endif
+ if !exists("b:surround_61") " =
+ let b:surround_61 = "<%= \r %>"
+ endif
+ if !exists("b:surround_35") " #
+ let b:surround_35 = "<%# \r %>"
+ endif
+ if !exists("b:surround_101") || b:surround_101 == "<% \r %>\n<% end %>" "e
+ let b:surround_5 = "<% \r -%>\n<% end -%>"
+ let b:surround_69 = "<% \1expr: \1 -%>\r<% end -%>"
+ let b:surround_101 = "<% \r -%>\n<% end -%>"
+ endif
+endif
@@ -0,0 +1,25 @@
+" Vim syntax file
+" Language: Ruby Yard
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 14, 2008
+" Version: 0.1
+" URL: http://yard.rubyforge.org/
+
+syn match rubyYard contained containedin=rubyComment /@\(param\|yieldparam\|yield\|return\|deprecated\|raise\|see\|since\|version\|author\)/
+syn match rubyYard contained containedin=rubyComment /==== .*$/
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lisp_syntax_inits")
+ if version < 508
+ let did_lisp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rubyYard Keyword
+
+ delcommand HiLink
+endif
@@ -0,0 +1,11 @@
+au BufRead,BufNewFile Capfile set ft=ruby
+au BufRead,BufNewFile config/router.rb set ft=ruby.merb_router
+au BufRead,BufNewFile *.yml.sample set ft=yaml
+au BufRead,BufNewFile */schema/migrations/*.rb set ft=ruby.datamapper_migration
+au BufRead,BufNewFile */app/models/*.rb set ft=ruby.datamapper
+au BufRead,BufNewFile */app/mailers/*.rb set ft=ruby.merb_mailer
+au BufRead,BufNewFile */app/controllers/*.rb set ft=ruby.merb_controller
+au BufRead,BufNewFile */app/{mailers/,}views/*.erb set ft=eruby.merb_view
+au BufRead,BufNewFile *.haml set ft=haml " http://www.vim.org/scripts/script.php?script_id=1773
+au BufRead,BufNewFile *.feature set ft=feature
+au BufRead,BufNewFile public/javascripts/*.js set ft=javascript.jquery
@@ -0,0 +1,26 @@
+" Vim ftplugin file
+" Language: Datamapper
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 14, 2008
+" Version: 0.1
+" URL: http://www.datamapper.org/
+
+inorea <buffer> res include DataMapper::Resource
+
+inorea <buffer> sti property :type, Discriminator
+inorea <buffer> delat property :deleted_at, ParanoidDateTime
+inorea <buffer> timestamps property :created_at, DateTime<cr>property :updated_at, DateTime
+inorea <buffer> enum property :status, Enum[:new], :default => :new
+inorea <buffer> flag property :levels, Flag[:admin]
+
+inorea <buffer> vp validates_present
+inorea <buffer> va validates_absent
+inorea <buffer> via validates_is_accepted
+inorea <buffer> vis validates_is_confirmed
+inorea <buffer> vf validates_format
+inorea <buffer> vl validates_length
+inorea <buffer> vwm validates_with_method
+inorea <buffer> vwb validates_with_block
+inorea <buffer> vin validates_is_number
+inorea <buffer> viu validates_is_unique
+inorea <buffer> vw validates_within
@@ -0,0 +1,19 @@
+" Vim ftplugin file
+" Language: Datamapper migrations
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 15, 2008
+" Version: 0.1
+" URL: http://www.datamapper.org/
+
+inorea <buffer> ct create_table
+inorea <buffer> dt drop_table
+inorea <buffer> mt modify_table
+
+inorea <buffer> ai add_index
+inorea <buffer> di drop_index
+
+inorea <buffer> col column
+inorea <buffer> ac add_column
+inorea <buffer> dc drop_column
+inorea <buffer> rc rename_column
+inorea <buffer> cc change_column
@@ -0,0 +1,12 @@
+" Vim ftplugin file
+" Language: Cucumber feature
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 6, 2008
+" Version: 0.1
+" URL: http://github.com/aslakhellesoy/cucumber
+
+setlocal textwidth=78
+setlocal expandtab
+setlocal shiftwidth=2
+setlocal tabstop=2
+setlocal spell
@@ -0,0 +1,12 @@
+" Vim ftplugin file
+" Language: Merb controller
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 16, 2008
+" Version: 0.1
+" URL: http://www.merbivore.org/
+
+inorea <buffer> logd Merb.logger.debug
+inorea <buffer> logi Merb.logger.info
+inorea <buffer> logw Merb.logger.warn
+inorea <buffer> loge Merb.logger.error
+inorea <buffer> logf Merb.logger.fatal
@@ -0,0 +1,56 @@
+" Vim syntax file
+" Language: Datamapper
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 12, 2008
+" Version: 0.2
+" URL: http://www.datamapper.org/
+
+if exists("b:current_syntax") && b:current_syntax =~ "datamapper"
+ finish
+endif
+
+
+syn case match
+
+syn keyword dmRailisms find find_first find_all find_or_create
+syn keyword dmRailisms attr_accessible attr_protected
+
+syn keyword dmProperty property
+syn keyword dmAssociations has belongs_to many_to_one
+syn keyword dmCardinality n
+
+syn keyword dmValidations validates_present validates_absent validates_is_accepted validates_is_confirmed
+syn keyword dmValidations validates_format validates_length validates_with_method validates_with_block
+syn keyword dmValidations validates_is_number validates_is_unique validates_within
+
+syn keyword dmCallbacks before after before_class_method after_class_method
+
+syn keyword dmIs is_a_tree is_a_nested_set
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lisp_syntax_inits")
+ if version < 508
+ let did_lisp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dmRailisms Error
+
+ HiLink dmProperty PreProc
+ HiLink dmAssociations PreProc
+ HiLink dmValidations PreProc
+ HiLink dmCallbacks PreProc
+ HiLink dmIs PreProc
+
+ HiLink dmCardinality Number
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = 'ruby.datamapper'
@@ -0,0 +1,53 @@
+" Vim syntax file
+" Language: Datamapper migrations
+" Maintainer: Bruno Michel <brmichel@free.fr>
+" Last Change: Oct 15, 2008
+" Version: 0.1
+" URL: http://www.datamapper.org/
+
+if exists("b:current_syntax") && b:current_syntax =~ "datamapper_migration"
+ finish
+endif
+
+
+syn case match
+set isk+=!
+
+
+syn keyword dmRailisms remove_column remove_columns rename_table remove_index
+
+syn keyword dmSay say say_with_time
+syn keyword dmUpDown migration up down
+syn keyword dmTable create_table drop_table modify_table
+syn keyword dmIndex add_index drop_index
+syn keyword dmColumn add_column drop_column column rename_column change_column
+syn keyword dmHelper now uuid auto_migrate!
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lisp_syntax_inits")
+ if version < 508
+ let did_lisp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dmRailisms Error
+
+ HiLink dmUpDown Statement
+
+ HiLink dmSay Function
+ HiLink dmTable Function
+ HiLink dmIndex Function
+ HiLink dmColumn Function
+
+ HiLink dmHelper Keyword
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = 'ruby.datamapper_migration'
Oops, something went wrong.

0 comments on commit d2a15ef

Please sign in to comment.