Skip to content

Commit

Permalink
Note double-click closing paren in add-biscuits post
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-dray committed Mar 27, 2024
1 parent 6fa10c9 commit 5a6bc5f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 18 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="70" data-categories="blogsnip,r,rstudio,rstudio-addins,styler" data-listing-date-sort="1630364400000" data-listing-file-modified-sort="1697052718136" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="12">
<div class="g-col-1" data-index="70" data-categories="blogsnip,r,rstudio,rstudio-addins,styler" data-listing-date-sort="1630364400000" data-listing-file-modified-sort="1711561329582" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="13">
<a href="./posts/2021-08-31-add-biscuits/index.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<div class="card-body post-contents">
Expand Down
37 changes: 26 additions & 11 deletions _site/posts/2021-08-31-add-biscuits/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@


<link rel="stylesheet" href="../../styles.css">
<meta property="og:title" content="rostrum.blog - Auto-label closing parentheses in RStudio">
<meta property="og:description" content="">
<meta property="og:image" content="https://www.rostrum.blog/posts/2021-08-31-add-biscuits/resources/add-biscuits.gif">
<meta property="og:site-name" content="rostrum.blog">
<meta name="twitter:title" content="rostrum.blog - Auto-label closing parentheses in RStudio">
<meta name="twitter:description" content="">
<meta name="twitter:image" content="https://www.rostrum.blog/posts/2021-08-31-add-biscuits/resources/add-biscuits.gif">
<meta name="twitter:creator" content="@mattdray">
<meta name="twitter:card" content="summary_large_image">
</head>

