Giter Site home page Giter Site logo

find-file-in-project's Introduction

This is my version of find-file-in-project for emacs.  I originally
started with the ffip from the rinari project many, many moons ago.  I
noticed that none of the publicly available versions of ffip had some
of my modifications, so I decided to setup this repository.

From the beginning find-file-in-project was intended to mimic
TextMate's cmd-T functionality.  While editing a file in a project you
invoke find-file-in-project and it should prompt you with the files to
edit in that project.  What files get selected depend on the project.
Right now, ffip can detect the project root given the evidence of a
config/environment.rb file.  Obviously, this really only works with
Rails projects.

To combat this, I added the ability to explicitly set the project root
with set-project-root and then clear-project-root.  Once you
set-project-root, ffip will use that to populate the files regardless
of what files you happen to be editing.

ffip will scan the project tree each time it's invoked.  I couldn't
think of a better way to detect when files were added to the project.
In some cases this can be quite slow.  So, I added a variable called
find-file-in-project-cache-results that will not scan the project
again until you explicitly call find-file-in-project-rebuild-cache.

ffip can also exclude directories and files from the scan using the
find-file-in-projects-excludes and find-file-in-project-file-excludes.
See the documentation on those variables for more info.

I think what makes my version of ffip unique is that I do some
massaging of the results before giving it to ido-completing-read.
First, when there are multiple files in the project with the same name
(like 'new.html.erb') the entries are appended with the directory name
they are found in.  This makes it much easier to select the file you
want.  Second, I sort the choices based on the buffer-list so that the
files most recently visited come first in the list.  Much like
TextMate's cmd-T this means you can often just select the default when
you're wanting to switch to the file you were just in.

To be honest, I'm not using this much any more.  These days I rely
pretty heavily on ETags.  You can see some of my discussion on that at
http://blog.lathi.net/articles/2007/11/07/navigating-your-projects-in-emacs

find-file-in-project's People

Contributors

dougalcorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rsuniev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.