Code Monkey home page Code Monkey logo

Comments (7)

kankaristo avatar kankaristo commented on June 11, 2024

Alternatively, allow for multiple grep commands in settings, and a toggle between them in the dialog window?

ag --literal should still be the default in my opinion, because people might just think that atom-fuzzy-grep is "broken" when it doesn't find anything. It doesn't report an error, unlike ag on the command line.

from atom-fuzzy-grep.

geksilla avatar geksilla commented on June 11, 2024

@kankaristo, thanks for report. I will add error handling on described case. Regarding --literal flag as default option actually I don't want to enable it by default because of regexp power. You can set any command/flag which useful for you on plugin settings page. Thanks.

from atom-fuzzy-grep.

kankaristo avatar kankaristo commented on June 11, 2024

What do you think about having the option to choose between different search commands?

I agree that it would be bad to lose the regex search altogether, but it would be nice to have a drop-down box with different search commands, so you could switch between them without having to go the settings.

This could be a string array in settings and a drop-down box in the search dialog.

from atom-fuzzy-grep.

geksilla avatar geksilla commented on June 11, 2024

I want to keep UI minimal and provide fast interaction with dialog without mouse or redundant key press.
You can add custom script to your ~/.atom/init.coffee to switch between search command by set atom-fuzzzy-grep.grepCommandString to any value you want via some key binding.

from atom-fuzzy-grep.

kankaristo avatar kankaristo commented on June 11, 2024

I didn't even think of that option. Thanks! :D

That suggestion could be added to README.md, in case someone else wants multiple search commands.

I'll leave this ticket open for now, since atom-fuzzy-grep should show an error when the search fails entirely (like with ag "Hierarchy(").

from atom-fuzzy-grep.

geksilla avatar geksilla commented on June 11, 2024

@kankaristo, thanks!

from atom-fuzzy-grep.

kankaristo avatar kankaristo commented on June 11, 2024

In case someone else wants to have a key binding to change the grep command, here's what I did in init.coffee:

atom.commands.add 'atom-workspace', 'fuzzy-grep:change-search-command', ->
  currentCommand = atom.config.get('atom-fuzzy-grep.grepCommandString')
  commands = [
    'ag -S --nocolor --nogroup --column --literal',
    'ag -S --nocolor --nogroup --column'
  ]
  newCommand = commands[0]
  for command, i in commands
    if command is currentCommand and commands[i + 1]?
      newCommand = commands[i + 1]
      break
  atom.config.set('atom-fuzzy-grep.grepCommandString', newCommand)
  atom.notifications.addInfo(
    "Changed fuzzy-grep search command",
    {detail: newCommand}
  )

Then just bind fuzzy-grep:change-search-command to something.

from atom-fuzzy-grep.

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.