sponsor Vim development Vim logo Vim Book Ad

rpi-vim : Vim integration for emulated Raspberry PIs

 script karma  Rating 0/0, Downloaded by 335  Comments, bugs, improvements  Vim wiki

created by
Robert Di Pardo
 
script type
utility
 
description
Designed for Docker-hosted RPi OS images, but suitable for any RPi with a running SSH server.
Source files are copied to the RPi with rsync and compiled with the native GCC toolchain.

Visit https://github.com/rdipardo/rpi-vim#readme for complete details


Setup
---------
These configuration variables can be set in a '.env' file in your current working directory:

OS_VERSION
  Raspberry Pi OS version string
  Default: '2022-01-28-raspios-bullseye-arm64-lite'

OS_IMAGE_URL
  URL where 'OS_VERSION' is hosted
  Default: 'https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-01-28'

RPI_BOARD
  Model number of the board to virtualize
  Default: 'pi3'

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE
Valid options are: 'pi1', 'pi2', 'pi3' or '' (empty).
If the model number is empty, and 'OS_VERSION' targets `armhf`,
the image is mounted to a virtual ARM Versatile board by default.

See:
  https://github.com/lukechilds/dockerpi#which-machines-are-supported
  https://www.qemu.org/docs/master/system/arm/versatile.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SSH_HOST
  User and host name of the RPi's SSH server
  Default: 'pi@localhost'

SSH_PORT
  Port number the RPi's SSH server is listening on
  Default: 5022

SSH_PASSWORD
  Login password for 'SSH_HOST'
  Default: ''

SSH_PARAMS
  Additional options for the ssh client
  Default: ''

WORK_DIR
  Directory on the RPi where source files will be copied
  Default: '~'

A CFLAGS, CXXFLAGS or LDFLAGS variable can also be passed to the RPi's compiler by creating a '.cflags' file in the current working directory, e.g.,

  CFLAGS='-I/opt/vc/include -std=c11'
  CXXFLAGS='-std=gnu++2b'
  LDFLAGS='-L/opt/vc/lib -lbcm_host'


Commands
----------------
:RPiRun             Default mapping: {Normal}<F7>

Execute the active buffer on the RPi.


:RPiCompile         Default mapping: {Normal}<F8>

Copy the active buffer to the RPi and compile it.


:RPiMake [{target}] Default mapping: {Normal}<F9>

If the working directory contains a Makefile, copy all source files to the RPi
and run `make` with the given {target}, if any.

If no Makefile exits, copy, compile and link all source files using the
'CFLAGS', 'CXXFLAGS' and 'LDFLAGS' variables in the user's '.cflags' file.


:RPiSetup  [{key_file_path}] [{key_file_password}]

Create a new SSH key file at {key_file_path} with {key_file_password} and copy
it to the RPi at 'SSH_HOST'. Also copy the plugin's required build scripts
after a successful connection is made. All parameters are optional.


:RPiBoot  [{image_file_directory}]

Search {image_file_directory} for an RPi OS image file matching 'OS_VERSION'
and mount it inside a Docker container.

If no {image_file_directory} is given, search the plugin's installation path.
If no image matching 'OS_VERSION' is found, try downloading it from 'OS_IMAGE_URL'.
 
install details
With Vim 8 or newer, copy the plugin source tree into Vim's 'packages' path:

  mkdir -p ~/.vim/pack/plugins/start
  git clone https://github.com/rdipardo/rpi-vim.git ~/.vim/pack/plugins/start/rpi-vim

Visit https://github.com/rdipardo/rpi-vim#readme for instructions on using a third-party plugin manager
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
rpi-vim.1.2.1.tar.gz 1.2.1 2024-08-20 8.0 Robert Di Pardo * Improve fallback for runtime path resolution failures
* Customize the error message for Neovim
* Fix a logic error that could result in searching '/' for '.env' configuration files
rpi-vim.1.2.0.tar.gz 1.2.0 2023-11-06 8.0 Robert Di Pardo Adapt commands to Neovim's terminal protocol; support local '.env' and '.cflags' configurations
rpi-vim.1.1.1.tar.gz 1.1.1 2023-07-24 8.0 Robert Di Pardo Initial upload
ip used for rating: 18.97.9.175

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github