Skip to content

Instantly share code, notes, and snippets.

@elegantcoder
Last active January 5, 2025 05:10
Show Gist options
  • Save elegantcoder/bf0745aed86374152762d47c9572309f to your computer and use it in GitHub Desktop.
Save elegantcoder/bf0745aed86374152762d47c9572309f to your computer and use it in GitHub Desktop.
vim_escape_to_en.json
{
"title": "Convert to en when ESC",
"//": "orignal author: johngrib(https://github.com/johngrib/simple_vim_guide/blob/master/md/with_korean.md)",
"rules": [
{
"description": "Convert to en when Ctrl+[",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
"modifiers": {
"optional": [
"any"
],
"mandatory": [
"left_control"
]
}
},
"to": [
{
"key_code": "escape"
}
],
"to_after_key_up": [
{
"select_input_source": {
"language": "en"
}
},
{
"key_code": "escape"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^io\\.alacritty$",
"^net\\.kovidgoyal\\.kitty$",
"^md\\.obsidian$",
"^com\\.jetbrains\\.WebStorm$",
"^com\\.jetbrains\\.datagrip$",
"^com\\.microsoft\\.VSCode$"
]
}
]
}
]
},
{
"description": "Convert to en when ESC",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "escape"
}
],
"to_after_key_up": [
{
"select_input_source": {
"language": "en"
}
},
{
"key_code": "escape"
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"^co\\.zeit\\.hyperterm$",
"^co\\.zeit\\.hyper$",
"^io\\.alacritty$",
"^net\\.kovidgoyal\\.kitty$",
"^md\\.obsidian$",
"^com\\.jetbrains\\.WebStorm$",
"^com\\.jetbrains\\.datagrip$",
"^com\\.microsoft\\.VSCode$"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment