In the context of Using R on a Raspberry Pi Zero W the following notes list the steps that were used to install vim and nvim from scratch on a Raspberry Pi Zero W. The steps should also work for PCs with a recent Debian or Ubuntu version.
I'm aware that nvim implements many features not available in vim but since nvim was designed to be coexist with vim - it can even use the same .vimrc - so why not make a common installation so that starting any of them for editing a config file works as expected.
The default .vimrv location can be used, which is ~/.vimrc (general notes on configuring vim can be found in idiomatic-vimrc).
The following ~/.vimrc settings contain the minimal vim-plug configuration for both vim and nvim:
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" " - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'jalvesaq/Nvim-R', {'branch': 'stable'}
" Initialize plugin system
call plug#end()
Before starting vim, vim-plug needs to be installed:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
When starting vim it may complain that git needs to be install (sudo apt install git). The installation of Nvim-R in vim should start without further action.
From this point nvim can be installed (sudo apt install neovim). The nvim help page transition from vim now lists the following steps:
- To start the transition, create your |init.vim| (user config) file by entering the following commands:
:call mkdir(stdpath('config'), 'p')
:exe 'edit '.stdpath('config').'/init.vim'
- Add these contents to the file:
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
Now start nvim and issue :checkhealth - the output shoul look like this:
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $SSH_TTY='/dev/pts/0'
In nvim the vim-plug needs to be configured manually:
:PlugStatusto show managed plug-ins:PlugInstallto load plug-ins
In both vim and nvim installed scripts and plug-ins can be listed with :scriptnames.
Notes:
/usr/lib/R/library/base/R/Rprofile.~/.Rprofilefor local settings~.vimrcTab settings in
~/.vimrc: