Echo / interactive debugging made a little easier

A bunch of useful tips that people normally put in dotfiles repos; the surprising thing, to me, was that you can alias ‘:’ and //. I’ve had the same experience with bash — some unusual names can be achieved using functions, some using aliases, some using both.

# RSI relievers
def defp -params .. %{ def -override -params .. %arg{@}
} -override -docstring '= def -params..'
defp echo-dbg %{ echo -debug -quoting shell -- %arg{@} }
alias global ':'  echo  # just type :: %val{buffile}
alias global ":'" echo-dbg
alias global '//' cd  # or cd-here, cd-git etc

# ,: for forgettable commands
map global user <:> ': '

# get out of prompt/ins mode without delays
map global prompt <a-\> '<c-e><c-u><backspace>'  # esc saves cmd
map global insert <a-\> '<esc>'

# reload things
def source-me %{ source %val{buffile}
} -override -docstring 'source current buffer'
def eval-lines %{ execute-keys -draft '<a-x>: eval %reg{dot}<ret>'
} -override -docstring 'eval selection lines'
2 Likes