Skip to content

Instantly share code, notes, and snippets.

@fabiospampinato
Last active April 20, 2024 23:37
Show Gist options
  • Save fabiospampinato/680fa9303fb327a1f819f7f56300e5b8 to your computer and use it in GitHub Desktop.
Save fabiospampinato/680fa9303fb327a1f819f7f56300e5b8 to your computer and use it in GitHub Desktop.
Node.js inspect function and plugin for zsh
# INSPECT
function inspect () {
eval NODE_OPTIONS="--inspect-brk" $@
}
# INSPECT PLUGIN
# Toggles the "inspect " prefix upon double ESC key
function plugin-inspect () {
if [[ $LBUFFER == inspect\ * ]]; then
LBUFFER=`echo $LBUFFER | cut -d' ' -f2-`
else
LBUFFER="inspect $LBUFFER"
fi
}
zle -N plugin-inspect
bindkey "\e\e" plugin-inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment