Skip to content

Instantly share code, notes, and snippets.



Last active Dec 23, 2020
What would you like to do?
My setup for Nvim-R on *nix using vim-plug

Setting up Nvim-R on *nix

Install nvim by preferred method


sudo apt install neovim


sudo pacman -S neovim

Install vim-plug - an alternative vim plugin manager

 sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \'

Add to local nvim config file ~/.config/nvim/init.vim:

set nowrap                            

vmap <Space> <Plug>RDSendSelection
nmap <Space> <Plug>RDSendLine   

inoremap <C-Space> <C-x><C-o> 
let R_assign = 2 

call plug#begin()
 Plug 'jalvesaq/Nvim-R', {'branch': 'stable'} 
 Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
 Plug 'junegunn/vim-github-dashboard'                      
 " any additional plugins go here
call plug#end()                                                                 

Optional: radian setup

radian - A 21st century R console -

Add to init.vim:

let R_app = "radian"                                                                          
let R_cmd = "R"                                                                               
let R_hl_term = 0                                                                             
let R_args = []
let R_bracketed_paste = 1

Install radian using Python 3 pip


sudo apt install python3-pip 
sudo pip3 install radian


sudo pacman install -S base-devel python python-pip
sudo pip install radian

Optional: vim-github-dashboard setup

Install the json_pure and neovim Ruby Gems.


sudo apt install ruby rubygems ruby-dev 


sudo pacman -S ruby rubygems
gem install json_pure neovim

Open nvim and install/update plugins


Open an R file

Keyboard shortcuts:

  • \rf to start R session

  • Ctrl+W to switch view ports

  • Ctrl+Space for omni-complete in nvim;

  • Tab for auto-complete (radian)

  • :NERDTreeToggle (NERDTree)

  • :GHDashboard and :GHActivity (vim-github-dashboard)

  • vim Cheat Cheat:

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