Skip to content

Older and wiser

After last weeks experiments with Neovim 0.11 and AstroNvim version 5, it was time to put together the new nvim-astro5 configuration. The AstroNvim 5 based config is even simpler with fewer lines of code than current AstroNvim 4 config.

AstroNvim has replaced many plugins with Snacks and it feels even more responsive to use and more visually appealing. I've also updated the theme to Catppuccin (Cat Pussin') for Neovim and Kitty terminal app for a nice consistency.

There will be some significant changes to add to the Practicalli Neovim book as the content migrates to use Practicalli nvim-astro5 configuration. So as to not disrupt users of Practicalli Astro (based on AstroNvim 4) I will use a separate git branch and publish initially to Practicalli Neovim Staging site.

Once the Practicalli nvim-astro5 configuration is feature compatible and has proven itself stable, I will push all the updates to Practicalli Neovim

Firstly, I had to create a staging website and workflow to publish from a seperate branch (or a pull request) for a book created with Material for MkDocs. A staging site was used for the Practicalli blog generated by Cryogen and pushed to a separate repository (GitHub Org token added for accessing a different repository).

TODO: Relesed Practicalli nvim-astro5

DOING: are there meaningful icon for linking to GitHub issues, pull requests and and projects? Other than the generic GitHub icon

Material for MkDocs Icons & Emoji page has a search across all icons and emojis available. Potential icons include:

  • - Octicons issue open
  • - Octicons issue closed
  • 🎫 - a ticket
  • 🎟 - tickets (like ticket but red)

Updating to Neovim 0.11 on Arch Linux was unexpectedly challenging and was an opportunity to look into package mirrors. It seems some mirrors are not updating as regularly as they could. Further investigation into the best mirrors to use for my geographical region seems valuable.

Contributions:

Neovimλ︎

Created an issue to track the development of the new configuration for Neovim, Practicalli nvim-astro5 , based on Neovim 0.11 API changes and AstroNvim 5.

Install GitHub CLI on Linux

