2021-04-21 09:48:30 +02:00
|
|
|
local function keymap_macos(keymap)
|
2021-04-21 10:16:51 +02:00
|
|
|
keymap.add_direct {
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+shift+p"] = "core:find-command",
|
|
|
|
["cmd+p"] = "core:find-file",
|
|
|
|
["cmd+o"] = "core:open-file",
|
|
|
|
["cmd+n"] = "core:new-doc",
|
|
|
|
["cmd+shift+c"] = "core:change-project-folder",
|
|
|
|
["cmd+shift+o"] = "core:open-project-folder",
|
2021-06-09 20:23:40 +02:00
|
|
|
["cmd+ctrl+return"] = "core:toggle-fullscreen",
|
2021-04-21 09:48:30 +02:00
|
|
|
|
2021-06-09 20:23:40 +02:00
|
|
|
["cmd+ctrl+shift+j"] = "root:split-left",
|
|
|
|
["cmd+ctrl+shift+l"] = "root:split-right",
|
|
|
|
["cmd+ctrl+shift+i"] = "root:split-up",
|
|
|
|
["cmd+ctrl+shift+k"] = "root:split-down",
|
|
|
|
["cmd+ctrl+j"] = "root:switch-to-left",
|
|
|
|
["cmd+ctrl+l"] = "root:switch-to-right",
|
|
|
|
["cmd+ctrl+i"] = "root:switch-to-up",
|
|
|
|
["cmd+ctrl+k"] = "root:switch-to-down",
|
2021-04-21 09:48:30 +02:00
|
|
|
|
2021-06-27 19:18:54 +02:00
|
|
|
|
|
|
|
["cmd+w"] = "root:close-or-quit",
|
2021-06-08 16:13:00 +02:00
|
|
|
["ctrl+tab"] = "root:switch-to-next-tab",
|
|
|
|
["ctrl+shift+tab"] = "root:switch-to-previous-tab",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+pageup"] = "root:move-tab-left",
|
|
|
|
["cmd+pagedown"] = "root:move-tab-right",
|
2021-06-09 20:23:40 +02:00
|
|
|
["cmd+1"] = "root:switch-to-tab-1",
|
|
|
|
["cmd+2"] = "root:switch-to-tab-2",
|
|
|
|
["cmd+3"] = "root:switch-to-tab-3",
|
|
|
|
["cmd+4"] = "root:switch-to-tab-4",
|
|
|
|
["cmd+5"] = "root:switch-to-tab-5",
|
|
|
|
["cmd+6"] = "root:switch-to-tab-6",
|
|
|
|
["cmd+7"] = "root:switch-to-tab-7",
|
|
|
|
["cmd+8"] = "root:switch-to-tab-8",
|
|
|
|
["cmd+9"] = "root:switch-to-tab-9",
|
2021-11-07 21:43:40 +01:00
|
|
|
["wheel"] = "root:scroll",
|
|
|
|
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+f"] = "find-replace:find",
|
|
|
|
["cmd+r"] = "find-replace:replace",
|
|
|
|
["f3"] = "find-replace:repeat-find",
|
|
|
|
["shift+f3"] = "find-replace:previous-find",
|
|
|
|
["cmd+g"] = "doc:go-to-line",
|
|
|
|
["cmd+s"] = "doc:save",
|
|
|
|
["cmd+shift+s"] = "doc:save-as",
|
|
|
|
|
|
|
|
["cmd+z"] = "doc:undo",
|
|
|
|
["cmd+y"] = "doc:redo",
|
|
|
|
["cmd+x"] = "doc:cut",
|
|
|
|
["cmd+c"] = "doc:copy",
|
|
|
|
["cmd+v"] = "doc:paste",
|
2021-04-21 10:16:51 +02:00
|
|
|
["ctrl+insert"] = "doc:copy",
|
2021-04-21 09:48:30 +02:00
|
|
|
["shift+insert"] = "doc:paste",
|
|
|
|
["escape"] = { "command:escape", "doc:select-none", "dialog:select-no" },
|
|
|
|
["tab"] = { "command:complete", "doc:indent" },
|
|
|
|
["shift+tab"] = "doc:unindent",
|
|
|
|
["backspace"] = "doc:backspace",
|
|
|
|
["shift+backspace"] = "doc:backspace",
|
2021-08-30 14:21:16 +02:00
|
|
|
["option+backspace"] = "doc:delete-to-previous-word-start",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+shift+backspace"] = "doc:delete-to-previous-word-start",
|
2021-08-30 14:21:16 +02:00
|
|
|
["cmd+backspace"] = "doc:delete-to-start-of-indentation",
|
2021-04-21 09:48:30 +02:00
|
|
|
["delete"] = "doc:delete",
|
|
|
|
["shift+delete"] = "doc:delete",
|
2021-08-30 14:21:16 +02:00
|
|
|
["option+delete"] = "doc:delete-to-next-word-end",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+shift+delete"] = "doc:delete-to-next-word-end",
|
2021-08-30 14:21:16 +02:00
|
|
|
["cmd+delete"] = "doc:delete-to-end-of-line",
|
2021-04-21 09:48:30 +02:00
|
|
|
["return"] = { "command:submit", "doc:newline", "dialog:select" },
|
|
|
|
["keypad enter"] = { "command:submit", "doc:newline", "dialog:select" },
|
|
|
|
["cmd+return"] = "doc:newline-below",
|
|
|
|
["cmd+shift+return"] = "doc:newline-above",
|
|
|
|
["cmd+j"] = "doc:join-lines",
|
|
|
|
["cmd+a"] = "doc:select-all",
|
2021-09-09 19:12:56 +02:00
|
|
|
["cmd+d"] = { "find-replace:select-add-next", "doc:select-word" },
|
|
|
|
["cmd+f3"] = "find-replace:select-next",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+l"] = "doc:select-lines",
|
2021-09-09 19:12:56 +02:00
|
|
|
["cmd+shift+l"] = { "find-replace:select-add-all", "doc:select-word" },
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+/"] = "doc:toggle-line-comments",
|
2021-08-30 14:21:16 +02:00
|
|
|
["option+up"] = "doc:move-lines-up",
|
|
|
|
["option+down"] = "doc:move-lines-down",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+shift+d"] = "doc:duplicate-lines",
|
|
|
|
["cmd+shift+k"] = "doc:delete-lines",
|
|
|
|
|
|
|
|
["left"] = { "doc:move-to-previous-char", "dialog:previous-entry" },
|
|
|
|
["right"] = { "doc:move-to-next-char", "dialog:next-entry"},
|
|
|
|
["up"] = { "command:select-previous", "doc:move-to-previous-line" },
|
|
|
|
["down"] = { "command:select-next", "doc:move-to-next-line" },
|
2021-08-30 14:21:16 +02:00
|
|
|
["option+left"] = "doc:move-to-previous-word-start",
|
|
|
|
["option+right"] = "doc:move-to-next-word-end",
|
|
|
|
["cmd+left"] = "doc:move-to-start-of-indentation",
|
|
|
|
["cmd+right"] = "doc:move-to-end-of-line",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+["] = "doc:move-to-previous-block-start",
|
|
|
|
["cmd+]"] = "doc:move-to-next-block-end",
|
2021-08-07 00:08:08 +02:00
|
|
|
["home"] = "doc:move-to-start-of-indentation",
|
2021-04-21 09:48:30 +02:00
|
|
|
["end"] = "doc:move-to-end-of-line",
|
2021-08-30 14:21:16 +02:00
|
|
|
["cmd+up"] = "doc:move-to-start-of-doc",
|
|
|
|
["cmd+down"] = "doc:move-to-end-of-doc",
|
2021-04-21 09:48:30 +02:00
|
|
|
["pageup"] = "doc:move-to-previous-page",
|
|
|
|
["pagedown"] = "doc:move-to-next-page",
|
|
|
|
|
2021-11-14 21:44:54 +01:00
|
|
|
["shift+1lclick"] = "doc:select-to-cursor",
|
|
|
|
["ctrl+1lclick"] = "doc:split-cursor",
|
|
|
|
["1lclick"] = "doc:set-cursor",
|
|
|
|
["2lclick"] = "doc:set-cursor-word",
|
|
|
|
["3lclick"] = "doc:set-cursor-line",
|
2021-04-21 09:48:30 +02:00
|
|
|
["shift+left"] = "doc:select-to-previous-char",
|
|
|
|
["shift+right"] = "doc:select-to-next-char",
|
|
|
|
["shift+up"] = "doc:select-to-previous-line",
|
|
|
|
["shift+down"] = "doc:select-to-next-line",
|
2021-08-30 14:21:16 +02:00
|
|
|
["option+shift+left"] = "doc:select-to-previous-word-start",
|
|
|
|
["option+shift+right"] = "doc:select-to-next-word-end",
|
|
|
|
["cmd+shift+left"] = "doc:select-to-start-of-indentation",
|
|
|
|
["cmd+shift+right"] = "doc:select-to-end-of-line",
|
2021-04-21 09:48:30 +02:00
|
|
|
["cmd+shift+["] = "doc:select-to-previous-block-start",
|
|
|
|
["cmd+shift+]"] = "doc:select-to-next-block-end",
|
2021-08-07 00:09:36 +02:00
|
|
|
["shift+home"] = "doc:select-to-start-of-indentation",
|
2021-04-21 09:48:30 +02:00
|
|
|
["shift+end"] = "doc:select-to-end-of-line",
|
2021-08-30 14:21:16 +02:00
|
|
|
["cmd+shift+up"] = "doc:select-to-start-of-doc",
|
|
|
|
["cmd+shift+down"] = "doc:select-to-end-of-doc",
|
2021-04-21 09:48:30 +02:00
|
|
|
["shift+pageup"] = "doc:select-to-previous-page",
|
|
|
|
["shift+pagedown"] = "doc:select-to-next-page",
|
2021-08-30 14:21:16 +02:00
|
|
|
["cmd+option+up"] = "doc:create-cursor-previous-line",
|
|
|
|
["cmd+option+down"] = "doc:create-cursor-next-line"
|
2021-04-21 09:48:30 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
return keymap_macos
|