Skip to content

Instantly share code, notes, and snippets.

@1player
Created February 8, 2024 12:09
Show Gist options
  • Save 1player/e5cc0740f97b7148d3fc90bb1d598b41 to your computer and use it in GitHub Desktop.
Save 1player/e5cc0740f97b7148d3fc90bb1d598b41 to your computer and use it in GitHub Desktop.
Emacs two finger gestures to scroll back and forth
(defun debounce (time fn)
(let ((ready t))
(lambda ()
(interactive)
(when ready
(funcall fn)
(setq ready nil)
(run-at-time time nil (lambda () (setq ready t)))))))
(global-set-key (kbd "<triple-wheel-right>") (debounce "0.25 sec" #'previous-buffer))
(global-set-key (kbd "<triple-wheel-left>") (debounce "0.25 sec" #'next-buffer))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment