Comments (6)
试试修改这些:https://github.com/S1ngS1ng/HammerSpoon/blob/master/vim-binding.lua#L11-L33
11 local keyHandler = function(e)
12 local watchFor = { h = "left", j = "down", k = "up", l = "right" } -- 这里把 hjkl 改成 awsd
13 local actualKey = e:getCharacters(true)
-- ......
19 if v and k ~= "ctrl" then -- 这里把 ctrl 改成 capslock。详情参考:http://www.hammerspoon.org/docs/hs.keycodes.html
-- .......
33 end
以及:https://github.com/S1ngS1ng/HammerSpoon/blob/master/vim-binding.lua#L35-L41
35 local modifierHandler = function(e)
-- ...
38 for k, v in pairs(flags) do
39 onlyControlPressed = v and k == "ctrl" -- 这里的 ctrl 改成 capslock
40 if not onlyControlPressed then break end
41 end
from hammerspoon.
改了之后并没有起作用……
from hammerspoon.
@mgdreamingstar
https://github.com/S1ngS1ng/HammerSpoon/blob/master/vim-binding.lua#L5
如果你只是改了上面说的这些部分,可以在第五行打开 debug,看一下输出对不对。
如果你不知道应该输出什么,可以先看一下原来的脚本输出啥,再和你改动之后的脚本比较一下。
或者你也可以把输出发上来。
再或者你也可以给我个你的配置链接。
现在就说一句“不起作用”,我也不知道你那里发生了什么
from hammerspoon.
还有就是,想先确认下你需要什么功能。这个功能,我的初衷是可以搭配 cmd
和 alt
以及 shift
使用的。
如果你不需要这个,仅仅是想实现你说的 capslock + awsd
,那完全可以直接用简单的 eventtap.keyStroke
去实现,不需要这么复杂
from hammerspoon.
基本操作
alt + h 左
alt + j 下
alt + k 上
alt + l 右
alt + , 句首
alt + . 句尾
alt + y = ctrl + k
与 ctrl 配合使用
Ctrl-Alt + h 光标向左移动一个词
Ctrl-Alt + l 光标向右移动一个词
与 Shift 配合使用
上面所列出的操作,配合 Shift 可以实现选中功能
想实现这样的功能怎么改?
from hammerspoon.
@zhangyu0806 https://github.com/kkamdooong/hammerspoon-control-hjkl-to-arrow/blob/master/init.lua
建议参考这个去写。
你提到的句首、句尾以及 ctrl + k
,还有移动一个词,我觉得直接用 keyStroke
发送对应的按键组合就好,会比改我的要简单些
from hammerspoon.
Related Issues (15)
- QQ on mac with configFile there is leg HOT 2
- thanks! HOT 1
- Catalina不生效|窗口管理功能不生效(只测试了窗口管理) HOT 2
- 数字键 HOT 1
- Add configuration for controlling volume based on bluetooth status HOT 1
- Error in window-management.leftHalf
- Window Always on Top HOT 1
- Hit and Miss Move Function HOT 4
- Could you split your functionality files from your key bindings files HOT 7
- Could you add window. PushHalfLeft PushHalfRight HOT 10
- 请问作者这截图工具用的什么啊? HOT 5
- 能否在非输入模式下直接用键盘移动鼠标位置? HOT 4
- Question? HOT 5
- suggestion for window managment HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hammerspoon.