sublime-undocs icon indicating copy to clipboard operation
sublime-undocs copied to clipboard

Commands for toggling options in the find/replace panels

Open mattst opened this issue 8 years ago • 0 comments

NOTE: Sublime Text 3

There are no default key bindings to toggle the following options in the various find/replace panels. Nor are there documented commands for them anywhere at all that I could find, with the exception of the toggle_in_selection command which is mentioned in the ST forums.

  • Toggle Wrap
  • Toggle In Selection
  • Toggle Highlight Matches
  • Toggle Show Context (find/replace in files only)
  • Toggle Use Buffer (find/replace in files only)

Today I had a play around with guessing the command names and managed to find them all quite easily with a little trial-and-error.

Find/Replace Panel Options - Not Documented Anywhere AFAICT
-----------------------------------------------------------
Toggle Wrap:               Command: toggle_wrap
Toggle In Selection:       Command: toggle_in_selection
Toggle Highlight Matches:  Command: toggle_highlight
Toggle Show Context:       Command: toggle_show_context
Toggle Use Buffer:         Command: toggle_use_buffer

The rest (below) all already have key bindings in the default key bindings files:

Find/Replace Panel Options
--------------------------
Toggle Regex:              Command: toggle_regex
Toggle Case Sensitive:     Command: toggle_case_sensitive
Toggle Whole Word:         Command: toggle_whole_word
Toggle Preserve Case:      Command: toggle_preserve_case

None of these at all are documented in the Sublime Text Unofficial Documentation. I think someone should add them all along with an example key binding showing how to set them up to work within the context of the find/replace panels which is done like this.

{ "keys": ["alt+h"], "command": "toggle_highlight", "context":
    [
        { "key": "setting.is_widget", "operator": "equal", "operand": true }
    ]
},

I have posted them in a post on the Sublime Text forum.

Hope this helps.

mattst avatar Oct 09 '16 20:10 mattst