Git Product home page Git Product logo

fuzzy-finder's Introduction

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

Fuzzy Finder package

OS X Build Status Windows Build Status Dependency Status

Quickly find and open files using cmd-t.

  • cmd-t or cmd-p to open the file finder
  • cmd-b to open the list of open buffers
  • cmd-shift-b to open the list of Git modified and untracked files

When opening a file, you can control the behavior.

  • enter defaults to opening the selected file without leaving the current pane
  • shift-enter defaults to switching to another pane if the file is already open there
  • cmd-k right (or any other directional arrow) will open the highlighted file in a new pane on the side indicated by the arrow
  • Adding :<line number> to the end of your search will go directly to the line number you specify, or the last line if the number is larger

Turning on the "Search All Panes" setting reverses the behavior of enter and shift-enter so enter opens the file in any pane and shift-enter creates a new tab in the current pane.

This package uses both the core.ignoredNames and fuzzy-finder.ignoredNames config settings to filter out files and folders that will not be shown. Both of those config settings are interpreted as arrays of minimatch glob patterns.

This package also will also not show Git ignored files when the core.excludeVcsIgnoredPaths is enabled.

fuzzy-finder's People

Contributors

50wliu avatar alhadis avatar as-cii avatar benogle avatar bronson avatar colch avatar damieng avatar darangi avatar defunkt avatar gjtorikian avatar izuzak avatar jasonrudolph avatar joshaber avatar kevinnathan avatar kevinsawicki avatar lee-dohm avatar lkashef avatar maxbrunsfeld avatar mcolyer avatar mnquintana avatar philschatz avatar probablycorey-and-nathan avatar probablykevin avatar rafeca avatar sadick254 avatar simurai avatar smashwilson avatar thedaniel avatar tmunro avatar zigomir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuzzy-finder's Issues

Indexing is slow

Indexing takes almost 10s (it might be closer to 5s, I don't have an exact time) for github/github. I know there's a lot of files and vendor/cache/ is a big source of slowness, but it essentially blocks all finding until it's indexed at least once and after the FS has changed, it has to reindex everything instead of updating the index with the new addition.

Would love to see some speedup here.

Undesired behaviour

When searching, I think the behaviour should be improved by showing, as a first result, the exact match.

Take this situation fro example:
example

Because I started to type the format of the file, it would be correct to assume that the file I'm searching for is "log.html" and it should be in the first position, immediately followed by "login.html"

Configuration for the Ignored Directories/Paths

Currently it seems, that there's no way to configure which directories are ignored for searching, which results in some problems with composer projects for example, where the directory containing most of the code is added to .gitignore, because it's managed by the package manager.

Maybe a toggle to use VCS ignore settings and a general Textfield like this:

Scoring of initialisms is much worse than sublime, emacs

Fuzzy finder scores strange, middle-of-word matches higher than perfect initialisms. Here's an example:

I am working on a project with a file called ImportanceTableCtrl.js.

I would like to type 'itc' and get this file as the top listing.

Atom's fuzzy finder gives me this list:

screen shot 2014-09-06 at 09 13 29

The file I'm looking for is not on the list. There's essentially no chance in hell that any of these files are the files I intended to ask for when I typed 'itc'. They're middle-of-word matches and middle-of-name initialisms. In order to get to the file I want, I have to delete characters and start over.

For comparison:

Sublime succeeds perfectly. See how the spec (a one-letter-longer initialism) is the next result? And it highlighted the characters it's matching, so I can see why it chose the files it chose.

screen shot 2014-09-06 at 09 15 11

Emacs gets the intended file as the second result, and the spec as the first. Ideally, the shorter name should be first, because I can always keep typing to get to the other. No one's going to be charmed by the interface, but it did the job -- finding the file only took one more keystroke than in Sublime.

screen shot 2014-09-06 at 09 15 49

No reindexing indicator

If I switch branches in github/github, switch to Atom, hit meta+t, and type the name of a file that is new in the branch, I will not see it until many seconds later. There is no indication that reindexing is happening, I just have to sit there knowing that reindexing is happening.

I would love it if there was at least some indication that the results is probably out of date and is being updated.

Uncaught TypeError: undefined is not a function

From @lagora on December 11, 2014 15:40

Uncaught TypeError: undefined is not a function

Atom Version: 0.154.0
System: Mac OS X 10.9.5
Thrown From: fuzzy-finder package

Steps To Reproduce

  1. ...
  2. ...

Stack Trace

At /Applications/Atom.app/Contents/Resources/app/node_modules/fuzzy-finder/lib/fuzzy-finder-view.js:118

TypeError: undefined is not a function
  at ProjectView.module.exports.FuzzyFinderView.openPath (/Applications/Atom.app/Contents/Resources/app/node_modules/fuzzy-finder/lib/fuzzy-finder-view.js:118:50)
  at ProjectView.module.exports.FuzzyFinderView.confirmed (/Applications/Atom.app/Contents/Resources/app/node_modules/fuzzy-finder/lib/fuzzy-finder-view.js:200:21)
  at ProjectView.module.exports.FuzzyFinderView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/fuzzy-finder/lib/fuzzy-finder-view.js:178:19)
  at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/select-list-view.js:113:24)
  at HTMLDivElement.handler (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:115:32)
  at HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:549:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:391:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:167:20)

