Skip to content
Philippe Massicotte edited this page Jul 17, 2024 · 4 revisions

Using external terminals

By default, R.nvim uses the terminal emulator built into Neovim. However, you can use an external terminal emulator by setting the external_term option in the configuration table (see :h external_term). The currently supported external terminal emulators are:

  1. foot
  2. kitty
  3. gnome-terminal
  4. konsole
  5. xfce4-terminal
  6. alacritty
  7. xterm

Kitty terminal

To use the kitty terminal with R.nvim, follow these steps:

Configure Kitty to listen on a socket

Add the following configuration to your i3 configuration file to make kitty listen on a socket when it starts:

bindsym $mod+Return exec kitty -1 --instance-group "kitty_sock" -o allow_remote_control=yes --listen-on unix:/tmp/kitty_sock

Notes: The i3 configuration file is usually located at ~/.config/i3/config. If you are using a different window manager, you will need to find the appropriate configuration file.

Set the external terminal option in R.nvim

In the R.nvim configuration table, set the external_term option to the command that will be used to open a terminal:

external_term = "/usr/bin/kitten @ --to unix:/tmp/kitty_sock launch --type window --location=vsplit --keep-focus --cwd=current",

The R session will now be opened in a kitty terminal.