Skip to content

Instantly share code, notes, and snippets.

@alfiankan
Created April 15, 2024 22:09
Show Gist options
  • Save alfiankan/cbe72af0f623e645ae215560f0867572 to your computer and use it in GitHub Desktop.
Save alfiankan/cbe72af0f623e645ae215560f0867572 to your computer and use it in GitHub Desktop.
simple edit long shell command using vim/nvim
#!/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