![]() ![]() The gf mapping is complemented by the :find Ex command. Once again, if I use the gf command it goes straight to the specified file. This file requires the fileutils module, which is part of the ruby standard library. Let's back up with ctrl-o, then dive a little deeper into the appraisal project using gf each time. The gf mapping works here too: it opens the specified file from the rake library. But here you see that this project is requiring a module from a 3rd party library: To extend the web browser analogy: gf is like clicking a link, and is like pressing the back button.Įach of the files that are prefixed in the appraisal namespace belong to the current project. I can go back to where I came from with the ctrl-o mapping. It's almost like clicking a hyperlink on a web page!Įach time I use the gf command, Vim records my location in the jumplist. Watch this: if I place Vim's cursor on a reference to another file, I can jump to the filename under the cursor using the gf mapping. This is our entry point to the library, and we can read it like a table of contents. Let's crack open the lib/appraisal.rb file. tree libĪppraisal follows the standard conventions for laying out a rubygem: the lib directory contains contains both a file and a folder named after the project. Here I've got the source code for appraisal, which is an open source project from thoughtbot. In the second half, I'll demonstrate how to set up your environment to get the most out of these two commands. In the first half of this tutorial, we'll learn about a couple of commands that let us quickly jump to files by name. You can download a cheat sheet and install instructions for all of the tools
0 Comments
Leave a Reply. |