使用AutoHotKey(AHK)创建类似Vim的功能 [英] Creating Vim like functionality with AutoHotKey (AHK)

查看:451
本文介绍了使用AutoHotKey(AHK)创建类似Vim的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在Windows 8机器上一直使用 autoHotKey 并喜欢它.但是我希望能够按下大写锁定,并将键盘变成类似于命令模式的vim,以便在任何程序中轻松移动光标,插入和删除.

I've been using autoHotKeyrecently on a windows 8 machine and loving it. But I want to be able to press caps lock and turn the keyboard into a vim like command mode for moving the cursor, inserting and deleting easily in any program.

更新(感谢@MCL的帮助)

UPDATE (Thanks to @MCL for the help so far)

我正在尝试使用以下脚本,但不会根据状态更改行为

Im trying to use the following script but it wont change the behaviour based on the state

state := GetKeyState("Capslock", "T") 
if state
  j::Send,{Left}
  l::Send,{Right}
  i::Send,{Up}
  k::Send,{Down}
return

推荐答案

使用 #If :

#If GetKeyState("CapsLock", "T")=1

; The following hotkeys will only be effective if GetKeyState("CapsLock", "T")=1
j::Send,{Left}
l::Send,{Right}
i::Send,{Up}
k::Send,{Down}

#If ; end of #If

这篇关于使用AutoHotKey(AHK)创建类似Vim的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