Created
April 15, 2024 22:09
-
-
Save alfiankan/cbe72af0f623e645ae215560f0867572 to your computer and use it in GitHub Desktop.
simple edit long shell command using vim/nvim
This file contains hidden or 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
#!/bin/bash | |
set -e | |
LINE=$@ | |
TEMP_FILENAME=`uuidgen` | |
echo $LINE > /tmp/$TEMP_FILENAME | |
nvim /tmp/$TEMP_FILENAME | |
cat /tmp/$TEMP_FILENAME | |
exec $(cat /tmp/$TEMP_FILENAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment