Search Edit | Focus Search Edit (Move caret to end)

Have a suggestion for "Everything"? Please post it here.
JerryWhaaaat
Posts: 1
Joined: Mon Jun 22, 2026 10:36 am

Search Edit | Focus Search Edit (Move caret to end)

Post by JerryWhaaaat »

Apologies if this already exists or if there's a workaround I've missed. I've searched through the documentation, forum posts, and settings but haven't found a solution.

I'd like to request a separate command/hotkey that focuses the search edit box and places the caret at the end of the current search text, without selecting the entire query.

Currently, shortcuts such as Alt+D focus the search box and select all text, which is useful and I'd like to keep that behavior. However, there are many times when I simply want to append to an existing search without overwriting it.

I noticed that select_search_on_focus_mode affects the behavior of Search Edit | Focus Search Edit, but changing it also affects scenarios where I still want the text to be selected when focusing the search box.

My current workaround is disabling Select search on mouse click and using the mouse to focus the search bar with caret at the end, but a dedicated command such as: Search Edit | Focus Search Edit (Move caret to end) would provide more flexibility and allow separate hotkeys for each behavior.

Thanks
therube
Posts: 5763
Joined: Thu Sep 03, 2009 6:48 pm

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by therube »

? Maybe you could create a (hotkey) "macro" that sets the 'set_search_on...' to 'Move caret to end', then focuses on the searchbar (at which point focus would be at the end), then sets it back to it's previous setting ?


(Maybe you can't, don't know?)

Maybe something similar to, Can the visible path in the results be toggled?.
void
Developer
Posts: 20067
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by void »

To focus the search edit and move the caret to the end:
  • In Everything 1.5, from the Bookmarks menu, click Add to bookmarks....
  • Change the Name to:
    Focus Search and Move Caret to End
  • Change the Search to:

    Code: Select all

    /focus 10007
    /set-search-caret-position -1
    
  • Optionally bind a keyboard shortcut.
  • Click OK.
/focus
/set-search-caret-position
tuska
Posts: 1410
Joined: Thu Jul 13, 2017 9:14 am

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by tuska »

2void

Would it be possible to modify this code so that a space is automatically added to the end of the search query
after executing the command:
/set-search-caret-position -1
?

Reason:
Normally, I try to narrow down a search query even further, and to do that, I need a space at the end of the search query.

If that isn't possible, though, I'm still very happy with this solution.
void
Developer
Posts: 20067
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by void »

Please try:

Code: Select all

/focus 10007
/set-search <REGEXREPLACE:$search:," $","">" "
/set-search-caret-position -1
/set-search
<REGEXREPLACE:...>
$search:
tuska
Posts: 1410
Joined: Thu Jul 13, 2017 9:14 am

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by tuska »

void wrote: Wed Jun 24, 2026 1:23 am Please try:

Code: Select all

/focus 10007
/set-search <REGEXREPLACE:$search:," $","">" "
/set-search-caret-position -1
/set-search
<REGEXREPLACE:...>
$search:
Thank you!
This works like a charm. :)
void
Developer
Posts: 20067
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search Edit | Focus Search Edit (Move caret to end)

Post by void »

Just making a small note here:
Everything 1.5.0.1416b adds the following command IDs:

Code: Select all

#define UI_ID_SEARCH_EDIT_FOCUS_AND_NO_SELECT			41220
#define UI_ID_SEARCH_EDIT_FOCUS_AND_SELECT_ALL			41221
#define UI_ID_SEARCH_EDIT_FOCUS_AND_MOVE_CARET_TO_END		41222
#define UI_ID_SEARCH_EDIT_MOVE_CARET_TO_END			41223
These can be called with /command <id>