I am creating a script that grabs all links from a web page's source code. I would like to call Vim from a bash script and the easiest way for me to do that is to use a vim script.
I have a file called 'script.vim':
:g!/https:\/\//d
:%norm!/https^Mdi"Vp
:wq!
I am deleting every line without https and the norm command is being used to remove all text that is not inside double quotes & containing https.
Everything works except the ^M and I'm not sure how to go about replacing that in the script file.
For extra info, I'm calling the script file like so: vim websitecode.txt -s script.vim
Simply put, I need a replacement for ^M so the norm command will work in a script.