I use AHK to autoconvert a string like `]dd` to the current date (see code below). When using this in most Windows text editors/areas, it works fine. But when I'm using `gvim` for Windows or `vim` in Ubuntu on WSL, I often have to type a "priming" character or try the hotstring a couple times for it to work. Searching the forum didn't return any hits on this particular issue.
Here's my script:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; This allows me to quickly enter date and time stamps.
::]dd::
FormatTime, TimeString, , yyMMdd ; LongDate
Send, %TimeString%
Return
:*:]t::
FormatTime, TimeString, , HHmm
Send, %TimeString%
Return
:*:]dt::
FormatTime, TimeString, , yyMMdd HHmm
Send, %TimeString%
Return