Creating a custom command using the Fuzzy Finder package


#1

I want to create a custom command that copies the selected text, opens the Fuzzy Finder dialog and pastes the selected text in it. I have figured out the code looks something like this:

atom.commands.add 'atom-text-editor', 'custom:copy-to-file-finder', ->
  editor = atom.workspace.getActiveTextEditor()
  editor.selectLinesContainingCursors()
  editor.copySelectedText()
  SOMETHING
  editor.pasteText()

But this is my first init script, and since we’re talking about a plug-in, I need help with SOMETHING. Thanks.


#2

:wave: Hey there @jbnv! I believe this functionality is already implemented in Fuzzy Finder via the “Prefill from Selection” option? Settings -> Packages -> Fuzzy Finder