Copied from original issue: atom/atom#4549

Preview selected files in list

filepreview

In ST3, when filtering through the files in their fuzzy finder, the editor displays the contents of the file temporarily so you can peek into them without opening them. This would be an awesome feature to have as it can be helpful when trying to nail down exactly which file contains what you're looking for.

Using ':' to go to a specific line number switches tabs to first tab

When you use Cmd+P to go to a line number (e.g. line 20 by using Cmd+P ":20"), fuzzy finder does not go to line 20 on the current tab, but on the first open tab.

Specifying the filename beforehand does go to that line number in the specified file, but if it is unspecified, it always does it on the first tab.

Changing window makes fuzzy finder disappear

Steps to reproduce:

Open fuzzy finder at Atom (CMD+t)
Type something in it
Change to another app window (CMD+tab)
Go back to Atom

Result: the fuzzy finder is gone as well as the search I was performing on it.

Cmd-T can be used to cancel indexing

If you hit meta-t, the file indexing kicks off. But if hit meta-t again to close the fuzzy finder, then hit it again, it'll start reindexing.

Expected: once Atom launches, indexing occurs. If the file finder is opened, you can show me the progress, that's cool. If I close the file finder and reopen it, don't cancel the indexing.

Here's a video detailing the problem: https://www.dropbox.com/s/1fy5kb80xtmn36d/atom_index.mp4

I can cancel the indexing whenever I want. I should not be able to do that.

Trying to go to a line suggests another file

I type CMD + P to open the fuzzy finder and type :22 in. I expect that to take me to line 22 of the currently opened buffer. Instead, fuzzy-finder seems to have any kind of file-prediction that doesn't get overridden with the :22 thing, so it takes me to line 22 of whatever that predicted file is, that doesn't have anything to do with the current one.

I hope I'm being clear.

If you smell where the problem can be, I could try to fix it by myself, but I haven't even seen the code yet.

Fuzzy find missing a lot of files

Hi
I have a Magento project ( a lot of files and folder levels). But when I try to do a fuzzy find, it looks like not all of the folders/files is searched/find.

The project is mainly .phtml files. And I can look at a file in the file tree, do a fuzzy find on the name - but Atom can not find it. I belive that it have worked before - but not now on version 0.94.

Regards, Magnus

More lenient queries

I submitted feedback in Atom.app, but I ultimately thought it would be a good idea to post it here.

searching

As you can see my query lass soci and lass fil soc both returned social.py in the results which is nested in lassie/filters/social.py

In atom, if I wanted to use Fuzzy Finder to find social.py I would have to type exactly lassie/filters to get a list of the files in filters or social.py -- But in, say, a Django project, where you have multiple urls.py, it might not be as easy to search just urls.py; you could get a ton of results.

Say my app/folder name was campaigns, I'd like to be able to search camp urls and that return me project/campaigns/urls.py in the results.

This functionality is similar to how Sublime Text returns results.

Latest opened buffers list with cmd+t

Hi,

Like SublimeText2 it would be cool to show a list of latest opened buffers when pressing cmd+t. It is very useful to quickly navigate to the previous edited file doing the following steps:

  • cmd+t and it shows the list of latest opened buffers
  • arrow down
  • enter

That's the way I like to navigate to files that I know are opened because I've been working with them seconds or few minutes ago.

UI doesn't update when reindexing is happening

If I try to use fuzzy-finder right after switching branches, it says reindexing. Fair enough. But if I try to type while this is happening, it takes a while for keystrokes to appear and for the results to render. It seems like the reindexing is blocking the UI thread. Any chance reindexing can happen without impacting the UI?

cmd-t should work when Atom doesn't have a current working directory

