1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 23:28:02 +00:00

Add Read In The Contents Of A Rails File as a vim til

This commit is contained in:
jbranchaud
2016-05-10 18:12:10 -05:00
parent a518a634b4
commit 6163b38b42
2 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# Read In The Contents Of A Rails File
The [`rails.vim` plugin](https://github.com/tpope/vim-rails) allows you to
quickly navigate to specific types of files with the `E` prefix. For
instance, `:Emodel` will scope you to just the models directory.
You can use this same approach with the `D` prefix. Instead of navigating to
specified file though, this will read in the contents of that file into the
current buffer.
Do you need to copy and tweak the contents of a similar view? Open up your
new view file (e.g. `:Eview posts/edit.html.erb`) and then enter `:Dview
posts/new` to quickly copy in its contents.
h/t Josh Davey