(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
    && sudo mkdir -p -m 755 /etc/apt/keyrings \
        && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
        && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
    && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
    && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
    && sudo apt update \
    && sudo apt install gh -y

NOTE: its very satisfying to see commands chained together (&&), so they can simple be copied and pasted into the shell. So many technical docs get this wrong by putting individual commands unchained in the same copy box.

Output of install
 (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
        && sudo mkdir -p -m 755 /etc/apt/keyrings \
        && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
        && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
        && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
        && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
        && sudo apt update \
        && sudo apt install gh -y
[sudo] password for practicalli:
2025-04-09 11:46:59 URL:https://cli.github.com/packages/githubcli-archive-keyring.gpg [2270/2270] -> "/tmp/tmp.frpFgUfjRq" [1]
Hit:1 http://security.debian.org/debian-security trixie-security InRelease
Hit:2 http://deb.debian.org/debian trixie-backports InRelease
Hit:3 http://deb.debian.org/debian trixie InRelease
Hit:4 https://download.docker.com/linux/debian bookworm InRelease
Hit:5 http://deb.debian.org/debian trixie-updates InRelease
Hit:6 http://deb.debian.org/debian unstable InRelease
Ign:7 https://releases.warp.dev/linux/deb stable InRelease
Get:8 https://cli.github.com/packages stable InRelease [3,917 B]
Hit:9 https://dl.google.com/linux/chrome/deb stable InRelease
Get:10 https://cli.github.com/packages stable/main amd64 Packages [346 B]
Hit:11 https://repo.nordvpn.com//deb/nordvpn/debian stable InRelease
Hit:12 https://releases.warp.dev/linux/deb stable Release
Hit:14 https://archive.regolith-desktop.com/debian/testing testing InRelease
Fetched 4,263 B in 1s (5,701 B/s)
540 packages can be upgraded. Run 'apt list --upgradable' to see them.
Notice: Missing Signed-By in the sources.list(5) entry for 'http://deb.debian.org/debian'
Notice: Missing Signed-By in the sources.list(5) entry for 'https://repo.nordvpn.com//deb/nordvpn/debian'
Installing:
  gh

Summary:
  Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 540
  Download size: 7,616 kB
  Space needed: 35.5 MB / 8,928 MB available

Get:1 http://deb.debian.org/debian trixie/main amd64 gh amd64 2.46.0-3 [7,616 kB]
Fetched 7,616 kB in 1s (7,478 kB/s)
Selecting previously unselected package gh.
(Reading database ... 391595 files and directories currently installed.)
Preparing to unpack .../archives/gh_2.46.0-3_amd64.deb ...
Unpacking gh (2.46.0-3) ...
Setting up gh (2.46.0-3) ...
Processing triggers for man-db (2.13.0-1) ...

Login to GitHub to enable Octo to work

gh auth login

Setting remote

If your remote is not aliased to 'origin' then set the remote. Practicalli uses specific domain names of the remote repository for the alias to make it clear where commits are being push too.

gh repo set-default

Create a pull request for the current remote

gh pr create

Termuxλ︎

Issue running the Clojure CLI within Termux on my Android phone (Pixel 2 XL - bought 2017 and still going strong)

I made an addition about setting Package archive mirror groups, selecting a geographical region rather than everywhere. Should be more efficient (although it was already pretty quick).

Practicalliλ︎

create a staging version of the Practicalli books

Neovim Book Staging siteλ︎

Create new repository called practicalli/neovim-staging

The book mkdocs.yml configuration file was copied to mkdocs-staging.yml and the remote: value set to the practicalli/neogit-staging URL

Staging book config changes

# Practicalli Neovim
site_name: Practicalli Neovim
site_url: https://practical.li/neovim-staging
site_description: Practical guide to Clojure development with Neovim
site_author: Practicalli
site_org: https://practical.li/
copyright: Copyright &copy 2023 Practicali <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>
repo_url: https://github.com/practicalli/neovim-staging/
edit_uri: https://github.com/practicalli/neovim-staging/edit/main/docs/

# Deployment
remote_name: practicalli/neovim-staging
remote_branch: gh-pages

Use mkdocs gh-deploy command to build the book and deploy to the site. This command clones the remote site, copies the new build of the book to cloned local repository, commits the changes and pushes those changes back to the remote site.

By default, mkdocs Unfortunately this looks for origin as the alias name for the remote repository. I use practicalli as the alias for all the books pushed to the Practicall Org on GitHub (so I know they are going to Practicalli and not practicalli-johnny)

UPDATE: I forgot to uncomment the remote_name: key in the config, so had to set it in the command line :face-palm: - although mkdocs is still looking for origin :sad-face: as I didnt understand the right syntax (I had practicalli/neovim-staging which wasnt found).

UPDATE: using the remote alias in the config file works, but relies on using the right local alias. Using the full GitHub URL worked, i.e. git@github.com:practicalli/neovim-staging.git

Failing to find remote repository
INFO    -  Copying '/home/practicalli/projects/practicalli/books/neovim/site' to 'gh-pages' branch and pushing to GitHub.
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The mkdocs gh-deploy command has a --remote-name flag allows setting the remote and seems to use the local alias for the remote.

I can push using --remote-name practicalli to the main book. I added a remote to the neovim-staging repository with an alias of staging.

Add staging alias to local repository config

git remote add staging git@github.com:practicalli/neovim-staging.git

Using --remote-name staging successfully pushes the book to the neovim-staging website

Example Output

 git remote -v
practicalli git@engineering:practicalli/neovim (fetch)
practicalli git@engineering:practicalli/neovim (push)
 git remote add staging git@github.com:practicalli/neovim-staging.git
 git remote -v
practicalli git@engineering:practicalli/neovim (fetch)
practicalli git@engineering:practicalli/neovim (push)
staging git@github.com:practicalli/neovim-staging.git (fetch)
staging git@github.com:practicalli/neovim-staging.git (push)

Now push the book, first activating the Python virtual environment so that the mkdocs command is available.

. ~/.local/venv/bin/activate; mkdocs gh-deploy --remote-branch gh-pages --remote-name staging --force --no-history --config-file mkdocs-staging.yml

Add this command as a docs-staging task in the project Makefile.

Makefile tasks: MkDocs generation & publishing

# --- Documentation Generation  -------- #
docs: ## Build and run mkdocs in local server (python venv)
    $(info -- MkDocs Local Server -----------------)
    . ~/.local/venv/bin/activate; $(MKDOCS_SERVER)

docs-changed:  ## Build only changed files and run mkdocs in local server (python venv)
    $(info -- Mkdocs Local Server -----------------)
    . ~/.local/venv/bin/activate; $(MKDOCS_SERVER) --dirtyreload

docs-build:  ## Build mkdocs (python venv)
    $(info -- Mkdocs Local Server -----------------)
    . ~/.local/venv/bin/activate; mkdocs build

docs-staging:  ## Deploy to staging repository
    $(info -- Mkdocs Staging Deploy ---------------)
    . ~/.local/venv/bin/activate; mkdocs gh-deploy --force --no-history --config-file mkdocs-staging.yml
# -------------------------------------- #

DONE: Investigate why the remote defined in the mkdocs-staging.yml file is not used - because I got the syntax wrong :face-palm:

TODO: Is a local staging alias still required when using the full GitHub URL in the mkdocs-staging.yml config file ?

Arch Linuxλ︎

I wanted to install Neovim 0.11 and its been a few weeks since I used Arch Linux, so decided to update all packages

sudo pacman -Syu

This didnt include the latest neovim 0.11 package and included only two updates, so that seemed very suspicious as there is normally many more packages to update.

I tried the specific install of neovim, but that still showed 0.10.4 as the latest version of neovim package.

After a quick search on the internet, one suggestion was a problem with a mirror. Arch Linux seems to have quite a few mirrors for a region (I am in the United Kindom region).

The /etc/pacman.d/mirrorlist contains the URL for each mirror site in the region. I edited the file and commented the first two URLs (for the same server)

 sudo nvim /etc/pacman.d/mirrorlist

Now running the package manager update I get around 30 packages listed with newer versions. Rather than install them all, I just installed neovim 0.11

sudo pacman -Sy neovim

This worked and I am enjoying Neovim with the new Practicalli nvim-astro5 configuration.

Optimum use of mirrorλ︎

Arch Linux Mirrors for ARM defines a better approach than I have from the Arch Linux wizard.

The default and recommended mirror set in all of our installations points to mirror.archlinuxarm.org, which provides a redirection to mirrors closest to you using GeoIP geolocation.

The mirrors are push synchronized from our servers, ensuring that all available mirrors are always up to date with the latest packages.

Is there something similar for ArchLinux.org?

No, but there is Arch Linux MirrorList generator

Using the Country specific filter, a list of Synchronised mirrors for the UK was generated. This list replaced the contents of /etc/pacman.d/mirrorlist

Arch Linux recommends the top 5 mirrors should be enabled (comment removed).

Generated United Kingdom Mirrors

## Arch Linux repository mirrorlist
## Filtered by mirror score from mirror status page
## Generated on 2025-04-09
## Customised by Country (United Kingdom)
## https://archlinux.org/mirrorlist/
##
## United Kingdom
Server = https://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/$arch
## United Kingdom
Server = https://mirror.server.net/archlinux/$repo/os/$arch
## United Kingdom
Server = https://lon.mirror.rackspace.com/archlinux/$repo/os/$arch
## United Kingdom
Server = https://london.mirror.pkgbuild.com/$repo/os/$arch
## United Kingdom
Server = https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://mirrors.ukfast.co.uk/sites/archlinux.org/$repo/os/$arch
## United Kingdom
#Server = https://gb.mirrors.cicku.me/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://mirror.vinehost.net/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://mirror.netweaver.uk/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://repo.c48.uk/arch/$repo/os/$arch
## United Kingdom
#Server = https://mirrors.melbourne.co.uk/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://mirror.st2projects.com/archlinux/$repo/os/$arch
## United Kingdom
#Server = https://repo.slithery.uk/$repo/os/$arch

Thank you.

🌐 Practical.li Website

Practical.li GitHub Org practicalli-johnny profile

@practicalli@clj.social @practical_li