A menu that shows all commands you have available, key bindings and commends (if present) and from which you can call any of those commands.
Setup:
- copy
M-x.lua
to your~~/scripts
- copy
./script-modules/extended-menu.lua
to your~~/script-modules
- copy
./script-opts/M_x.conf
to your~~/scripts-opts
Keybidings you can see in extended menu keybindings section.
Note: if you are using my leader
script, you will see your leader bindings in
M-x menu as well.
Essentially same thing as the M-x
menu above, but instead of using extended-menu
module uses external rofi to display and search through commands.
Setup:
- copy
M-x-rofi.lua
to your~~/scripts
- copy
./script-opts/M_x_rofi.conf
to your~~/scripts-opts
Note: if you are using my leader
script, you will see your leader bindings in
M-x menu as well.
Adds leader key to your mpv. With prefixes and which-key functionality. Allows for ‘mnemonic’ command calling.
It won’t redefine existing bidings (at least i didn’t find a way to do it for
now), but it will add leader bindings on top of current ones, which will allow
you to freely redefine previous key bindings to any other command. For instance
if you had seek
command on l
key and you bound it to <leader> n
then u can
bind any other command to l
and you will still have <leader> n
bound to seek
.
NOTE: For script commands to appear in leader key bindings (after you set those up in script file) they must be initially set to some key, which is usually not a problem since most (if not all) scripts bind themselfes to some default key.
Setup:
- copy
leader.lua
to your~~/scripts
- copy
./script-modules/leader.lua
to your~~/script-modules
- copy
./script-opts/leader.conf
to your~~/script-opts
Example can be found in the script file itself.
{'key', 'name', 'description', [innerBindings]}
Any key you desire
Can be one of:
- full command name
- means it is not a script-defined command, will look like
"add contrast 1"
. Full list of all commands can be found using my M-x script. - prefix
- literaly
'prefix'
string, which will tell the script that there are following bindings after this one. - script command name
- To set binding to a script command look for this
command name, which is passed as 2nd argument to
mp.add_key_binding
ormp.add_forced_key_binding
and usually can be found in its script file. This field must be unique. Examples:
-- here command name is "M-x"
mp.add_key_binding(opts.toggle_menu_binding, "M-x", function()
mx_menu:init(data)
end)
-- here command name is "chapters-menu"
mp.add_key_binding(opts.toggle_menu_binding, "chapters-menu", function()
chapter_menu:init(chapter)
end)
String that describes what the command that is bound to this binding does. In
case name
field is 'prefix'
for your convenience i’d suggest setting 1-3 word
description. For example for a
prefix audio description, subtitles description
for s
prefix etc.
Only being used with keys that are prefixes. Includes keys following that prefix key, consista of same format tables - {‘key’, ‘name’, ‘description’, [innerBindings]}. Key field within this table is being concatenated with all parent prefixes.
{'s', 'prefix', 'subtitles', {'a', 'prefix', ... {'+', 'increase-font', ...}}}
will result in sa+
keybinding for increase-font
command.
Pass it to set_leader_bindings
func, which can be found in the end of
~~/scripts/leader.lua
Move my keybinding object definition out of the script file so the user just has an example somewhere. And also current realisation will cause conflicts when pulling from master since everyone will have his own bindings object.
Set shaders from your shaders folder using rofi selection.
Setup:
- copy
shaders-rofi.lua
to your~~/scripts
Ctrl+s
- default keybinding. Change it via input.conf
:
Ctrl+t script-binding shaders-rofi
This script assumes shaders are under ~~/shaders/
. Make an issue/pull request if
redefining shaders dir is a common case.
No demo here since it has basically same functionality as M-x but instead of commands you choose chapters of current video (if any). Shares same script-module with M-x.
Setup:
- copy
chapter_list.lua
to your~~/scripts
- copy
./script-modules/extended-menu.lua
to your~~/script-modules
- copy
./script-opts/chapter_list.conf
to your~~/script-opts
Keybindings you can see in extended menu keybindings section.