My Computing Environment Preferences

How I Like Things on My Computers

Terminal & Shell

The Terminal is an application on your Mac. A Shell is a program that runs in the Terminal. It has a command-line interface (CLI) instead of the ubiquitous graphical-user interface (GUI) familiar to most computer users. To run commands in the Terminal via the Shell (or, equivalently, to execute programs on the command line) you type commands at the prompt and hit enter.

On Mac

I use iTerm2 terminal application with the default zsh shell on Mac, configured using Oh My Zsh.

A nice installation guide is provided by Josean Martinez. It walks through installation of the homebrew package manager, the iTerm2 terminal application, Git version control software, the Oh My Zsh framework for managing the Zsh configuration, the PowerLevel10k Oh My Zsh theme, and Josean’s iTerm2 coolnight color scheme.

My PowerLevel10k theme preferences are the following:

    1. Yes, install the Meslo Nerd Font
    1. Classic prompt style
    1. Unicode character set
    1. Light prompt color
    1. 12-hour format for current time
    1. Angled prompt separator
    1. Sharp prompt heads
    1. Flat prompt tails
    1. 2-line prompt height
    1. Solid prompt connection
    1. No prompt frame
    1. Sparse prompt spacing
    1. Many icons
    1. Concise prompt flow
    1. Enable transient prompt
    1. Verbose instant prompt mode

I also use the zsh-autosuggestions and zsh-syntax-highlighting plugins. A 3-step procedure downloads, installs, and enables most Zsh plug-ins:

  1. download the plug-in: git clone <url> $ZSH_CUSTOM/plugins/<plugin-name>
  2. add the plugin name to the array in the ~/.zshrc file: plugins=(<plugin-name> <plugin-name> ...)
  3. reload the Zsh configuration file via source ~/.zshrc to enable the plugins

On Windows

I use the Windows Terminal application, downloaded from the Microsoft Store. I also use Git-Bash or the Windows Subsysten for Linux (WSL) running Ubuntu with Zsh as my shell. For Zsh, I use the same Oh My Zsh framework with the PowerLevel10k theme as on my Mac (see above).


RStudio

Visual Look

For the visual look of RStudio, I use the RStudio theme Darkstudio and my own version of Atom’s One Dark editor theme, along with the Fira Code font. They can be installed as follows:

# rstudio theme
devtools::install_github("https://github.com/rileytwo/darkstudio")

path_to_index <- "/Applications/RStudio.app/Contents/Resources/app/www/index.htm"
darkstudio::activate(path_to_index) # on mac
darkstudio::activate() # on windows (open rstudio with "run as admin")

# editor theme
url <- "https://github.com/dyavorsky/atom-inspired-rstudio-theme/blob/main/atom_inspired.rstheme"
rstudioapi::addTheme(url, apply = TRUE, force = TRUE)

Global Options

When installing RStudio on a new machine, ensure the following global options are set:

  • Uncheck Restore most recently opened project at startup
  • Uncheck Restore previously open source documents at startup
  • Uncheck Restore .RData into workspace at startup
  • Set Save workspace to .RData on exit to “Never”

Most-used shortcuts

Navigation

  • Ctrl + 1 moves focus to the script editor
  • Ctrl + 2 moves focus to the console
  • Ctrl + Tab moves focus to the next script tab
  • Alt + Shift + M moves focus to the terminal

Editing

  • Alt + Shift + Arrow starts multi-cursor editing
  • Alt + Arrow moves the current line up or down
  • Alt + Shift + Arrow duplicates the current line up or down
  • Ctrl + Space brings up RStudio’s path auto-completion menu (useful to avoid Co-pilot path auto-completion)

Running

  • Ctrl + Alt + B runs an R script from beginning to current line
  • Ctrl + Shift + K renders a Quarto document

VS Code

Extensions

Themes:

  • Atom One Dark by Mahmoud Ali
  • Material by Equinusocio
  • Material Icons by Equinusocio

Languages:

  • R by REditorSupport
  • Quarto by quarto.org
  • Python by Microsoft
  • Jupyter by Microsoft
  • Julia by julialang
  • LaTeX Workshop by James Yu

Other:

  • GitHub Copilot by GitHub
  • Error Lens by Alexander