I would like to map a key to an external shell command, which would then deliver back a token to search for in vi. vi should use the command's result then to search and to jump to line containing it. How it can be done? Thanks!
1 Answer
/<C-R>=system("cmd")<CR><CR>
where <C-R>= ... <CR>
will evaluate an expression and use the resulting string inline, and system("cmd")
returns a string with the contents of running the command cmd
.