| Title: | Create 'RStudio' Themes from Visual Studio Code, Positron and 'TextMate' Themes |
| Version: | 1.0.0 |
| Description: | Create and install 'RStudio' themes derived from Visual Studio Code, Positron and 'TextMate' themes. Provides functions to convert between 'TextMate' and Visual Studio Code or Positron themes, as well as ports of several Visual Studio Code themes. |
| License: | MIT + file LICENSE |
| URL: | https://dieghernan.github.io/rstudiothemes/, https://github.com/dieghernan/rstudiothemes |
| BugReports: | https://github.com/dieghernan/rstudiothemes/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | cli, colorspace, dplyr, grDevices, jsonlite, rstudioapi, sass, tidyr, tools, utils, xml2 |
| Suggests: | knitr, quarto, testthat (≥ 3.0.0), uuid |
| VignetteBuilder: | quarto |
| Config/Needs/coverage: | covr |
| Config/Needs/website: | dieghernan/gitdevr, ragg, styler, gadenbuie/rsthemes |
| Config/testthat/edition: | 3 |
| Config/testthat/parallel: | true |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| X-schema.org-keywords: | r-package, rstudio-themes, textmate-themes, vscode-themes, positron-themes |
| NeedsCompilation: | no |
| Packaged: | 2026-02-25 20:06:41 UTC; diego |
| Author: | Diego Hernangómez |
| Maintainer: | Diego Hernangómez <diego.hernangomezherrero@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-03 11:20:02 UTC |
rstudiothemes: Create 'RStudio' Themes from Visual Studio Code, Positron and 'TextMate' Themes
Description
Create and install 'RStudio' themes derived from Visual Studio Code, Positron and 'TextMate' themes. Provides functions to convert between 'TextMate' and Visual Studio Code or Positron themes, as well as ports of several Visual Studio Code themes.
Author(s)
Maintainer: Diego Hernangómez diego.hernangomezherrero@gmail.com (ORCID) [copyright holder]
Other contributors:
Garrick Aden-Buie garrick@adenbuie.com (for the rsthemes::try_rsthemes() function) [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/dieghernan/rstudiothemes/issues
Convert a TextMate theme into a Visual Studio Code/Positron theme
Description
Read a .tmTheme file representing a TextMate theme and write the
equivalent Visual Studio Code theme (.json).
Usage
convert_tm_to_vs_theme(
path,
outfile = tempfile(fileext = ".json"),
name = NULL,
author = NULL
)
Arguments
path |
Path or URL to a TextMate theme, in |
outfile |
Path where the resulting file will be written. By default
a temporary file ( |
name |
Optional. The name of the theme. If not provided, the name of
the theme in |
author |
Optional. The author of the theme. If not provided, the author
from |
Value
This function is called for its side effects. It writes a new .json
file in outfile and returns the path.
See Also
Other functions for creating themes:
convert_to_rstudio_theme(),
convert_vs_to_tm_theme()
Examples
tmtheme <- system.file("ext/test.tmTheme",
package = "rstudiothemes"
)
path <- convert_tm_to_vs_theme(tmtheme)
readLines(path) |>
head(50) |>
cat(sep = "\n")
Convert a TextMate or VS Code/Positron theme to an RStudio theme
Description
Read a .tmTheme or .json file that defines a TextMate or Visual
Studio Code theme and write the equivalent RStudio theme .rstheme.
Optionally, the generated theme can be installed and applied to the RStudio IDE.
Important: This function only works in RStudio; it returns NULL when
called from other IDEs.
Usage
convert_to_rstudio_theme(
path,
outfile = tempfile(fileext = ".rstheme"),
name = NULL,
use_italics = TRUE,
output_style = "expanded",
force = FALSE,
apply = FALSE
)
Arguments
path |
Path or URL to a TextMate theme ( |
outfile |
Path where the resulting file will be written. By default
a temporary file ( |
name |
Optional. The name of the theme. If not provided, the name of
the theme in |
use_italics |
Logical. Whether to use italics in the resulting theme.
By default |
output_style |
Bracketing and formatting style of the CSS output.
Possible styles: |
force |
Whether to force the operation and overwrite an existing file
with the same name. |
apply |
Logical. Apply the theme with |
Details
RStudio supports custom editor themes in two formats: .tmTheme and
.rstheme. The .tmTheme format originated with TextMate and has become a
common theme format.
This tmTheme editor hosts a large
collection of .tmTheme files. The .rstheme format is specific to RStudio.
To switch editor themes, go to Tools > Global Options > Appearance > Add
and use the Editor theme selector.
For more information, see https://docs.posit.co/ide/user/ide/guide/ui/appearance.html.
Value
This function is called for its side effects. It writes a new
.rstheme file to outfile and returns the path. If force or apply
are TRUE, it will install and apply the theme to your RStudio IDE.
See Also
rstudioapi::addTheme(), rstudioapi::applyTheme()
Other functions for creating themes:
convert_tm_to_vs_theme(),
convert_vs_to_tm_theme()
Examples
if (on_rstudio() && interactive()) {
vstheme <- system.file("ext/skeletor-syntax-color-theme.json",
package = "rstudiothemes"
)
# Apply the theme for 10 seconds to demonstrate the effect
current_theme <- rstudioapi::getThemeInfo()$editor
# Current theme name:
current_theme
new_rs_theme <- convert_to_rstudio_theme(vstheme,
name = "A testing theme",
apply = TRUE, force = TRUE
)
Sys.sleep(10)
rstudioapi::applyTheme(current_theme)
rstudioapi::removeTheme("A testing theme")
}
Convert a Visual Studio Code/Positron theme into a TextMate theme
Description
Read a .json file representing a Visual Studio Code/Positron theme and
write the equivalent TextMate theme (.tmTheme).
Usage
convert_vs_to_tm_theme(
path,
outfile = tempfile(fileext = ".tmTheme"),
name = NULL,
author = NULL
)
Arguments
path |
Path or URL to a Visual Studio Code/Positron theme, in |
outfile |
Path where the resulting file will be written. By default
a temporary file ( |
name |
Optional. The name of the theme. If not provided, the name of
the theme in |
author |
Optional. The author of the theme. If not provided, the author
from |
Value
This function is called for its side effects: it writes a .tmTheme
file to outfile and returns the path.
See Also
Other functions for creating themes:
convert_tm_to_vs_theme(),
convert_to_rstudio_theme()
Examples
vstheme <- system.file("ext/test-simple-color-theme.json",
package = "rstudiothemes"
)
path <- convert_vs_to_tm_theme(vstheme)
readLines(path) |>
head(50) |>
cat(sep = "\n")
Generate random UUIDs
Description
Generate version 4 (pseudo-random) Universally Unique Identifiers (UUIDs).
Usage
generate_uuid(hint = NULL)
Arguments
hint |
Optional. A character string (or object coercible with
|
Details
This helper function assigns a UUID for identifying versions of generated themes.
Value
A character string representing a valid UUID that can be validated with
uuid::UUIDvalidate().
Source
Heavily based on an unreleased version of ids::uuid().
References
Davis KR, Peabody B, Leach P (2024). "Universally Unique IDentifiers (UUIDs)." RFC 9562. doi:10.17487/RFC9562, https://www.rfc-editor.org/info/rfc9562.
See Also
Other helpers:
on_rstudio()
Examples
# Random
generate_uuid()
generate_uuid()
# Persistent with hint param
hint <- "something as seed"
generate_uuid(hint)
generate_uuid(hint)
Check whether the session is running in RStudio
Description
Detect whether the current R session is running in RStudio; used to decide if themes can be applied to the IDE.
Usage
on_rstudio()
Value
Logical; TRUE if running in RStudio, otherwise FALSE.
See Also
Other helpers:
generate_uuid()
Examples
on_rstudio()
Read and parse a TextMate theme
Description
Read a .tmTheme file (XML format) representing a TextMate or Sublime Text
theme.
Usage
read_tm_theme(path)
Arguments
path |
Path or URL to a TextMate theme, in |
Value
A tibble with the data of the theme.
See Also
Other functions for reading themes:
read_vs_theme()
Examples
the_theme <- system.file("ext/test-color-theme.json",
package = "rstudiothemes"
) |>
# Convert the Visual Studio Code theme to TextMate format
convert_vs_to_tm_theme()
# Check
readLines(the_theme) |>
head(10) |>
cat(sep = "\n")
read_tm_theme(the_theme)
Read and parse a Visual Studio Code/Positron theme
Description
Read a .json file representing a Visual Studio Code/Positron theme.
Usage
read_vs_theme(path)
Arguments
path |
Path or URL to a Visual Studio Code/Positron theme, in |
Value
A tibble with the data of the theme.
See Also
Other functions for reading themes:
read_tm_theme()
Examples
vstheme <- system.file("ext/test-color-theme.json",
package = "rstudiothemes"
)
read_vs_theme(vstheme)
Install, list, try or remove RStudio themes
Description
Adaptation of some rsthemes functions, MIT License Copyright © rsthemes authors.
Important: These functions (except
list_rstudiothemes(list_installed = FALSE)) only work in RStudio; they
return NULL when called from other IDEs.
Usage
install_rstudiothemes(
style = c("all", "dark", "light"),
themes = NULL,
destdir = NULL
)
remove_rstudiothemes(style = c("all", "dark", "light"))
list_rstudiothemes(style = c("all", "dark", "light"), list_installed = TRUE)
try_rstudiothemes(style = c("all", "dark", "light"), themes = NULL, delay = 0)
Arguments
style |
Character. Limit themes to a specific group: |
themes |
Optional character vector of theme names. If provided, only
these themes will be used, and |
destdir |
Optional directory for |
list_installed |
Should the installed rstudiothemes themes be
listed (default). If |
delay |
Number of seconds to wait between themes. Set to 0 to be prompted to continue after each theme. |
Value
-
install_rstudiothemes()andremove_rstudiothemes()returnNULLinvisibly.
-
list_rstudiothemes()returns a character vector of theme names.
-
try_rstudiothemes()has side effects of starting a widget that allows users to try different themes. The widget can be exited by following the prompts, which will restore the original theme.
Functions
-
install_rstudiothemes(): Install RStudio themes -
remove_rstudiothemes(): Remove rstudiothemes from RStudio -
list_rstudiothemes(): List installed or available themes -
try_rstudiothemes(): Try each rstudiothemes RStudio theme
Ported Themes
rstudiothemes includes RStudio themes based on the following Visual Studio Code themes:
Ayu by teabyii.
Andromeda by Eliver Lara.
Catppuccin by https://catppuccin.com/.
Cobalt2 Theme Official by Wes Bos.
CRAN by dieghernan, based on the CRAN (R Project) website theme, created with Pandoc
Dracula Official by https://draculatheme.com/.
GitHub Dark and Light by GitHub.
JellyFish Theme by Pawel Borkar.
Matcha by Luca Falasco.
Matrix Theme by UstymUkhman.
Night Owl Dark and Light (no italics) by Sarah Drasner.
Nord by Arctic Ice Studio.
OKSolar Theme by dieghernan.
One Dark Pro by binaryify.
Overflow Theme by dieghernan.
Panda Theme by Panda Theme.
Selenized Themes by dieghernan.
Skeletor Syntax by dieghernan.
SynthWave '84 by Robb Owen.
Tokyo Night by Enkia.
Winter is Coming Theme by John Papa.
Author(s)
Garrick Aden-Buie https://github.com/gadenbuie
References
Aden-Buie G (2026). rsthemes: Full Themes for RStudio v1.2+. R package version 0.5.1, commit 48fc078f772e5e63669bc9773eabc8e9cdc7f699, https://github.com/gadenbuie/rsthemes.
Examples
list_rstudiothemes(list_installed = FALSE)