Skip to content

Instantly share code, notes, and snippets.

@atomashevic
Created July 22, 2024 11:45
Show Gist options
  • Save atomashevic/75b747002e5d7c53eac08c83cdcbdfe0 to your computer and use it in GitHub Desktop.
Save atomashevic/75b747002e5d7c53eac08c83cdcbdfe0 to your computer and use it in GitHub Desktop.
R REPL in Zed (Linux)

Run R code in ZED

Tested using Zed 0.144.4 on Ubuntu 22.04.4 LTS.

  1. Download the Ark R kernel 0.1.117
  2. Run the binary: ark --install
  3. Run jupyter-kernelspec list and find the path to ARK kernel
  4. Open ZED and install R Extension
  5. Open ZED and edit settings and insert the following code (update the exact path to Ark)
  "jupyter": {
    "enabled": true,
    "kernels": {
      "python": "/home/USER/.local/share/jupyter/kernels/python3",
      "R": "home/USER/.local/share/jupyter/kernels/ark"
    }
  }
  1. Open ZED keymap and map "Ctrl+Enter" (or preferred combination) to run code in REPL
[
{
  "context": "Editor",
  "bindings": {
    "ctrl-enter": "repl::Run"
  }
}
]
  1. Open .R file, select line(s) you wanna execute and hit "Ctrl+Enter"

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment