Skip to content

itchyny/action-setup-vim

 
 

Repository files navigation

GitHub Action to setup Vim and Neovim

Build status Action Marketplace

action-setup-vim is a GitHub Action to setup Vim or Neovim on Linux, macOS and Windows. Both stable releases and nightly releases are supported.

For stable release, this action will install Vim or Neovim from package manager or official releases since it is faster than building from source.

For nightly release, this action basically installs the nightly release of Vim or Neovim from official releases. If unavailable, it builds executables from source.

For details of installation, please read the following 'Installation details' section.

Usage

Install the latest stable Vim

- uses: rhysd/action-setup-vim@v1

Install the latest nightly Vim

- uses: rhysd/action-setup-vim@v1
  with:
    version: nightly

Install the latest Vim v8.1.123. The version is a tag name in vim/vim repository. Please see the following 'Choose specific version' section also

- uses: rhysd/action-setup-vim@v1
  with:
    version: v8.1.0123

Install the latest stable Neovim

- uses: rhysd/action-setup-vim@v1
  with:
    neovim: true

Install the latest nightly Neovim

- uses: rhysd/action-setup-vim@v1
  with:
    neovim: true
    version: nightly

Install the Neovim v0.4.3. Please see the following 'Choose specific version' section also

- uses: rhysd/action-setup-vim@v1
  with:
    neovim: true
    version: v0.4.3

After the setup, vim executable will be available for Vim and nvim executable will be available for Neovim.

Real-world examples are workflows in clever-f.vim and git-messenger.vim. And you can see this repository's CI workflows. They run this action with all combinations of the inputs.

For comprehensive lists of inputs and outputs, please refer action.yml.

Outputs

This action sets installed executable path to the action's executable output. You can use it for running Vim command in the steps later.

Here is an example to set Vim executable to run unit tests with themis.vim.

- uses: actions/checkout@v2
  with:
    repository: thinca/vim-themis
    path: vim-themis
- uses: rhysd/action-setup-vim@v1
  id: vim
- name: Run unit tests with themis.vim
  env:
    THEMIS_VIM: ${{ steps.vim.outputs.executable }}
  run: |
    ./vim-themis/bin/themis ./test

Installation details

Vim

vX.Y.Z represents a specific version such as v8.2.0100.

OS Version Installation
Linux stable Install vim-gnome package via apt package manager
Linux nightly Build the HEAD of vim/vim repository
Linux vX.Y.Z Build the vX.Y.Z tag of vim/vim repository
macOS stable Install MacVim via brew install macvim
macOS nightly Build the HEAD of vim/vim repository
macOS vX.Y.Z Build the vX.Y.Z tag of vim/vim repository
Widnows stable There is no stable release for Windows so fall back to nightly
Windows nightly Install the latest release from installer repository
Windows vX.Y.Z Install the release at vX.Y.Z tag of installer repository repository

For stable releases on all platforms and nightly on Windows, gvim executable is also available.

When installing without system's package manager, Vim is installed at $HOME/vim.

Neovim

vX.Y.Z represents a specific version such as v0.4.3.

OS Version Installation
Linux stable Install from the latest Neovim stable release
Linux nightly Install from the latest Neovim nightly release
Linux vX.Y.Z Install the release at vX.Y.Z tag of neovim/neovim repository
macOS stable brew install neovim using Homebrew
macOS nightly Install from the latest Neovim nightly release
macOS vX.Y.Z Install the release at vX.Y.Z tag of neovim/neovim repository
Windows stable Install from the latest Neovim stable release
Windows nightly Install from the latest Neovim nightly release
Windows vX.Y.Z Install the release at vX.Y.Z tag of neovim/neovim repository

Only on Windows, nvim-qt.exe executable is available for GUI.

When installing without system's package manager, Neovim is installed at $HOME/nvim.

Note: Ubuntu 18.04 supports official neovim package but this action does not install it. As of now, GitHub Actions also supports Ubuntu 16.04.

Choose specific version

Vim

If Vim is built from source, any tag version should be available.

If Vim is installed via release asset (on Windows), please check vim-win32-installer releases page to know which versions are available. The repository makes a release once per day (nightly).

Neovim

When installing the specific version of Neovim, this action downloads release assets from neovim/neovim. Please check neovim/neovim releases page to know which versions have release assets. For example, Neovim 0.4.0 has no Windows releases so it is not available for installing Neovim on Windows.

Using GitHub API token

Only when installing Vim on Windows, this action sends GitHub API request to know the latest assets released at vim-win32-installer. By default, this action receives workflow's token. If you don't want to pass a token which has some permissions, please make your personal access token from here with no scope and set it as a secret of your repository.

For example, the following is a step when you put your personal access token to PERSONAL_ACCESS_TOKEN secret.

- uses: rhysd/action-setup-vim@v1
  with:
    github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

Current limitation

  • GUI version (gVim and nvim-qt) is supported partially as described in above section.

License

Distributed under the MIT license.

About

GitHub Action to setup Vim or Neovim on Linux, macOS and Windows

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 93.6%
  • Shell 6.4%