Is it possible to run an external command and store its output in a register?
:redirworks for ex commands, not for external commands (afaik):r !runs the external command but directly inserts output into the current buffer
Is it possible to run an external command and store its output in a register?
:redir works for ex commands, not for external commands (afaik):r ! runs the external command but directly inserts output into the
current bufferFound the answer thanks to a user on the vim-use mailing list:
:let @a = system("ls -l")
To run a command with the file under the cursor as argument:
:let @a = system("ls -l " . shellescape(expand('<cfile>')))