Skip to content

Instantly share code, notes, and snippets.

@ringe
Last active November 20, 2016 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ringe/ca6b9647de743fb56695a3b0e03b49c0 to your computer and use it in GitHub Desktop.
Save ringe/ca6b9647de743fb56695a3b0e03b49c0 to your computer and use it in GitHub Desktop.
Transform ActiveRecord db/schema.rb field lines to Rdoc list item with Vim
" use :RDF after copying lines from db/schema.rb to the class documentation
" the command transforms db/schema.rb lines to RDoc formatted list item
command -range=% RDF <line1>,<line2>s/\s\+t\.\(\w\+\)\s\+"\(.*\)"\($\|,.*\)/# +:\2+ _\1_::/
@ringe
Copy link
Author

ringe commented Nov 18, 2016

Put this in your .vimrc

@ringe
Copy link
Author

ringe commented Nov 19, 2016

Changed the command to create a description list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment