Skip to content

Instantly share code, notes, and snippets.

@kconragan
kconragan / keyrepeat.shell
Last active December 4, 2023 03:40
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@jonyesno
jonyesno / ddar-bsd.patch
Created April 28, 2011 08:13
Patch to build ddar on BSD / OS X
--- scan.c.orig 2011-04-28 08:28:05.000000000 +0100
+++ scan.c 2011-04-28 09:01:10.000000000 +0100
@@ -38,6 +38,14 @@
#define likely(x) __builtin_expect(x, 1)
#define unlikely(x) __builtin_expect(x, 0)
+#ifndef __linux__
+#define TEMP_FAILURE_RETRY(expr) \
+ ({ long int _res; \
+ do _res = (long int) (expr); \