Mapping a Piped Shell Command in Vim

Solution 1:

Try putting this in your ~/.vimrc file:

nmap <Leader>r :w !ls <bar> mvim -<CR>

or

nmap <Leader>r :w !ls \| mvim -<CR>