I'd like to use and recommend the Rstudio IDE for SQL file manipulation and previewing results. One thing that stops me from using it more often is that the preview isn't immediately accessible without changing the conn= definition.
Yes, both are possible! Create a file called query.sql with the contents you want, and put it in ~/.config/rstudio/templates (for you) or /etc/rstudio/templates (for everyone on your Pro server).