I open a lot of tabs in Sublime Text3. How are you looking for the target tab in a lot of tabs? I think there are various ways to do it, but I think most of them will be as follows.
--Search by moving with ctrl + tab (control + tab) --Jump by number with Alt + number (Command + number) --Do not open a lot of tabs in the first place. .. ..
Of these, it's annoying to search with ctrl + tab
, and jumping with ʻAlt + number` has more than 10 tabs open, and I don't know the number in the first place. .. ..
The third is a little. .. ..
So, I made a function to search tabs after studying. By the way, I'm new to Python.
Does Sublime have a tab search function in the first place?
--Windows --Sublime Text 3 is translated into Japanese
Click [Tools] => [Add Plugin].
A template will be created, so save it with ctrl + s
.
Make sure Packages / User
is selected as the save location, and save a suitable name with the extension .py
.
Tab search can be realized only with the following source code. Very easy
import sublime, sublime_plugin
import os
class FindTabListCommand(sublime_plugin.TextCommand):
def run(self, edit):
def on_done(index):
if index == -1:
return;
window = sublime.active_window()
tabs = window.views_in_group(window.active_group())
window.focus_view(tabs[index])
window = sublime.active_window()
tabs = window.views_in_group(window.active_group())
tabNames = []
for item in tabs:
if item.name() != "Find Results":
fileName = os.path.basename(item.file_name())
tabNames.append(fileName)
window.show_quick_panel(tabNames, on_done)
Set the key binding settings as follows and you're done.
{ "keys": ["ctrl+t"], "command": "find_tab_list"}
When executed, Sublime will open the familiar search box below and you can search for tabs.
Recommended Posts