Coder Social home page Coder Social logo

Comments (3)

mattie20 avatar mattie20 commented on July 17, 2024 1

--scheme=path does exactly what I need. I haven't really had many problems with the default beyond this, so I wouldn't worry about it too much. Plus, it would hurt results if you were, for example, looking through man pages. Thank you!

from fzf.

junegunn avatar junegunn commented on July 17, 2024

Does --scheme=path help?

fzf --tiebreak end --scheme path --query engine << EOF
Documents/c++code/pascal.wiki/engine.md
Documents/Archive/College/ME4201/AIAA EOP/Gas Turbine Engine Pictures/J79.JPG
Documents/Archive/College/ME4201/AIAA EOP/Gas Turbine Engine Pictures/CFM56 High Bypass Turbofan Engine.jpg
EOF

It's because in the default scheme, Engine after a space gets a higher bonus score than engine after /.

fzf/src/algo/algo.go

Lines 178 to 189 in 3ee1fc2

case "default":
bonusBoundaryWhite = bonusBoundary + 2
bonusBoundaryDelimiter = bonusBoundary + 1
case "path":
bonusBoundaryWhite = bonusBoundary
bonusBoundaryDelimiter = bonusBoundary + 1
if os.PathSeparator == '/' {
delimiterChars = "/"
} else {
delimiterChars = string([]rune{os.PathSeparator, '/'})
}
initialCharClass = charDelimiter

--scheme=path makes fzf use the same bonus point for both cases.


Come to think of it, it's a little strange that we don't use --scheme=path as the default when using fzf for files (i.e. using its default walker), let me see what I can do.


On second thought, I think it can be confusing to use different defaults on different contexts. While the default scheme gives a less desirable result in this case, it works okay in most cases where file names don't contain spaces.

from fzf.

junegunn avatar junegunn commented on July 17, 2024

Hopefully, 64faaf61f3030c006392bce7e370200b912ad001 will help users better understand the options.

from fzf.

Related Issues (20)

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.