mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
a simple mode example
parent
55f82edf52
commit
f431e4ddd0
18
How-to-define-custom-mode.md
Normal file
18
How-to-define-custom-mode.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
```
|
||||
# define some command
|
||||
# (define some key to a mode does not exist will create it automatically.)
|
||||
bind --mode=my-mode c js alert('hello world!')
|
||||
bind --mode=my-mode U fillcmdline undo
|
||||
|
||||
# inherit other mode's keymap if you want
|
||||
# the mode map name is `${mode_name}maps`
|
||||
set my-modemaps.🕷🕷INHERITS🕷🕷 nmaps
|
||||
|
||||
# define how to enter and exit mode
|
||||
bind gm mode my-mode
|
||||
bind --mode=my-mode <Escape> mode normal
|
||||
|
||||
# if you want to enter/exit from ex/hint/visual/insert/input,
|
||||
# you should take a look of their binding for <Escape>.
|
||||
# the `mode` command will not handle these things for you.
|
||||
```
|
||||
Loading…
Reference in a new issue