···136136137137# Run command
138138define-command -params 1.. -command-completion -file-completion -docstring \
139139-"Run a command and show the output the *m-run* scratch buffer" \
139139+"Run a command and show the output in the *m-run* scratch buffer" \
140140m-run %{
141141 try %{ delete-buffer! *m-run* }
142142 edit -scratch *m-run*
143143- execute-keys "!%arg{@}<ret>jd"
143143+ execute-keys "!%arg{@}<ret>jdgg"
144144}
145145146146# Run command from selection
147147define-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-}
148148+"Run a command from a selection and show the output in the *m-run* scratch buffer" \
149149+m-run-select %{ m-run %val{selection} }
150150+151151+# Run command with errors
152152+define-command -params 1.. -command-completion -file-completion -docstring \
153153+"Run a command and show the output (with errors) in the *m-run* scratch buffer" \
154154+m-erun %{ m-run %arg{@} 2>&1 }
155155+156156+# Run command from selection with errors
157157+define-command -docstring \
158158+"Run a command from a selection and show the output (with errors) in the *m-run* scratch buffer" \
159159+m-erun-select %{ m-erun %val{selection} }
160160+161161+# Run command without output
162162+define-command -params 1.. -command-completion -file-completion -docstring \
163163+"Run a command" \
164164+m-nrun %{ nop %sh{ "$@" } }
155165156166# Keybinds
157167## User
···162172map global user y '<a-|>wl-copy<ret>' -docstring 'Copy to System Clipboard (Wayland)'
163173map global user . ':source ".kakrc.local"<ret>' -docstring 'Load the kakrc file in the current directory'
164174map global user r ':m-run-select<ret>' -docstring 'Run the selected command'
175175+map global user R ':m-erun-select<ret>' -docstring 'Run the selected command with errors'
165176166177# Set termcmd
167178hook global ModuleLoaded wayland %{