6

When I hit ctrl+f, then paste the searched phrase by ctrl+v and hit enter I expect the editor to Find the phrase, not to create another line in search box. Which is very irittating, since I have to manually click on the Find button. It happens now in Sublime Text 3 or program's linux version might be the case. How can I restore the proper behaviour?

4
  • Use tab instead of enter to finalize search. Commented Mar 9, 2014 at 22:03
  • tab creates indentation in search box
    – overdriven
    Commented Mar 9, 2014 at 22:05
  • actually I think it selects the phrase as you type - if pasting, consider adding and deleting an extra character; the first occurance should be selected by default and you can reach every other by ctrl+d as I know Commented Mar 9, 2014 at 22:07
  • For me, testing in sublime text 2, if I paste the phrase in it tells me how many times it occurs. If i hit ENTER it selects the first occurrence, if i hit ENTER again it selects the second occurrence. If the phrase contains a new line then it doesn't show it in the search box but it matches it if it can be matched. Suppose you type the phrase in (forget ctrl+v), is it not telling you how many times it occurs? And if you hit ENTER is it not matching the first occurrence?
    – barlop
    Commented Mar 9, 2014 at 23:49

4 Answers 4

11

I'll bet you are using the enter key on the keypad (right side of the keyboard)

Add a key mapping like this to user key mappings: Preferences -> Key Binding - User

{ "keys": ["keypad_enter"], "command": "find_next", "context":
        [{"key": "panel", "operand": "find"}, {"key": "panel_has_focus"}]
}

Source: http://sublimetext.info/docs/en/reference/key_bindings.html

1
  • Indeed, Enter btn under the Backspace works as expected. Your advise helped to fix this 'issue' with Sublim on the macOS.
    – Mykola
    Commented Oct 20, 2021 at 13:29
3

In Sublime Text 4 it seems the behavior has changed again and makes Enter add a newline. I've found a way to fix it by adding this to the User Key Bindings:

{ "keys": ["enter"], "command": "find_all",
    "context": [{"key": "panel", "operand": "find_in_files"}, {"key": "panel_has_focus"}]
},
2
  • Had this happen on 1/18/2022 and this was the quick and easy resolution wth Sublime build 4126. Commented Jan 18, 2022 at 16:46
  • Thank you so much, this helped me too for sublime 4.
    – Vall3y
    Commented Mar 10, 2022 at 13:04
0

I was able to reproduce this behavior in Sublime Text 3, but only when pressing Enter while still holding down Ctrl+V. Are you sure you're not pressing Enter too quickly?

If you are copy/pasting text within Sublime Text 3, you can also highlight the text and press Ctrl+F to immediately paste the selection into the search box, and use Enter to search.

For reference, I'm using build 3059 on Ubuntu 12.04 x64

0

You need to activate the wrap feature. This way the first occurrence will automatically be selected and hitting Enter should work as expected.

wrap search sublime text

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .