I came across this Key Down Event
import sublime_plugin
import sublime
from random import randrange
DEFAULT_WAIT = 300
class CenterCurrentLineCommand(sublime_plugin.TextCommand):
def __init__(self, view):
self.view = view
settings = sublime.load_settings('Default.sublime-settings')
view.settings().set('center_current_line', settings.get('center_current_line', True))
def run(self, args):
sel = self.view.sel()
if len(sel) == 1 and self.view.settings().get('center_current_line'):
self.view.show_at_center(sel[0])
class CenterCurrentLineOnCommand(sublime_plugin.TextCommand):
def __init__(self, view):
self.view = view
def run(self, args):
self.view.settings().set('center_current_line', True)
class CenterCurrentLineOffCommand(sublime_plugin.TextCommand):
def __init__(self, view):
self.view = view
def run(self, args):
self.view.settings().set('center_current_line', False)
class CenterLineEventHandler(sublime_plugin.EventListener):
def __init__(self):
self.wait_id = None
def check_wait(self, wait_id):
if self.wait_id != wait_id:
new_wait_id = randrange(1, 999999)
self.wait_id = new_wait_id
sublime.set_timeout(
lambda: self.check_wait(wait_id=new_wait_id),
self.wait_ms
)
else:
self.wait_id = None
window = sublime.active_window()
view = window.active_view() if window != None else None
if view != None:
view.run_command('center_current_line')
def wait(self):
new_wait_id = randrange(1, 999999)
if self.wait_id == None:
self.wait_id = new_wait_id
sublime.set_timeout(
lambda: self.check_wait(wait_id=new_wait_id),
self.wait_ms
)
else:
self.wait_id = new_wait_id
def on_selection_modified(self, view):
self.wait_ms = view.settings().get('center_current_line_wait', DEFAULT_WAIT)
self.wait()
Is this what i’m looking for?
The work flow I want is command + p > browse to a file (have the status bar appear when I hit enter) > and disappear when I either the k, j or i key is pressed or any of the arrows, and if possible maybe even scrolling with the mouse ( but not essential )
Is there any chance you could make me a quick POC i’d be eternally grateful.