ruebenramirez / blog

My blog
http://blog.ruebenramirez.com/
7 stars 0 forks source link

Vim and touchpad scrolling hell #305

Open ruebenramirez opened 8 years ago

ruebenramirez commented 8 years ago

Touchpads and Vim don't mix. (at least not for me) So while I'm in vim, I'll be in the zone and all of the sudden the cursor will knock up 3 lines while I'm typing...completely breaking my train of thought.

I have a keyboard shortcut that toggles the touchpad on my laptops on/off.

This works great as long as I remember to disable the touchpad before I get in the zone (often doesn't happen).

So what are my options to resolving this issue?

disable scrolling in vim

Disclaimer: I wasn't able to get this to work.

I found some useful info

tweak my syndaemon settings

syndaemon was written explicitly for the problem I'm having!

In my ~/.xinitrc file the first thing I do is setup syndaemon to help with this problem, but those settings

syndaemon -t -k -i 2 &

reading the syndaemon man page we see that

It turns out that you can have syndaemon poll the keyboard io more frequently, so I've updated my .xinitrc to:

syndaemon -d -m 100 -t -k -i 2.0

https://github.com/ruebenramirez/.dotfiles/commit/f782bc3639d95a54543eb54bc7f1f8ecfe56ecfc#diff-e8e122e009dedd906bd1c5c948a40a20R1

tweak my palm detection settings

Even with the syndaemon working to resolve a lot of this problem, I've noticed that my palms rest on the trackpad while I'm typing. I don't always elevate my wrists while typing either (not sure how bad of a habit this is for ergonomics)

synclient has some palm settings:

$ synclient | grep -i palm   
 PalmDetect              = 1
 PalmMinWidth            = 10
 PalmMinZ                = 20

I set these in my .xinitrc by calling out to a script:

synclient PalmDetect=1
synclient PalmMinWidth=8
synclient PalmMinZ=20

reading the synclient and synaptics man pages we see that

I have a couple of different laptops though. It seems this config will vary depending on the physical attributes of the touchpad (bumpy/glass surface, surface size, etc) as well as which touchpad driver is in use. These settings seem to be working on my early 2015 (12,1) 13" Macbook Pro Retina though.