forked from cursorless-dev/cursorless
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cursorless-dev#2 from fidgetingbits/neovim
feat: make the shortcut platform specific as default and configurable by the user
- Loading branch information
Showing
2 changed files
with
38 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
local M = {} | ||
|
||
local function default_shortcut() | ||
local windows_shortcut = "<C-S-F12>" | ||
local unix_shortcut = "<C-`>" | ||
return require("cursorless.utils").is_platform_windows() and windows_shortcut | ||
or unix_shortcut | ||
end | ||
|
||
local config = { | ||
shortcut = default_shortcut(), | ||
} | ||
|
||
function M.set_config(user_config) | ||
return vim.tbl_deep_extend("force", config, user_config or {}) | ||
end | ||
|
||
function M.get_config() | ||
return config | ||
end | ||
|
||
return M |
This file contains 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