<body class="nav-fixed fullcontent">
Expand Down Expand Up @@ -230,6 +239,10 @@ <h2 class="anchored" data-anchor-id="paren-in-a-codestack">Paren in a codestack<
<p>You can see these in action in this gif:</p>
<p><img src="resources/paren-jump.gif" class="img-fluid" style="width:100.0%" alt="Code for a simplified Shiny app in the RStudio editor. The keyboard shortcut Control-and-P is being used to jump from the opening to closing parenthesis of a given pair."></p>
<p>These go some way to helping, but each is not perfect for me, personally. For example, as someone with colourblindness, I find the rainbow colouring isn’t distinct enough.</p>
<div class="tip">
<p><svg aria-hidden="true" role="img" viewbox="0 0 512 512" style="height:1em;width:1em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:currentColor;overflow:visible;position:relative;"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"></path></svg> <b>Note</b></p>
<p>Two and a half years after this was posted, Zoë pointed out that you can also double-click a closing parenthesis in RStudio to select all the content inside that set of parentheses.</p>
</div>
</section>
<section id="a-biscuit-recipe" class="level2">
<h2 class="anchored" data-anchor-id="a-biscuit-recipe">A biscuit recipe</h2>
Expand Down Expand Up @@ -515,7 +528,7 @@ <h2 class="anchored" data-anchor-id="oh-crumbs">Oh, crumbs…</h2>
</summary>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code>Last rendered: 2023-07-21 19:29:02 BST</code></pre>
<pre><code>Last rendered: 2024-03-27 17:42:20 GMT</code></pre>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>R version 4.3.1 (2023-06-16)
Expand All @@ -536,16 +549,18 @@ <h2 class="anchored" data-anchor-id="oh-crumbs">Oh, crumbs…</h2>
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] vctrs_0.6.3 crayon_1.5.2 cli_3.6.1 knitr_1.43.1
[5] rlang_1.1.1 xfun_0.39 rex_1.2.1 processx_3.8.2
[9] purrr_1.0.1 styler_1.10.1 xmlparsedata_1.0.5 jsonlite_1.8.7
[13] rprojroot_2.0.3 htmltools_0.5.5 ps_1.7.5 rmarkdown_2.23
[17] R.cache_0.16.0 evaluate_0.21 fastmap_1.1.1 lifecycle_1.0.3
[21] yaml_2.3.7 cyclocomp_1.1.0 compiler_4.3.1 lintr_3.0.2
[25] htmlwidgets_1.6.2 rstudioapi_0.15.0 R.oo_1.25.0 R.utils_2.12.2
[29] digest_0.6.33 R6_2.5.1 magrittr_2.0.3 callr_3.7.3
[33] R.methodsS3_1.8.2 tools_4.3.1 withr_2.5.0 lazyeval_0.2.2
[37] xml2_1.3.5 remotes_2.4.2 desc_1.4.2 </code></pre>
[1] jsonlite_1.8.7 compiler_4.3.1 crayon_1.5.2 xml2_1.3.5
[5] callr_3.7.3 yaml_2.3.8 fastmap_1.1.1 R6_2.5.1
[9] knitr_1.45 htmlwidgets_1.6.2 backports_1.4.1 tibble_3.2.1
[13] xmlparsedata_1.0.5 lintr_3.1.0 desc_1.4.2 cyclocomp_1.1.0
[17] rprojroot_2.0.3 R.cache_0.16.0 pillar_1.9.0 R.utils_2.12.2
[21] rlang_1.1.3 utf8_1.2.4 xfun_0.41 lazyeval_0.2.2
[25] rex_1.2.1 cli_3.6.2 withr_2.5.2 magrittr_2.0.3
[29] ps_1.7.5 digest_0.6.33 processx_3.8.2 rstudioapi_0.15.0
[33] fontawesome_0.5.2 remotes_2.4.2.1 lifecycle_1.0.4 R.oo_1.25.0
[37] R.methodsS3_1.8.2 vctrs_0.6.5 evaluate_0.23 glue_1.7.0
[41] data.table_1.15.0 styler_1.10.1 fansi_1.0.6 purrr_1.0.2
[45] rmarkdown_2.25 tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.6.1 </code></pre>
</div>
</div>
</details>
Expand Down
4 changes: 2 additions & 2 deletions _site/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -6668,7 +6668,7 @@
"href": "posts/2021-08-31-add-biscuits/index.html#paren-in-a-codestack",
"title": "Auto-label closing parentheses in RStudio",
"section": "Paren in a codestack",
"text": "Paren in a codestack\nThere are a few ways that the RStudio IDE can help with the problem of bracket-buddying in long-winded scripts. In particular:\n\nPut your cursor next to a parenthesis and its partner will be automatically highlighted\nYou can auto-indent with Command + I and expose indent guides with Options &gt; Code &gt; Show indent guides so that paren-pairs are aligned vertically\nColour-match paren-pairs with rainbow colours, which you can activate with Options &gt; Code &gt; Display\nUse the keyboard shortcut Control + P to jump from an opening to a closing parenthesis\n\nYou can see these in action in this gif:\n\nThese go some way to helping, but each is not perfect for me, personally. For example, as someone with colourblindness, I find the rainbow colouring isn’t distinct enough."
"text": "Paren in a codestack\nThere are a few ways that the RStudio IDE can help with the problem of bracket-buddying in long-winded scripts. In particular:\n\nPut your cursor next to a parenthesis and its partner will be automatically highlighted\nYou can auto-indent with Command + I and expose indent guides with Options &gt; Code &gt; Show indent guides so that paren-pairs are aligned vertically\nColour-match paren-pairs with rainbow colours, which you can activate with Options &gt; Code &gt; Display\nUse the keyboard shortcut Control + P to jump from an opening to a closing parenthesis\n\nYou can see these in action in this gif:\n\nThese go some way to helping, but each is not perfect for me, personally. For example, as someone with colourblindness, I find the rainbow colouring isn’t distinct enough.\n\n Note\nTwo and a half years after this was posted, Zoë pointed out that you can also double-click a closing parenthesis in RStudio to select all the content inside that set of parentheses."
},
{
"objectID": "posts/2021-08-31-add-biscuits/index.html#a-biscuit-recipe",
Expand Down Expand Up @@ -6696,7 +6696,7 @@
"href": "posts/2021-08-31-add-biscuits/index.html#environment",
"title": "Auto-label closing parentheses in RStudio",
"section": "Environment",
"text": "Environment\n\n\n\nSession info\n\n\n\nLast rendered: 2023-07-21 19:29:02 BST\n\n\nR version 4.3.1 (2023-06-16)\nPlatform: aarch64-apple-darwin20 (64-bit)\nRunning under: macOS Ventura 13.2.1\n\nMatrix products: default\nBLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib \nLAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0\n\nlocale:\n[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\n\ntime zone: Europe/London\ntzcode source: internal\n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nloaded via a namespace (and not attached):\n [1] vctrs_0.6.3 crayon_1.5.2 cli_3.6.1 knitr_1.43.1 \n [5] rlang_1.1.1 xfun_0.39 rex_1.2.1 processx_3.8.2 \n [9] purrr_1.0.1 styler_1.10.1 xmlparsedata_1.0.5 jsonlite_1.8.7 \n[13] rprojroot_2.0.3 htmltools_0.5.5 ps_1.7.5 rmarkdown_2.23 \n[17] R.cache_0.16.0 evaluate_0.21 fastmap_1.1.1 lifecycle_1.0.3 \n[21] yaml_2.3.7 cyclocomp_1.1.0 compiler_4.3.1 lintr_3.0.2 \n[25] htmlwidgets_1.6.2 rstudioapi_0.15.0 R.oo_1.25.0 R.utils_2.12.2 \n[29] digest_0.6.33 R6_2.5.1 magrittr_2.0.3 callr_3.7.3 \n[33] R.methodsS3_1.8.2 tools_4.3.1 withr_2.5.0 lazyeval_0.2.2 \n[37] xml2_1.3.5 remotes_2.4.2 desc_1.4.2"
"text": "Environment\n\n\n\nSession info\n\n\n\nLast rendered: 2024-03-27 17:42:20 GMT\n\n\nR version 4.3.1 (2023-06-16)\nPlatform: aarch64-apple-darwin20 (64-bit)\nRunning under: macOS Ventura 13.2.1\n\nMatrix products: default\nBLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib \nLAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0\n\nlocale:\n[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\n\ntime zone: Europe/London\ntzcode source: internal\n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nloaded via a namespace (and not attached):\n [1] jsonlite_1.8.7 compiler_4.3.1 crayon_1.5.2 xml2_1.3.5 \n [5] callr_3.7.3 yaml_2.3.8 fastmap_1.1.1 R6_2.5.1 \n [9] knitr_1.45 htmlwidgets_1.6.2 backports_1.4.1 tibble_3.2.1 \n[13] xmlparsedata_1.0.5 lintr_3.1.0 desc_1.4.2 cyclocomp_1.1.0 \n[17] rprojroot_2.0.3 R.cache_0.16.0 pillar_1.9.0 R.utils_2.12.2 \n[21] rlang_1.1.3 utf8_1.2.4 xfun_0.41 lazyeval_0.2.2 \n[25] rex_1.2.1 cli_3.6.2 withr_2.5.2 magrittr_2.0.3 \n[29] ps_1.7.5 digest_0.6.33 processx_3.8.2 rstudioapi_0.15.0 \n[33] fontawesome_0.5.2 remotes_2.4.2.1 lifecycle_1.0.4 R.oo_1.25.0 \n[37] R.methodsS3_1.8.2 vctrs_0.6.5 evaluate_0.23 glue_1.7.0 \n[41] data.table_1.15.0 styler_1.10.1 fansi_1.0.6 purrr_1.0.2 \n[45] rmarkdown_2.25 tools_4.3.1 pkgconfig_2.0.3 htmltools_0.5.6.1"
},
{
"objectID": "posts/2021-08-31-add-biscuits/index.html#footnotes",
Expand Down
4 changes: 2 additions & 2 deletions _site/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
</url>
<url>
<loc>https://www.rostrum.blog/posts/2021-08-31-add-biscuits/index.html</loc>
<lastmod>2023-12-17T12:30:38.431Z</lastmod>
<lastmod>2024-03-27T17:42:22.171Z</lastmod>
</url>
<url>
<loc>https://www.rostrum.blog/posts/2023-09-08-trash-combing/index.html</loc>
Expand Down Expand Up @@ -670,7 +670,7 @@
</url>
<url>
<loc>https://www.rostrum.blog/index.html</loc>
<lastmod>2024-03-27T16:47:04.061Z</lastmod>
<lastmod>2024-03-27T17:42:31.599Z</lastmod>
</url>
<url>
<loc>https://www.rostrum.blog/posts/2024-01-12-yihui-rap/index.html</loc>
Expand Down
7 changes: 7 additions & 0 deletions posts/2021-08-31-add-biscuits/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ You can see these in action in this gif:

These go some way to helping, but each is not perfect for me, personally. For example, as someone with colourblindness, I find the rainbow colouring isn't distinct enough.

<div class="tip">
`r fontawesome::fa("exclamation-circle")` <b>Note</b>

Two and a half years after this was posted, Zoë pointed out that you can also double-click a closing parenthesis in RStudio to select all the content inside that set of parentheses.

</div>

## A biscuit recipe

So what if we want to use those closing-paren labels, or 'biscuits', instead? There doesn't seem to be an option in RStudio for that.
Expand Down

0 comments on commit 5a6bc5f

Please sign in to comment.