Set .md to filetype=markdown, and Gemfile and .gemspec to filetype=ruby. For types where textwidth is set, set formatoptions+=t to enable line wrapping.