(moved over from atom/atom#1642)

support/b62ac6b69fc211e387a72d6e148f9cfd?page=1

cmd-t should work when you start Atom from the OS (launchpad, dock, finder, spotlight) and it doesn't have a current working directory.

This was really confusing to me, especially as I was trying to follow the getting started guide. I only discovered that things worked by running 'atom' from the command-line in a git repo directory.

find files where the search term is in the path

I work with a couple of libraries that have standardized files like

install.rb
hooks.rb
manage.rb

the directory name contains the disambiguating item ie:

nginx/install.rb
nginx/hooks.rb
mysql/install.rb
mysql/manage.rb

etc.

This is not a problem for the sublime2 finder, typing in 'nginx/install' will find the appropriate file. Atom's finder will not.

fuzzy finder shows files that should be ignored

I'm seeing a strange issue where files in my build directory are showing up in fuzzy finder.
image

From this screenshot you can see that the build directory is properly ignored in my directory structure in the left pane, but build/js/calc/calc.js is still showing up in the fuzzy finder results. What's particularly strange is that I have siblings of calc that do not exhibit this behavior (if I type eval, build/js/eval/eval.js does not show up in the results).

The build directory is (a) in my .gitignore (b) part of my ignored names in core atom and (c) in my ignored names in fuzzy finder settings. In none of these cases is anything done to distinguish eval vs. calc.

Any advice on how I can start going about debugging what's happening here?

I'm on OS X with atom version 0.141.0

Cannot ignore directories

Reading through the load-paths-handler source, it looks like the ignoredNames config only matches the file name without extension (the base name). This obviously doesn't work when you want to specify an ignore on a directory level, such as for build products or dependencies.

I would prefer to specify ignores with a syntax like .gitignore, from the root of the current project. For example:

'fuzzyFinder':
  'ignoredNames': [
    'public/*'
    'bower_components/*'
    'node_modules/*'
  ]

Can't find a file called "user.rb" with default settings

With "Ignore Vcs Ignored Paths" disabled, the default set of Ignored Names globally, and none for Fuzzy Finder, it can't find a file called user.rb in the submodule of my project. (but it finds other files in the same folder fine, and it can find the file if I rename it)

That's a really vague description, so if there's anything I can do to give debugging information, please let me know!

Not work after `atom.project.setPath`

I am writing a package switch project use atom.project.setPath.

But after I setPath of a project, the tree view and other packages works as expected. But fuzzy-finder is not work well, it still show old items before setPath.

I think it is a bug.

Dialog closes when indexing and looses focus

If I Command-T, I see a "project is being indexed dialog". I have a really big project, so this takes quite awhile. While waiting, I'll switch apps to do other stuff. When atom looses focus, the dialog goes away, and then when I hit command-T again, indexing starts over from 0. It would be nice if I could do other things wile the project is being indexed.

fizzy-finder should prefer exact matches

This is actually probably a larger issue of matching preference, but one specific instance is when a file matches by exact filename. Here is an example when a file matched exactly, but a different file with additional text at the end of the non-extension part of the filename was listed ahead of it.

Screenshot

Cannot type the letter J when I have a key sequence starting with J

When I have this key sequence set in my keymap, I cannot type the letter J in the Cmd-T prompt:

'.editor':
  'j k': 'vim-mode:activate-command-mode'

I can still type the letter K in the prompt.

I don't think vim-mode is the problem, because when I disabled vim-mode this was still an issue. It was only removed when I commented this config.

Atom, search and 'deep' .gitignore files

Atom excludes files in .gitignore from search, which is awesome! ⛵

It would be even better if it also considered .gitignore files below the root directory.

Feel free to close if this is difficult to solve.

use fuzzy find to open folder

When using fuzzy finder, i'd like to also open folder.
Maybe presenting it with different icon, just to assure that it's a folder, not a file

Sorting search results

Multiple schemes can be employed to achieve results which are most relevant to the user. Predicting which file a user wants out of a long list of possible matches and presenting it first can help speed up development time/maintain flow and train of thought. Here are some ideas to discuss:

  • Sort least fuzzy results to the top. Fuzziness determined by search term run length in the result. ie. Search term of 'src' would score a higher fuzziness score on a file like .jshintrc than a file called app_src.js or files in the src/ directory. run length of first file is 2 while the second file has a run length of 3.
  • Filename match or directory match. A match on a filename should be sorted at a higher priority than a match on a full path, but what about matches which higher run length on a full path vs less run length on a filename. ie. search of 'src ap' currently displays images/destroy_discard.png higher than src/app.coffee. Although destroy_discard technically has more matched character within the filename than src/app.coffee src/app has more run length. (something to think about)
  • Dot files. Hidden files are less important than non hidden of equal score.
  • Ignored files (.gitignore) can be sorted at lower priority than files with equal score. ie. I want the index.html in my templates/ dir. not my build/ dir because this is in .gitignore. Editing temporary file by mistake can add confusion and lost work.
  • Sort files with most recent last modified date at a higher priority than those of equal score.
  • Filter out/sort to bottom files that are already open.

Add API to atom.packages

It would be great to be able to access the fuzzy-finder lib off of an api on atom.packages for reuse in other packages.

Can't find files that have been .gitignored

I have a number of files that have an extension .template that are checked into git. The developer copies the database.yml.template to database.yml in order to run the project. To prevent the customized templates from being checked in they are added to the .gitignore.

However when you search with fuzzy finder it will refuse to show you the the .gitignored version, only the database.yml.template is shown.

sublime shows both versions with the shorter version being prioritized higher.

Files with same paths are too truncated

in CMD+t, when you have multiple files with the same name and the path is to long it end with '...', which is fine if the paths of the files are almost equal

Doesn't update when new files are added

I really don't know when this is happening. But it seems that sometimes when I add files with touch file.txt the fuzzy-finder does not list it, and you have to close the window and reopen it to show it (reload window also works). Worth noting is that it appears as it should in the tree-view.

Fuzzy finder does not work as expected with untitled/unsaved files

Summary: when Atom starts a new sessions and a new file is successively created with ctrl+n, the user is unable to trigger ctrl+p to locate these files. When the user saved one of these files, fuzzy finder starts to act correctly.

For example, creating several files within Sublime Text does allow the user to navigate between these files/buffers with the fuzzy finder; unsaved files are identified by the first line of the content.

This behaviour is quite annoying when tabs are disabled as this means there is no easy navigate between the files.

FR: Ability to set lang precedence

Use Case

Depending on the team I'm working with, I may be using Jade or writing HTML the old-fashioned way.

It doesn't make sense to ignore HTML files, because it's (to my knowledge) currently only possible at a global level. I could see this use case becoming obsolete, but I'll bet others have other more common use cases. If so, chime in people!

Better way to open a new file in a new pane

Please let me know if there's a better way, but as I understand right now this is how to open a new file in a new pane:

  1. cmd-b right Split the current pane in the desired direction
  2. cmd-k cmd-w Close the split file that you don't really want anyway
  3. cmd-T To find the new file
  4. enter to open in current (new) pane

Things get a bit more confusing if you have Atom set to destroy empty panes.

Anyway, I was wondering if there is a better way to do this. Is there (A) a way to create an empty pane so steps 1 & 2 could be combined? Alternatively, would it make sense to have something (B) like the following:

  1. cmd-T To find the file, but don't press enter!
  2. cmd-k right to open the selected file in a new pane

I think A is probably the better option, but maybe both A and B should exist?

Choose already opened file even from another pane

(This could be a fuzzy-finder option. Original issue is atom/atom#1303)

Behavior expected

Opening a file from cmd-b or cmd-p should go directly to the file if it's already opened, regardless of pane.

Behavior observed

The file is selected if you're in the same pane, but opened new if not.

Thoughts

This could be behavior that can be had both ways. For example, if you open a file with enter it will go to the already opened file but if you open with shift-enter it opens a new copy in the current pane.

/via @caseycrites

Should be able to open ignored files

Currently the fuzzy finder doesn't display ignored files. This is unexpected behavior coming from ST3. One use case that I have, many projects I work on have local configuration files that are not a part of the repo, but I do need to edit them on occasion. Also, when working on the atom source I need to manually open anything inside of node_modules.

Inverse of Ignored Names

A cool addition to fuzzy finder would be a config item that did the inverse of Ignored Names - basically a inclusion list of file extensions.

In most projects it would be easier for me to list the file types I would like to include rather than the reverse.

Center search box on pane not window

It's nice to have a confirmation of which pane you are about to open the new file in. The way sublime handles this by centering the box over the pane it will open is a nice mental queue for this.

Ignored names ending with '/'

I recently tried to add a few folders to exclude from fuzzy finder result set. I did so by suffixing the folder names with forward slash (/), i.e. .sass-cache/. This apparently did not work, I had to delete the slash (to .sass-cache).

Is this WAI? I found it a tad confusing..

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.