tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

Help me remember frozen_string_literal #519

Closed sj26 closed 6 years ago

sj26 commented 6 years ago

Hi @tpope! 👋 I've used vim-rails for a long time and loved it, but I'm just starting to really dig in and understand vim to work more effectively. Your plugins are amazing, and I'm so thankful for all the time and work you've put into them. 💖

I think I'm after advice more than a feature or bug. We put the frozen_string_literal: true magic at the top of all our app files. And I always forget to add it to new files. Can you think of a good way to add it to the projectionist templates without completely copying the projectionist configuration?

I've tried copying the default projections into my project and adding to the template, but it just doesn't seem elegant. I'm sure there must be a way to add a rails ftplugin which prepends the lines to the existing projectionist templates but my vim-fu is not quite there. Do you have any advice?

tpope commented 6 years ago

Ugh, I keep hoping this will blow over like # encoding: utf-8 did, but it looks like Ruby 3.0 is still a couple of years away. I don't have a good answer other than duplicating all the "template" declarations. I'm inclined to take the same official position as rails generate and say "not my problem".

sj26 commented 6 years ago

Yep, fair enough. I'll just copy the templates. Thanks!