Globally move mouse pointer and click using VIM keystrokes?

Solution 1:

A tool that might just help you is Cliclick. With it, you can read the mouse position using the p:. command, move the mouse using the m:x,y command, and click using the c:. command.

This is a bit of a hack, really, but regarding the multi-monitor support, you can use Slate, where you can programmatically call Cliclick with the coordinates of the mouse in a different monitor. I'm sure there are other alternatives, though. I also used Slate to bind the other first calls to Cliclick.

The "mouse mode" is a bit tougher. In Slate you can create "modal hotkeys" pressing two hotkeys in succession (like ^W in Vim), but no support for whole modes. You could, however, dynamically edit the .slate.js binding file to contain "normal mode" or "mouse mode" bindings each time you change the mode.

I did something similar yesterday, so hope this helps. :)

Solution 2:

I use the nifty app: Karabiner: https://pqrs.org/osx/karabiner/

It's useful for major keyboard remapping, and there are packaged config options for using the keyboard to move the mouse, click, and even scrolling!

Solution 3:

I found an app that does this!

Keytty