Vim - Feststelltaste-Status erkennen

Vim - Feststelltaste-Status erkennen

Meine Frage ist einfach und unkompliziert! =D

In diesem Thread @OsQu...

Vim – Ist die Feststelltaste aktiviert?

... besagt, dass Sie das unten stehende Automation Hotkey Scripting (AHK) verwenden können, um den Status der Feststelltaste (ein/aus) zu erkennen.

AUTOMATISIERUNGS-HOTKEY-SCRIPTING (AHK):

; INDICATE WHEN THE CAPS LOCK IS ON WITH A SCREEN MESSAGE
Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui, Font, caf001e s30 bold ,Verdana ;changes font color, size and font
Gui, Color, af001d;changes background color
Gui +LastFound  ; Make the GUI window the last found window for use by the line below.
WinSet, TransColor,af001d
Gui, Add, Text, ,CAPS LOCK ON
; TOGGLE THE GUI ON AND OFF
~capslock::
   if(0==GetKeyState("capslock","T")){
      Gui,  hide
   }else{
      if(guilocation>0){
         guilocation=0
         Gui, Show,x600 y800 NoActivate
      }else{
         guilocation=1
         Gui, Show,x600 y400 NoActivate
      }
   }
return

Meine Frage ist:Wie kann ich das oben stehende AHK (Automation Hotkey Scripting) in einer Funktion wie der folgenden in einer .vimrc-Datei verwenden?

VIM-SKRIPT (.vimrc):

func! CapsLockStatus()
    let l:caps_lock_status = <SOME_LOGIC_TO_CHECK_CAPS_LOCK_STATUS>
    if l:caps_lock_status == <SOME_VALUE>
        <MESSAGE_CAPS_LOCK_IS_ON>
    endif
endfunc

Danke!

NOTIZ:Mein Betriebssystem ist Linux!

@Ingo Karkat

verwandte Informationen