Saturday, May 11, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3732  / 3 Years ago, thu, october 28, 2021, 2:06:57

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~


More From » command-line

 Answers
3

You can use here documents:



cat <<-EOF
au BufReadPost * if line("'"") > 0|if line("'"")
<= line("$")|exe("norm '"")|else|exe "norm $"|endif|endif
EOF

[#40696] Friday, October 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bblerest

Total Points: 240
Total Questions: 119
Total Answers: 113

Location: Wallis and Futuna
Member since Mon, May 18, 2020
4 Years ago
;