Last active
April 20, 2024 23:37
-
-
Save fabiospampinato/680fa9303fb327a1f819f7f56300e5b8 to your computer and use it in GitHub Desktop.
Node.js inspect function and plugin for zsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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