From 80caf75d9abaf4efee6a2f7b5df949c8b65f6ff6 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 26 Feb 2023 07:46:32 +0000 Subject: [PATCH 1/2] WIP: feat: add neovim --- nvim/install.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ nvim/releases.js | 20 +++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 nvim/install.sh create mode 100644 nvim/releases.js diff --git a/nvim/install.sh b/nvim/install.sh new file mode 100644 index 000000000..e076ae3f8 --- /dev/null +++ b/nvim/install.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +# shellcheck disable=SC2034 +# "'pkg_cmd_name' appears unused. Verify it or export it." + +__init_neovim() { + set -e + set -u + + ################## + # Install neovim # + ################## + + # Every package should define these 6 variables + pkg_cmd_name="nvim" + + pkg_dst_cmd="$HOME/.local/opt/neovim/bin/nvim" + pkg_dst_dir="$HOME/.local/opt/neovim" + pkg_dst="$pkg_dst_dir" + + pkg_src_cmd="$HOME/.local/opt/neovim-v$WEBI_VERSION/bin/nvim" + pkg_src_dir="$HOME/.local/opt/neovim-v$WEBI_VERSION" + pkg_src="$pkg_src_dir" + + # pkg_install must be defined by every package + pkg_install() { + # mv ./nvim-* ~/.local/opt/neovim-macos + mv ./nvim-* "${pkg_src}" + } + + # pkg_get_current_version is recommended, but not required + pkg_get_current_version() { + # 'nvim --version' has output in this format: + # NVIM v0.7.2 + # Build type: Release + # LuaJIT 2.1.0-beta3 + # Compiled by runner@Mac-1656256708179.local + # + # Features: +acl +iconv +tui + # See ":help feature-compile" + # + # system vimrc file: "$VIM/sysinit.vim" + # fall-back for $VIM: "/share/nvim" + # + # Run :checkhealth for more info + + # This trims it down to just the version number: + # 0.7.2 + nvim --version 2> /dev/null | + head -n 1 | + cut -d ' ' -f 2 | + sed 's/v//' + } + +} + +__init_neovim diff --git a/nvim/releases.js b/nvim/releases.js new file mode 100644 index 000000000..fc7761cbb --- /dev/null +++ b/nvim/releases.js @@ -0,0 +1,20 @@ +'use strict'; + +var github = require('../_common/github.js'); +var owner = 'neovim'; +var repo = 'neovim'; + +module.exports = function (request) { + return github(request, owner, repo).then(function (all) { + return all; + }); +}; + +if (module === require.main) { + module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); + all.releases = all.releases.slice(0, 10); + //console.info(JSON.stringify(all)); + console.info(JSON.stringify(all, null, 2)); + }); +} From 53aaef50bdc36fb6f39b9b094424e020cfe49913 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 26 Feb 2023 08:02:53 +0000 Subject: [PATCH 2/2] f: neovim --- nvim/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 nvim/README.md diff --git a/nvim/README.md b/nvim/README.md new file mode 100644 index 000000000..0cb6a3d9b --- /dev/null +++ b/nvim/README.md @@ -0,0 +1,21 @@ +--- +title: nvim +homepage: https://neovim.io/ +tagline: | + neovim: hyperextensible Vim-based text editor +--- + +To update or switch versions, run `webi nvim@stable` (or `@v0.7`, `@beta`, etc). + +### Files + +These are the files / directories that are created and/or modified with this +install: + +```text +~/.config/envman/PATH.env +~/.config/nvim/init.vim +~/.local/opt/neovim/ +``` + +## Cheat Sheet