FocusIn event, serial 37, synthetic NO, window 0x2c00001, mode NotifyGrab, detail NotifyPointer
KeymapNotify event, serial 37, synthetic NO, window 0x0, keys: 4294967188 0 2 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
def sort_view_items(self): | |
cs = self.settings.case_sensitive | |
if self.settings.sort_by_file_name: | |
sk = lambda vi: (vi.name if cs else vi.name.lower(), vi.group, vi.tab) | |
elif self.settings.sort_by_folder: | |
sk = lambda vi: (vi.folder, vi.name if cs else vi.name.lower()) |
/* | |
Writes a left mouse button press or release event | |
directly to the input device of the mouse. | |
Credit for barebones code: https://goo.gl/upXCqR | |
Currently takes one arg which must be either of: | |
BTN_LF_PRESS: write a left mouse button press event | |
BTN_LF_RELEASE: write a left mouse button release event | |
Written by: mattst@i-dig.info @ 2018-03-02 |
# The following methods are part of a project and are not stand-alone code. As | |
# such anyone wishing to re-use the code will have to modify it, note the use of | |
# the class variables `self.active_window` and `self.active_view` which would | |
# need to be changed to valid instances of the active `window` and `view`. | |
def set_syntax(self, path): | |
""" | |
Sets the syntax associated with the file extension of path. | |
There is no method to get the syntax of a file extension in the ST API. |
# | |
# Name: JumpToCharSeq (Jump To Character Sequence) | |
# Requirements: Plugin for Sublime Text v.3 | |
# Written by: mattst@i-dig.info | |
# | |
# ST Command: jump_to_char_seq | |
# | |
# Optional Arg: direction | |
# ----------------------------------------------------------- |
# | |
# Name: JumpToCharSeq (Jump To Character Sequence) | |
# Author: mattst@i-dig.info | |
# Requires: Sublime Text v3 | |
# | |
# ST Command: jump_to_char_seq | |
# Optional Arg: direction --> "forwards" (default), "backwards" | |
# Optional Arg: case_sensitive --> boolean (default is false) | |
# |
# | |
# Name: Expand Selection By Expression | |
# Author: mattst@i-dig.info | |
# Requires: Sublime Text v3 | |
# | |
# ST Command: expand_selection_by_expression | |
# Optional Arg: expression_type --> "regex" (default), "literal" | |
# Optional Arg: case_sensitive --> boolean (default is false) | |
# |
# | |
# MIT License | |
# | |
# To use, assign keys to the "focus_most_recent_tab_closer" command, e.g. | |
# {"keys": ["ctrl+k", "ctrl+w"], "command": "focus_most_recent_tab_closer"}, | |
# | |
import sublime | |
import sublime_plugin | |
import time |
# | |
# Name: MoveTabInGroup | |
# Requirements: Plugin for Sublime Text v2 and v3 | |
# Written by: mattst - https://github.com/mattst | |
# ST Command: move_tab_in_group | |
# Arg Required: direction: "left" or "right" | |
# Description: An ST plugin to move the active buffer's | |
# tab left and right on the tab bar. | |
# |
# Proof of concept; retrieve the path of the syntax that a user has | |
# associated with any file extension in Sublime Text. | |
# | |
# 1) Create a temp file with the file extension of the desired syntax. | |
# 2) Open the temp file in ST with the API `open_file()` method; use a | |
# sublime.TRANSIENT buffer so that no tab is shown on the tab bar. | |
# 3) Retrieve the syntax ST has assigned to the view's settings. | |
# 4) Close the temp file's ST buffer. | |
# 5) Delete the temp file. | |
# |