···134134 }
135135}
136136137137+# Run command
138138+define-command -params 1.. -command-completion -file-completion -docstring \
139139+"Run a command and show the output the *m-run* scratch buffer" \
140140+m-run %{
141141+ try %{ delete-buffer! *m-run* }
142142+ edit -scratch *m-run*
143143+ execute-keys "!%arg{@}<ret>jd"
144144+}
145145+146146+# Run command from selection
147147+define-command -docstring \
148148+"Run a command from a selection and show the output the *m-run-select* scratch buffer" \
149149+m-run-select %{
150150+ declare-option -hidden str m_select_command %val{selection}
151151+ try %{ delete-buffer! *m-run-select* }
152152+ edit -scratch *m-run-select*
153153+ execute-keys "!%opt{m_select_command}<ret>jd"
154154+}
155155+137156# Keybinds
138157## User
139158map global user c ':comment-line<ret>' -docstring 'comment line'
···142161map global user p '!wl-paste<ret>' -docstring 'Paste from System Clipboard (Wayland)'
143162map global user y '<a-|>wl-copy<ret>' -docstring 'Copy to System Clipboard (Wayland)'
144163map global user . ':source ".kakrc.local"<ret>' -docstring 'Load the kakrc file in the current directory'
164164+map global user r ':m-run-select<ret>' -docstring 'Run the selected command'
145165146166# Set termcmd
147167hook global ModuleLoaded wayland %{