for example I want to echo :
"let vim know the last edit position
au BufReadPost * if line("'\"") > 0|if line("'\"")
\ <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
I tried but failed:
echo '
"let vim know the last edit position
au BufReadPost * if line("\'\"") > 0|if line("\'\"")
\ <= line("$")|exe("norm \'\"")|else|exe "norm $"|endif|endif
'
How to show the correct format?
Thank you~
You can use here documents:
If you want to use
echo
, all you need to do is to use single quotesThe only problem is posed by literal single quotes contained in the string.
In such a case:
'
\'
For example:
Obviously, if the literal single quote is at the start or end of the string, one of the closing or opening quote should not be used:
Your specific string can be output with the command