flow.nvim icon indicating copy to clipboard operation
flow.nvim copied to clipboard

Capture the selected text as a variable in custom commands

Open arjunmahishi opened this issue 1 year ago • 0 comments

If the selected text is available as a variable in custom commands, this will allow the user to pass that as input to their script via STDIN or use it in any way they want. This will be very helpful.

This will be very similar to how using :! <cmd> works in the command window. But this will not modify the buffer. Maybe in the future, this plugin can also support modifying the buffer based on the output of the custom command.

Examples

echo $selected_text | sort | uniq -c | sort -nr
curl -XPOST HTTP://localhost:8080 --data $selected_text
echo $selected_text > /tmp/save-to-file

arjunmahishi avatar Feb 18 '24 06:02 arjunmahishi