Hotstrings don't always fire using gvim or vim in WSL Ubuntu

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
muraii
Posts: 3
Joined: 05 Jun 2018, 22:20

Hotstrings don't always fire using gvim or vim in WSL Ubuntu

05 Jul 2019, 10:31

Hello!

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
I'm using version `1.1.30.03`.
Kobaltauge
Posts: 264
Joined: 09 Mar 2019, 01:52
Location: Germany
Contact:

Re: Hotstrings don't always fire using gvim or vim in WSL Ubuntu

16 Mar 2020, 04:46

Hi @muraii did you find a solution? I have the same problem.

OK. After a little search if found this solution. https://stackoverflow.com/a/57068056/9307482

To make it work reliably and consistently in Vim, in the hotstring option, include both question mark and asterisk (:*?:...) instead of just asterisk or empty option.
muraii
Posts: 3
Joined: 05 Jun 2018, 22:20

Re: Hotstrings don't always fire using gvim or vim in WSL Ubuntu

13 Nov 2021, 13:41

Hi @Kobaltauge! Yep, that very thing is what worked for me.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 380 guests