![]() ![]() Say you were able to poll the correct lookup key for the status text to determine if it is INSERT or COMMAND, and then execute a shell command (exe or ahk script)-this could feed your hotstring script to enable/disable various key combos. In other words, setting the window title might be difficult, but it might not be as difficult to run a separate exe or ahk script directly from sublime. It may be worth considering other types of interaction (besides using AutoHotkey #IfWinActive and setting the window title.You could write your own sublime package to read the status bar text, and process what to do based on that kind of polling.Getting the OCR to work can be a little tricky also (but is doable). This would probably work with some minimal amount of processing but would always require a delay between the time it changes mode vs. You could use polling in AutoHotkey combined with OCR to read the status bar (using GDIP or something similar).The status bar is not a separate control, it appears to be part of the general PX_WINDOW_CLASS for the entire window, so that's no good for reading the text value directly (straight from AutoHotkey).I don't know how to implement this in Sublime, but a few thoughts/observations Is it possible to write a very simple plugin/package to Sublime Text just to have it display the words "COMMAND mode" or "INSERT mode" on the title bar when Vim is enabled? This could make AutoHotKey aware of the current mode and turn of the hostrings. As for Sublime Text with Vim mode enabled, it will display "COMMAND MODE" or "INSERT MODE" in the status bar, not in the title bar! So AutoHotKey is unable to tell whether Sublime Text's Vim is currently on COMMAND or INSERT mode. Example: if the active window has a string like " - Sublime Text" in its title, we can have it ignore the hotstrings input. Absolutely catastrophic.īut AutoHotKey is powerful, and we can set it to ignore some windows. which would jump to end of word, delete current line, switch to insert mode, insert "e Vedder". ![]() ![]() This is unwanted.Įven worse is it when the expansion part itself contains a meaningful Vim sequence: However, in Vim, "xeno" would, sequentially, delete current line, then jump to end of word, then search for next occurence of input string, then open a new line. which means, if it type "xeno" then it will expand to "xenófobo". However, there is a major problem: the Vim commands can interfere with AutoHotKey's hotstrings. Recently I've been learning how to use Vim, and I'm getting comfortable enabling the "Vintage mode" in Sublime Text. These two human inventions boost my day-to-day productivity in an unimaginable way. Sublime Text is by far the best text editor I've ever seen, and AutoHotKey is the scripting program I can't live without, especially the hotstrings feature, which allows me to create abbreviation-expansion pairs, speeding up the typing significantly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |