I have a map that creates a markdown hyperlink for the current url open in the browser:
inoremap <Leader>gg [<esc>:silent !~/bin/copy_safari_title.osa <cr>"+pa](<esc>:silent !~/bin/copy_safari_url.osa <cr>"+pa)
This works fine. Now I want to remove any instances of the pipe character from the link description. So I modified the above command:
inoremap <Leader>gg [<esc>:silent !~/bin/copy_safari_title.osa <cr>:let "+ = substitute("+, '\|', '', 'g')<cr>"+pa](<esc>:silent !~/bin/copy_safari_url.osa <cr>"+pa)
Note the :let "+ = substitute("+, '\|', '', 'g')<cr>
in this newer command.
But it ends up echoing what looks like all the vim variables to the screen and though there is output to vim, any pipe character is still in the description. Not sure what is happening. What am I missing?