Monday, May 6, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3729  / 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
bblerest questions
Sun, Apr 16, 23, 13:50, 1 Year ago
Fri, Nov 4, 22, 06:21, 2 Years ago
Tue, Sep 27, 22, 12:22, 2 Years ago
;