Sublime Forum

How can I use subl to locate the exact text

#1

Right now, i can locate the file by using filePath:linenumber to get which line is what i need, but i want to implement more accurate position ,i need to get the get the search panel command, but I tried like "subl --command " with “show_panel”,“find”,“findNext” and so on ,no one works. I wonder to know if the command tool support all the command in Default (OSX).sublime-keymap.

Sorry about my poor english. Anyone can answer my question will be really appreciated.
BRs,

0 Likes

#2

IIRC, only ApplicationCommands can be called from the command-line helper.

For example, this command:

[code]import sublime, sublime_plugin

class SayHelloCommand(sublime_plugin.ApplicationCommand):
def run(self, *args, **kwargs):
v = sublime.active_window().new_file()
v.run_command(‘insert’, {“characters”: “Why, hello!”})
[/code]

… can be called like so:

$ subl.exe --command say_hello

However, at least on Windows, this won’t work if Sublime Text isn’t yet running. If it’s running already, then it’ll work (for me, at least). No idea if this is by design or a bug.

0 Likes

#3

thanks for your reply.

wont wokr on macos
:frowning:

0 Likes