a simple mode example

Gold Holk 2022-08-03 21:51:43 +08:00
parent 55f82edf52
commit f431e4ddd0

@ -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.
```