Instantly share code, notes, and snippets.
Last active
December 1, 2021 14:32
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save honsa/f8396f9f0d33609ebac1a48a43ef835f to your computer and use it in GitHub Desktop.
Karabiner Elements Finder Improved Navigation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Finder improved navigation", | |
"rules": [ | |
{ | |
"description": "Use F2 as Rename and set onedit", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "f2" | |
}, | |
"to": [ | |
{ | |
"key_code": "return_or_enter" | |
}, | |
{"set_variable": | |
{ | |
"name": "onedit", | |
"value": 1 | |
} | |
} | |
], | |
"conditions": [ | |
{ | |
"type": "frontmost_application_if", | |
"bundle_identifiers": [ | |
"^com.apple.finder" | |
] | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"description": "Use Backspace as Go to Previous Folder in Finder if not onedit", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com.apple.finder" | |
], | |
"type": "frontmost_application_if" | |
}, | |
{ | |
"name": "onedit", | |
"type": "variable_if", | |
"value": 0 | |
} | |
], | |
"from": { | |
"key_code": "delete_or_backspace" | |
}, | |
"to": [ | |
{ | |
"key_code": "semicolon", | |
"modifiers": [ | |
"left_command" | |
] | |
} | |
], | |
"type": "basic" | |
} | |
] | |
}, | |
{ | |
"description": "Use Return as Open if not renaming file", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com.apple.finder" | |
], | |
"type": "frontmost_application_if" | |
} | |
, | |
{ | |
"type": "variable_unless", | |
"name": "onedit", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "return_or_enter", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{ | |
"key_code": "o", | |
"modifiers": [ | |
"right_command" | |
] | |
} | |
], | |
"type": "basic" | |
} | |
] | |
}, | |
{ | |
"description": "Use Return to finish renaming when onedit=1", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com.apple.finder" | |
], | |
"type": "frontmost_application_if" | |
}, | |
{ | |
"name": "onedit", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "return_or_enter", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{"key_code": "return_or_enter"}, | |
{"set_variable": | |
{ | |
"name": "onedit", | |
"value": 0 | |
} | |
} | |
], | |
"type": "basic" | |
} | |
] | |
}, | |
{ | |
"description": "Use Esc to finish renaming when onedit=1", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com.apple.finder" | |
], | |
"type": "frontmost_application_if" | |
}, | |
{ | |
"name": "onedit", | |
"type": "variable_if", | |
"value": 1 | |
} | |
], | |
"from": { | |
"key_code": "escape", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] | |
} | |
}, | |
"to": [ | |
{"key_code": "escape"}, | |
{"set_variable": | |
{ | |
"name": "onedit", | |
"value": 0 | |
} | |
} | |
], | |
"type": "basic" | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment