| Title: | Manage and Sync Your RStudio Preferences |
|---|---|
| Description: | Snapshot and restore different versions of your RStudio user preferences. Sync your user preferences via GitHub gist. |
| Authors: | Garrick Aden-Buie [aut, cre] (ORCID: <https://orcid.org/0000-0002-7111-0077>) |
| Maintainer: | Garrick Aden-Buie <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-05-24 06:43:48 UTC |
| Source: | https://github.com/gadenbuie/rsprefs |
Returns currently set preferences to RStudio's original, built-in default.
prefs_reset_defaults(source = c("project", "user"), verbose = FALSE, ...)prefs_reset_defaults(source = c("project", "user"), verbose = FALSE, ...)
source |
The source of the current preference value. Preferences are set at different levels, from lowest to highest precedence:
The default is |
verbose |
Prints or suppress informative output |
... |
Arguments passed on to
|
Resets preferences to their built-in defaults, returning the current
preferences invisibly as a list. You can also return to the preferences
prior to prefs_reset_defaults() with snapshot_prefs_undo().
## Not run: prefs_reset_defaults() ## End(Not run)## Not run: prefs_reset_defaults() ## End(Not run)
The RStudio User Preferences, their description and default value.
prefs_rstudioprefs_rstudio
A list with 244 items:
run_rprofile_on_resumeWhether to run .Rprofile again after resuming a suspended R session.
save_workspaceWhether to save the workspace to an .Rdata file after the R session ends.
load_workspaceWhether to load the workspace when the R session begins.
initial_working_directoryThe initial working directory for new R sessions.
cran_mirrorThe CRAN mirror to use.
bioconductor_mirror_nameThe name of the default Bioconductor mirror.
bioconductor_mirror_urlThe URL of the default Bioconductor mirror.
always_save_historyWhether to always save the R console history.
remove_history_duplicatesWhether to remove duplicate entries from the R console history.
show_last_dot_valueShow the result of the last expression (.Last.value) in the Environment pane.
line_ending_conversionThe line ending format to use when saving files.
use_newlines_in_makefilesWhether to use newlines when saving Makefiles.
windows_terminal_shellThe terminal shell to use on Windows.
posix_terminal_shellThe terminal shell to use on POSIX operating systems (MacOS and Linux).
custom_shell_commandThe fully qualified path to the custom shell command to use in the Terminal tab.
custom_shell_optionsThe command-line options to pass to the custom shell command.
show_line_numbersShow line numbers in RStudio's code editor.
relative_line_numbersShow relative, rather than absolute, line numbers in RStudio's code editor.
highlight_selected_wordHighlight the selected word in RStudio's code editor.
highlight_selected_lineHighlight the selected line in RStudio's code editor.
panesLayout of panes in the RStudio workbench.
allow_source_columnsWhether to enable the ability to add source columns to display.
use_spaces_for_tabWhether to insert spaces when pressing the Tab key.
num_spaces_for_tabThe number of spaces to insert when pressing the Tab key.
auto_detect_indentationWhether to automatically detect indentation settings from file contents.
show_marginWhether to show the margin guide in the RStudio code editor.
blinking_cursorWhether to flash the cursor off and on.
margin_columnThe number of columns of text after which the margin is shown.
show_invisiblesWhether to show invisible characters, such as spaces and tabs, in the RStudio code editor.
indent_guidesStyle for indentation guides in the RStudio code editor.
continue_comments_on_newlineWhether to continue comments (by inserting the comment character) after adding a new line.
highlight_web_linkWhether web links in comments are clickable.
editor_keybindingsThe keybindings to use in the RStudio code editor.
insert_matchingWhether to insert matching pairs, such as () and [], when the first is typed.
insert_spaces_around_equalsWhether to insert spaces around the equals sign in R code.
insert_parens_after_function_completionWhether to insert parentheses after function completions.
tab_multiline_completionWhether to attempt completion of multiple-line statements when pressing Tab.
tab_completionWhether to attempt completion of statements when pressing Tab.
show_help_tooltip_on_idleWhether to show help tooltips for functions when the cursor has not been recently moved.
surround_selectionWhich kinds of delimiters can be used to surround the current selection.
enable_snippetsWhether to enable code snippets in the RStudio code editor.
code_completionWhen to use auto-completion for R code in the RStudio code editor.
code_completion_otherWhen to use auto-completion for other languages (such as JavaScript and SQL) in the RStudio code editor.
console_code_completionWhether to always use code completion in the R console.
code_completion_delayThe number of milliseconds to wait before offering code suggestions.
code_completion_charactersThe number of characters in a symbol that can be entered before completions are offered.
show_function_signature_tooltipsWhether to show function signature tooltips during autocompletion.
show_diagnostics_rWhether to show diagnostic messages (such as syntax and usage errors) for R code as you type.
show_diagnostics_cppWhether to show diagnostic messages for C++ code as you type.
show_diagnostics_yamlWhether to show diagnostic messages for YAML code as you type.
show_diagnostics_otherWhether to show diagnostic messages for other types of code (not R, C++, or YAML).
style_diagnosticsWhether to show style diagnostics (suggestions for improving R code style)
diagnostics_on_saveWhether to check code for problems after saving it.
background_diagnosticsWhether to run code diagnostics in the background, as you type.
background_diagnostics_delay_msThe number of milliseconds to delay before running code diagnostics in the background.
diagnostics_in_r_function_callsWhether to run diagnostics in R function calls.
check_arguments_to_r_function_callsWhether to check arguments to R function calls.
check_unexpected_assignment_in_function_callWhether to check for unexpected variable assignments inside R function calls.
warn_if_no_such_variable_in_scopeWhether to generate a warning if a variable is used without being defined in the current scope.
warn_variable_defined_but_not_usedWhether to generate a warning if a variable is defined without being used in the current scope
auto_discover_package_dependenciesWhether to automatically discover and offer to install missing R package dependencies.
auto_append_newlineWhether to ensure that source files end with a newline character.
strip_trailing_whitespaceWhether to strip trailing whitespace from each line when saving.
restore_source_document_cursor_positionWhether to save the position of the cursor when a file is closed, restore it when the file is opened.
reindent_on_pasteWhether to automatically re-indent code when it's pasted into RStudio.
vertically_align_arguments_indentWhether to vertically align arguments to R function calls during automatic indentation.
soft_wrap_r_filesWhether to soft-wrap R source files, wrapping the text for display without inserting newline characters.
soft_wrap_rmd_filesWhether to soft-wrap R Markdown files (and similar types such as R HTML and R Notebooks)
focus_console_after_execWhether to focus the R console after executing an R command from a script.
fold_styleThe style of folding to use.
save_before_sourcingWhether to automatically save scripts before executing them.
syntax_color_consoleWhether to use syntax highlighting in the R console.
highlight_console_errorsWhether to display error, warning, and message output in a different color.
scroll_past_end_of_documentWhether to allow scrolling past the end of a file.
highlight_r_function_callsWhether to highlight R function calls in the code editor.
color_previewWhether to show preview for named and hexadecimal colors.
rainbow_parenthesesWhether to highlight parentheses in a variety of colors.
rainbow_fenced_divsWhether to highlight fenced divs in a variety of colors.
console_line_length_limitThe maximum number of characters to display in a single line in the R console.
console_max_linesThe maximum number of console actions to store and display in the console scrollback buffer.
ansi_console_modeHow to treat ANSI escape codes in the console.
limit_visible_consoleWhether to only show a limited window of the total console output
show_inline_toolbar_for_r_code_chunksWhether to show a toolbar on code chunks in R Markdown documents.
highlight_code_chunksWhether to highlight code chunks in R Markdown documents with a different background color.
save_files_before_buildWhether to save all open, unsaved files before building the project.
font_size_pointsThe default editor font size, in points.
help_font_size_pointsThe help panel font size, in points.
editor_themeThe name of the color theme to apply to the text editor in RStudio.
server_editor_font_enabledWhether to use a custom editor font in RStudio Server.
server_editor_fontThe name of the fixed-width editor font to use with RStudio Server.
default_encodingThe default character encoding to use when saving files.
toolbar_visibleWhether to show the toolbar at the top of the RStudio workbench.
default_project_locationThe directory path under which to place new projects by default.
source_with_echoWhether to echo R code when sourcing it.
default_sweave_engineThe default engine to use when processing Sweave documents.
default_latex_programThe default program to use when processing LaTeX documents.
use_roxygenWhether to use Roxygen for documentation.
use_dataimportWhether to use RStudio's data import feature.
pdf_previewerThe program to use to preview PDF files after generation.
always_enable_rnw_concordanceWhether to always enable the concordance for RNW files.
insert_numbered_latex_sectionsWhether to insert numbered sections in LaTeX.
spelling_dictionary_languageThe language of the spelling dictionary to use for spell checking.
spelling_custom_dictionariesThe list of custom dictionaries to use when spell checking.
document_load_lint_delayThe number of milliseconds to wait before linting a document after it is loaded.
ignore_uppercase_wordsWhether to ignore words in uppercase when spell checking.
ignore_words_with_numbersWhether to ignore words with numbers in them when spell checking.
real_time_spellcheckingWhether to enable real-time spellchecking by default.
navigate_to_build_errorWhether to navigate to build errors.
packages_pane_enabledWhether to enable RStudio's Packages pane.
cpp_templateC++ template.
restore_source_documentsWhether to restore the last opened source documents when RStudio starts up.
handle_errors_in_user_code_onlyWhether to handle errors only when user code is on the stack.
auto_expand_error_tracebacksWhether to automatically expand tracebacks when an error occurs.
check_for_updatesWhether to check for new versions of RStudio when RStudio starts.
show_internal_functionsWhether to show functions without source references in the Traceback pane while debugging.
shiny_viewer_typeWhere to display Shiny applications when they are run.
shiny_background_jobsWhether to run Shiny applications as background jobs.
plumber_viewer_typeWhere to display Shiny applications when they are run.
document_authorThe default name to use as the document author when creating new documents.
rmd_auto_dateUse current date when rendering document
rmd_preferred_template_pathThe path to the preferred R Markdown template.
rmd_viewer_typeWhere to display R Markdown documents when they have completed rendering.
show_publish_diagnosticsWhether to show verbose diagnostic information when publishing content.
enable_cloud_publish_uiWhether to show UI for publishing content to Posit Cloud.
publish_check_certificatesWhether to check remote server SSL certificates when publishing content.
use_publish_ca_bundleWhether to use a custom certificate authority (CA) bundle when publishing content.
publish_ca_bundleThe path to the custom certificate authority (CA) bundle to use when publishing content.
rmd_chunk_output_inlineWhether to show chunk output inline for ordinary R Markdown documents.
show_doc_outline_rmdWhether to show the document outline by default when opening R Markdown documents.
auto_run_setup_chunkWhether to automatically run an R Markdown document's Setup chunk before running other chunks.
hide_console_on_chunk_executeWhether to hide the R console when executing inline R Markdown chunks.
execution_behaviorThe unit of R code to execute when the Execute command is invoked.
show_terminal_tabWhether to show the Terminal tab.
terminal_local_echoWhether to use local echo in the Terminal.
terminal_websocketsWhether to use websockets to communicate with the shell in the Terminal tab.
terminal_close_behaviorWhether to close the terminal pane after the shell exits.
terminal_track_environmentWhether to track and save changes to system environment variables in the Terminal.
terminal_bell_styleTerminal bell style
terminal_rendererTerminal rendering engine: canvas is faster, dom may be needed for some browsers or graphics cards
terminal_weblinksWhether web links displayed in the Terminal tab are made clickable.
show_rmd_render_commandWhether to print the render command use to knit R Markdown documents in the R Markdown tab.
enable_text_dragWhether to enable moving text on the editing surface by clicking and dragging it.
show_hidden_filesWhether to show hidden files in the Files pane.
always_shown_filesList of file names (case sensitive) that are always shown in the Files Pane, regardless of whether hidden files are shown
always_shown_extensionsList of file extensions (beginning with ., not case sensitive) that are always shown in the Files Pane, regardless of whether hidden files are shown
sort_file_names_naturallyWhether to sort file names naturally, so that e.g., file10.R comes after file9.R
sync_files_pane_working_dirWhether to change the directory in the Files pane automatically when the working directory in R changes.
jobs_tab_visibilityThe visibility of the Jobs tab.
show_launcher_jobs_tabWhether to show the Workbench Jobs tab in RStudio Pro and RStudio Workbench.
launcher_jobs_sortHow to sort jobs in the Workbench Jobs tab in RStudio Pro and RStudio Workbench.
busy_detectionHow to detect busy status in the Terminal.
busy_exclusion_listA list of apps that should not be considered busy in the Terminal.
knit_working_dirThe working directory to use when knitting R Markdown documents.
doc_outline_showWhich objects to show in the document outline pane.
latex_preview_on_cursor_idleWhen to preview LaTeX mathematical equations when cursor has not moved recently.
wrap_tab_navigationWhether to wrap around when going to the previous or next editor tab.
global_themeThe theme to use for the main RStudio user interface.
git_diff_ignore_whitespaceWhether to ignore whitespace when generating diffs of version controlled files.
console_double_click_selectWhether double-clicking should select a word in the Console pane.
console_suspend_blocked_noticeWhether the 'Auto Suspension Blocked' icon should appear in the R Console toolbar.
console_suspend_blocked_notice_delayHow long to wait before warning that automatic session suspension has been paused. Higher values for less frequent notices.
new_proj_git_initWhether a git repo should be initialized inside new projects by default.
new_proj_use_renvWhether an renv environment should be created inside new projects by default.
root_documentThe root document to use when compiling PDF documents.
show_user_home_pageWhen to show the server home page in RStudio Workbench.
reuse_sessions_for_project_linksWhether to reuse sessions when opening projects in RStudio Workbench.
vcs_enabledWhether to enable RStudio's version control system interface.
vcs_autorefreshAutomatically refresh VCS status?
git_exe_pathThe path to the Git executable to use.
svn_exe_pathThe path to the Subversion executable to use.
terminal_pathThe path to the terminal executable to use.
rsa_key_pathThe path to the SSH key file to use.
ssh_key_typeThe encryption type to use for the SSH key file.
use_devtoolsWhether to use the devtools R package.
clean_before_installAlways use –preclean when installing package.
use_internet2Whether to use Internet2 for networking on R for Windows.
use_secure_downloadWhether to use secure downloads when fetching R packages.
cleanup_after_r_cmd_checkWhether to clean up temporary files after running R CMD CHECK.
view_dir_after_r_cmd_checkWhether to view the directory after running R CMD CHECK.
hide_object_filesWhether to hide object files in the Files pane.
restore_last_projectWhether to restore the last project when starting RStudio.
project_safe_startup_secondsThe number of seconds after which a project is deemed to have successfully started.
use_tinytexUse tinytex to compile .tex files.
clean_texi2dvi_outputWhether to clean output after running Texi2Dvi.
latex_shell_escapeWhether to enable shell escaping with LaTeX documents.
restore_project_r_versionWhether to restore the last version of R used by the project in RStudio Pro and RStudio Workbench.
clang_verboseThe verbosity level to use with Clang (0 - 2)
submit_crash_reportsWhether to automatically submit crash reports to RStudio.
default_r_versionThe R version to use by default.
data_viewer_max_columnsThe maximum number of columns to show at once in the data viewer.
data_viewer_max_cell_sizeThe maximum number of characters to show in a data viewer cell.
enable_screen_readerSupport accessibility aids such as screen readers.
typing_status_delay_msNumber of milliseconds to wait after last keystroke before updating live region.
reduced_motionReduce use of animations in the user interface.
tab_key_move_focusTab key moves focus out of text editing controls instead of inserting tabs.
find_panel_legacy_tab_sequenceIn source editor find panel, tab key moves focus directly from find text to replace text.
show_focus_rectanglesControl with keyboard focus displays a visual focus indicator.
show_panel_focus_rectangleShow which panel contains keyboard focus.
auto_save_on_idleHow to deal with changes to documents on idle.
auto_save_idle_msThe idle period, in milliseconds, after which documents should be auto-saved.
auto_save_on_blurWhether to automatically save when the editor loses focus.
terminal_initial_directoryInitial directory for new terminals.
full_project_path_in_window_titleWhether to show the full path to project in desktop window title.
visual_markdown_editing_is_defaultWhether to enable visual editing by default for new markdown documents
visual_markdown_editing_list_spacingDefault spacing for lists created in the visual editor
visual_markdown_editing_wrapWhether to automatically wrap text when writing markdown
visual_markdown_editing_wrap_at_columnThe column to wrap text at when writing markdown
visual_markdown_editing_references_locationPlacement of footnotes within markdown output.
visual_markdown_editing_canonicalWhether to write canonical visual mode markdown when saving from source mode.
visual_markdown_editing_max_content_widthMaximum content width for visual editing mode, in pixels
visual_markdown_editing_show_doc_outlineWhether to show the document outline by default when opening R Markdown documents in visual mode.
visual_markdown_editing_show_marginWhether to show the margin guide in the visual mode code blocks.
visual_markdown_code_editor_line_numbersWhether to show line numbers in the code editors used in visual mode
visual_markdown_editing_font_size_pointsThe default visual editing mode font size, in points
visual_markdown_code_editorThe name of the editor to use to provide code editing in visual mode
zotero_librariesZotero libraries to insert citations from.
emoji_skintonePreferred emoji skintone
disabled_aria_live_announcementsList of aria-live announcements to disable.
screenreader_console_announce_limitMaximum number of lines of console output announced after a command.
file_monitor_ignored_componentsList of path components; file monitor will ignore paths containing one or more of these components.
install_pkg_deps_individuallyWhether to install R package dependencies one at a time.
graphics_backendR graphics backend.
graphics_antialiasingType of anti-aliasing to be used for generated R plots.
browser_fixed_width_fontsList of fixed-width fonts to check for browser support.
python_typeThe Python type.
python_versionThe Python version.
python_pathThe path to the default Python interpreter.
save_retry_timeoutThe maximum amount of seconds of retry for save operations.
insert_native_pipe_operatorWhether the Insert Pipe Operator command should use the native R pipe operator, |>
command_palette_mruWhether to keep track of recently used commands in the Command Palette
show_memory_usageWhether to compute and show memory usage in the Environment Pane
memory_query_interval_secondsHow many seconds to wait between automatic requeries of memory statistics (0 to disable)
terminal_python_integrationEnable Python terminal hooks. When enabled, the RStudio-configured version of Python will be placed on the PATH.
session_protocol_debugEnable session protocol debug logging showing all session requests and events
python_project_environment_automatic_activateWhen enabled, if the active project contains a Python virtual environment, then RStudio will automatically activate this environment on startup.
check_null_external_pointersWhen enabled, RStudio will detect R objects containing null external pointers when building the Environment pane, and avoid introspecting their contents further.
ui_languageThe IDE's user-interface language.
native_file_dialogsWhether RStudio Desktop will use the operating system's native File and Message dialog boxes.
discard_pending_console_input_on_errorWhen enabled, any pending console input will be discarded when an (uncaught) R error occurs.
editor_scroll_multiplierAn integer value, 1-200, to set the editor scroll multiplier. The higher the value, the faster the scrolling.
text_renderingControl how text is rendered within the IDE surface.
disable_renderer_accessibilityDisable Electron accessibility support.
copilot_enabledWhen enabled, RStudio will use GitHub Copilot to provide code suggestions.
copilot_completions_delayThe delay (in milliseconds) before GitHub Copilot completions are requested after the cursor position has changed.
https://github.com/rstudio/rstudio/raw/main/src/cpp/session/resources/schema/user-prefs-schema.json
The RStudio User Preferences, their description and default value for released versions of RStudio.
prefs_rstudio_vprefs_rstudio_v
A list with preferences from 10 released versions of RStudio.
https://github.com/rstudio/rstudio/raw/main/src/cpp/session/resources/schema/user-prefs-schema.json
Finds and downloads the RStudio user preference schema for your current version of the IDE (or the most recent released version of the IDE). The preference details for all released versions of the IDE are included in the rsprefs package. The preferences from the latest version are available in prefs_rstudio, but note that those preferences may not match your version of RStudio unless you're using the latest preview version available at https://dailies.rstudio.com.
prefs_schema(version = NULL, quiet = FALSE)prefs_schema(version = NULL, quiet = FALSE)
version |
The version of the RStudio IDE, e.g. |
quiet |
Suppress console messages and output |
prefs_schema("2021.09.0+351")prefs_schema("2021.09.0+351")
Save named snapshots of your RStudio preferences that you can apply later.
snapshot_prefs_save(): Save your RStudio user preferences with a name that
you can later use to identify these particular settings.
snapshot_prefs_use(): Apply a saved snapshot.
snapshot_prefs_list(): List available snapshots.
snapshot_prefs_undo(): Undo the last applied snapshot.
snapshot_prefs_save( name, path = NULL, include = NULL, exclude = NULL, source = "user", exclude_os_prefs = TRUE, overwrite = FALSE, preview = FALSE ) snapshot_prefs_use( name = NULL, path = NULL, exclude_os_prefs = TRUE, verbose = FALSE, preview = FALSE ) snapshot_prefs_list(path = NULL, verbose = TRUE) snapshot_prefs_undo(verbose = TRUE)snapshot_prefs_save( name, path = NULL, include = NULL, exclude = NULL, source = "user", exclude_os_prefs = TRUE, overwrite = FALSE, preview = FALSE ) snapshot_prefs_use( name = NULL, path = NULL, exclude_os_prefs = TRUE, verbose = FALSE, preview = FALSE ) snapshot_prefs_list(path = NULL, verbose = TRUE) snapshot_prefs_undo(verbose = TRUE)
name |
The name of the snapshot to save or apply.
|
path |
A GitHub gist ID or local path where the snapshot should be
saved. To create a new public gist, set |
include |
Names of RStudio preferences to include. If provided, only these preferences are included. See prefs_rstudio for preference names. |
exclude |
Names of RStudio preferences to exclude from the snapshot. See prefs_rstudio for all of the preference names. |
source |
The source of the current preference value. Preferences are set at different levels, from lowest to highest precedence:
The default is |
exclude_os_prefs |
Excludes operating-system or machine-dependent system preferences from the snapshot or the snapshot restore. |
overwrite |
If the snapshot exists, should it be overwritten? |
preview |
When |
verbose |
Prints or suppress informative output |
if (interactive()) { tmpfile <- tempfile(fileext = ".json") snapshot_prefs_save("example", path = tmpfile) snapshot_prefs_list(tmpfile) }if (interactive()) { tmpfile <- tempfile(fileext = ".json") snapshot_prefs_save("example", path = tmpfile) snapshot_prefs_list(tmpfile) }