mirror of
https://github.com/jbranchaud/til
synced 2026-01-18 14:38:01 +00:00
Add Read In The Contents Of A Rails File as a vim til
This commit is contained in:
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
|
|||||||
warrant a full blog post. These are mostly things I learn by pairing with
|
warrant a full blog post. These are mostly things I learn by pairing with
|
||||||
smart people at [Hashrocket](http://hashrocket.com/).
|
smart people at [Hashrocket](http://hashrocket.com/).
|
||||||
|
|
||||||
_413 TILs and counting..._
|
_414 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -465,6 +465,7 @@ _413 TILs and counting..._
|
|||||||
- [Quick Man Pages](vim/quick-man-pages.md)
|
- [Quick Man Pages](vim/quick-man-pages.md)
|
||||||
- [Quick Quickfix List Navigation](vim/quick-quickfix-list-navigation.md)
|
- [Quick Quickfix List Navigation](vim/quick-quickfix-list-navigation.md)
|
||||||
- [Re-indenting Your Code](vim/reindenting-your-code.md)
|
- [Re-indenting Your Code](vim/reindenting-your-code.md)
|
||||||
|
- [Read In The Contents Of A Rails File](vim/read-in-the-contents-of-a-rails.file.md)
|
||||||
- [Rename Current File](vim/rename-current-file.md)
|
- [Rename Current File](vim/rename-current-file.md)
|
||||||
- [Repeat The Previous Change](vim/repeat-the-previous-change.md)
|
- [Repeat The Previous Change](vim/repeat-the-previous-change.md)
|
||||||
- [Repeating Characters](vim/repeating-characters.md)
|
- [Repeating Characters](vim/repeating-characters.md)
|
||||||
|
|||||||
15
vim/read-in-the-contents-of-a-rails-file.md
Normal file
15
vim/read-in-the-contents-of-a-rails-file.md
Normal 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
|
||||||
Reference in New Issue
Block a user