I have been using
sudo find / -iname '*foo*' 2>/dev/null | vim
to get a list of directories/files containing foo
, and then I inspect this list, edit it, and write a bunch of new commands inside of vim.
After writing my commands inside of vim, I copy what I have written and quit vim then I paste it into the new command line.
Vim is my C-x C-e command line editor.
Can I make it so that :wq
from inside of this vim session automatically fills the command line with the buffer?
As it would had I started vim with C-x C-e instead of vim
.
How can I start a C-x C-e vim session with piped input?
vim
, and then in an empty buffer typeecho something
in that empty buffer and then you want to execute that buffer content? Then basically superuser.com/questions/266934/… ?:!
execute the command from within vim.I want to write the buffer to the command line
So like save to temporary file and then output that file? Along.... | ( tmp=$(mktemp); trap 'rm "$tmp"' EXIT; cat > "$tmp"; vim "$tmp"; cat "$tmp"; )
?