-
-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add config.leader and document it #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0136328
8b6c02f
e725d73
3828938
0f77bf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,8 +85,87 @@ | |
| ---|"TogglePaneZoomState" | ||
|
|
||
| ---@class KeyNoAction | ||
| -- A single unicode character, like 'A' or 'a'. Pay attention to the case of the text that you use | ||
| -- and the state of the SHIFT modifier, as this matters whether 'A' or 'a' is matched. | ||
| -- | ||
| -- Alternatively you can use on the following keycode identifiers, although note that not all of | ||
| -- these are meaningful on all platforms: | ||
| -- | ||
| -- Hyper, Super, Meta, Cancel, Backspace, Tab, Clear, Enter, Shift, Escape, LeftShift, RightShift, | ||
| -- Control, LeftControl, RightControl, Alt, LeftAlt, RightAlt, Menu, LeftMenu, RightMenu, Pause, | ||
| -- CapsLock, VoidSymbol, PageUp, PageDown, End, Home, LeftArrow, RightArrow, UpArrow, DownArrow, | ||
| -- Select, Print, Execute, PrintScreen, Insert, Delete, Help, LeftWindows, RightWindows, | ||
| -- Applications, Sleep, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, | ||
| -- Numpad8, Numpad9, Multiply, Add, Separator, Subtract, Decimal, Divide, NumLock, ScrollLock, | ||
| -- BrowserBack, BrowserForward, BrowserRefresh, BrowserStop, BrowserSearch, BrowserFavorites, | ||
| -- BrowserHome, VolumeMute, VolumeDown, VolumeUp, MediaNextTrack, MediaPrevTrack, MediaStop, | ||
| -- MediaPlayPause, ApplicationLeftArrow, ApplicationRightArrow, ApplicationUpArrow, | ||
| -- ApplicationDownArrow, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, | ||
| -- F18, F19, F20, F21, F22, F23, F24. | ||
| -- | ||
| -- The key value can refer either to the physical position of a key on an ANSI US keyboard or to the | ||
| -- post-keyboard-layout-mapped value produced by a key press. | ||
| -- | ||
| -- You can explicitly assign using the physical position by adding a phys: prefix to the value, for | ||
| -- example: `key="phys:A"`. This will match key presses for the key that would be in the position of | ||
| -- the A key on an ANSI US keyboard. | ||
| -- | ||
| -- You can explicitly assign the mapped key by adding a mapped: | ||
| -- prefix to the value, for example: key="mapped:a" will match a | ||
| -- key press where the OS keyboard layout produces a, regardless of | ||
| -- its physical position. | ||
| -- | ||
| -- If you omit an explicit prefix, wezterm will assume phys: and use the physical position of the | ||
| -- specified key. | ||
| -- | ||
| -- The default key assignments listed above use `phys:`. In previous releases there was no physical | ||
| -- position support and those assignments were all `mapped:`. | ||
| -- | ||
| -- When upgrading from earlier releases, if you had `{key="N", mods="CMD", ..}` in your config, you | ||
| -- will need to change it to either `{key="N", mods="CMD|SHIFT", ..}` or `{ key="mapped:N", | ||
| -- mods="CMD", ..}` in order to continue to respect the SHIFT modifier. | ||
| -- | ||
| -- The `key_map_preference` option controls how keys without an explicit `phys:` or `mapped:` prefix | ||
| -- are treated. If `key_map_preference = "Mapped"` (the default), then `mapped:` is assumed. If | ||
| -- `key_map_preference = "Physical"` then `phys:` is assumed. | ||
| -- | ||
| -- The default key assignments will respect `key_map_preference`. | ||
| -- | ||
| -- In some cases, wezterm may not know how to represent a key event in either its phys: or mapped: | ||
| -- forms. In that case, you may wish to define an assignment in terms of the underlying operating | ||
| -- system key code, using a `raw: prefix`. | ||
| -- | ||
| -- Similar in concept to the `phys:` mapping described above, the `raw:` mapping is independent of | ||
| -- the OS keyboard layout. Raw codes are hardware and windowing system dependent, so there is no | ||
| -- portable way to list which key does what. | ||
| -- | ||
| -- To discover these values, you can set `debug_key_events = true` and press the keys of interest. | ||
| -- | ||
| -- You can specify a raw key value of 123 by using `key="raw:123"` in your config rather than one of | ||
| -- the other key values. | ||
| -- | ||
|
DrKJeff16 marked this conversation as resolved.
|
||
| ---@field key string | ||
| ---@field mods? string | ||
| -- Possible Modifier labels are: | ||
| -- | ||
| -- `SUPER`, `CMD`, `WIN` - these are all equivalent: on macOS the Command key, on Windows the | ||
| -- Windows key, on Linux this can also be the Super or Hyper key. Left and right are equivalent. | ||
| -- | ||
| -- `CTRL` - The control key. Left and right are equivalent. | ||
| -- | ||
| -- `SHIFT` - The shift key. Left and right are equivalent. | ||
| -- | ||
| -- `ALT`, `OPT`, `META` - these are all equivalent: on macOS the Option key, on other systems the | ||
| -- Alt or Meta key. Left and right are equivalent. | ||
| -- | ||
| -- `LEADER` - a special modal modifier state managed by WezTerm. | ||
| -- | ||
| -- `VoidSymbol` - This keycode is emitted in special cases where the original function of the key has | ||
| -- been removed. Such as in Linux and using setxkbmap: `setxkbmap -option caps:none`. The CapsLock | ||
| -- will no longer function as before in all applications, instead emitting `VoidSymbol`. | ||
|
|
||
| -- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`. | ||
| -- | ||
| ---@field mods? string Optional modifiers keys. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you delete the inline comment for this (and any other) For instance: ---@field mods? string Optional modifiers keys.
--BECOMES:
-- Optional modifiers keys
---@field mods? stringIf you want to make that specific description stand out, I recommend you used tree -- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
-- ---
-- Optional modifiers keys
---@field mods? stringSee #42 for my rationale, I'd love to hear yours
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @craigmac I've edited the suggestion, missed the description on top of the |
||
|
|
||
| ---@class Key :KeyNoAction | ||
| ---@field action KeyAssignment | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -592,7 +592,7 @@ | |
| ---@field overlay_lag_indicator boolean | ||
|
|
||
| ---@class LeaderKey: KeyNoAction | ||
| ---@field timeout_milliseconds? integer | ||
| ---@field timeout_milliseconds? integer Maximum time to wait for next key, default is 1000 ms. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can reject it, but I'd suggest: ---@class LeaderKey: KeyNoAction
-- Maximum time to wait for the next key, in milliseconds.
--
-- The default is `1000`
---@field timeout_milliseconds? integer
--...See #42 for my rationale, I'd love to hear yours |
||
|
|
||
| ---@class HyperLinkRule | ||
| -- The regular expression to match | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible you could enclose timeout_milliseconds (and any other explicit identifier) ?
e.g.
timeout_millisecondsSee
Annotation Formattingin LuaLS' anotations wiki. It supports MarkdownA small example of how it should look when hovering:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typically do, I knew I was going to miss some!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We all miss something eventually, don't worry