I want to add a mapping which will visualize the output of a shell command in a new window. the problem is the command is interrupted when moving the cursor to the top of the file.
:execute ":new \| set nonu \| 0r ! ls \| normal! gg"
I figured out that the problem is with the execute command which considers the part from the symbol ! to the rest of it as a shell command (ls | normal! gg) and that's why it shows an error when being executed.
How to prevent that ?