Replies: 4 comments 5 replies
-
Just appeared on my Twitter feed: https://gist.github.com/jthomasmock/11acebd4448f171f786e01397df34116 by @jthomasmock Although, I wonder what you mean by "in the RStudio IDE outside a code chunk" ... 🤔 To Quarto maintainers, maybe worth adding the snippets to the documentation? (or to the RStudio Add-ins if not already there and in the VSCode extension) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
The first time I tried copying in snippets to make quarto fenced divs and bracketed spans, I copied them into the first file that came up in the RStudio > Tools > Edit Code Snippets. It didn't work, then I realized that that first file is for snippets inside R code cells. For snippets inside markdown, I had to toggle to that tab on the left; that worked. I'm not sure if this is the same problem that you're running into? |
Beta Was this translation helpful? Give feedback.
-
Mickaël and Tom,
Thanks for the helpful and quick answers. I am using a Mac and once the custom snippets are placed under R Markdown instead of R (my bad), the snippets work fine with Shift Tab in the source editor but there is no auto-complete. You have to type the whole snippet label then hit Shift Tab.
The RStudio Visual editor includes “Tabset” and “Calllout” under the Insert and CMD / options. It might be nice to have a Snippet option that allows you to select a custom one based on its label.
Thanks so much!
Richard
From: Mickaël Canouil ***@***.***>
Reply-To: quarto-dev/quarto-cli ***@***.***>
Date: Wednesday, August 17, 2022 at 9:17 PM
To: quarto-dev/quarto-cli ***@***.***>
Cc: Richard Ressler ***@***.***>, Author ***@***.***>
Subject: Re: [quarto-dev/quarto-cli] Rstudio IDE and Snippets (Discussion #1944)
External Email: Use caution with links and attachments.
To complete my answer and as highlighted by @andrewpbray<https://urldefense.com/v3/__https:/github.com/andrewpbray__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKktrO1TCc$> choose markdown as the scope for the snippets, not R (the default). A snippet completion is triggered by shift + tab (at least on Windows)
[Image removed by sender. image]<https://urldefense.com/v3/__https:/user-images.githubusercontent.com/8896044/185270061-414c7dea-25e7-468b-9f53-394917978d65.png__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKkGPVH-II$>
The same principle works for VSCode, the language/document type has to bet set (this is described by @pat-s<https://urldefense.com/v3/__https:/github.com/pat-s__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKk2Gbq0X0$> on the gist).
For RStudio IDE, you can take a look at @jjallaire<https://urldefense.com/v3/__https:/github.com/jjallaire__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKk52vHAnQ$> post https://support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets-in-the-RStudio-IDE<https://urldefense.com/v3/__https:/support.rstudio.com/hc/en-us/articles/204463668-Code-Snippets-in-the-RStudio-IDE__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKk2Ugbl0M$>
In it, you'll see the file location (if you want to edit it outside of RStudio):
* On Windows %appdata%/Roaming/RStudio/snippets/
* On Unix-based OS ~/.config/rstudio/snippets/
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/quarto-dev/quarto-cli/discussions/1944*discussioncomment-3418864__;Iw!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKkQ8iKhus$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AOCMN3MMGDAXQ2KZHTWWSUTVZWFJXANCNFSM56ZYP53Q__;!!IaT_gp1N!0wb3D1kSA02za0q0oSzRICPLaqZGQqVvlRNxmQAtnhHeVO2Gla9v4yDK3YXY7QESjb2au3RvZGEvh9dffEKkceSXths$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I can't see a way to use quarto snippets, e.g. for panel-tabset, in the RStudio IDE outside a code chunk. Is there a way or is this a future feature?
Beta Was this translation helpful? Give feedback.
All reactions