Re-learning Vim (6)

Date: 2023/02/01 (initial publish), 2023/06/08 (last update)

Source: en/note-00034.md

Previous Post Top Next Post

TOC

AstroNvim v2.11.8 on the current main branch

In order to update AstroNvim to the current main branch (which is also nightly branch), Neovim needed to be updated v0.8+. Since the official Debian package was stuck at v0.7, I installed the upstream provided deb package. See Debian BTS #1021339.

The following configuration was built on top of the configuration mentioned in Re-learning Vim (5).

Local customization

I customized my Neovim with ~/.config/astronvim and installed a few extra packages as astronvim-osamu.

Key local features:

vimdoc-install script to make all available Vimhelp documentation easily accessible via :h by creating symlinks in ~/.config/astronvim/doc/ directories to them.

Treesitter language support

Treesitter supports for pertinent languages were installed as:

:TSInstall {language}

See :h nvim-treesitter

LSP/DAP/Linter/Formatter language support

LSP/DAP/Linter/Formatter supports for pertinent languages were interactively installed by <leader>pI or :Mason.

Basically, this helps us to install requested <packagename> package into ~/.local/share/nvim/mason/packages/<packagename>/ and make its executable <progname> program accessible from Neovim in ~/.local/share/nvim/mason/bin/<progname>. So executable programs from Neovim plugins are not the one on the main system.

In order this to work, some system programs are needed to be installed in advance. As I see my situation with :checkhealth mason.nvim (after mason.nvim has been delay loaded by opening a file).:

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - OK: **Go**: `go version go1.19.5 linux/amd64`
  - OK: **cargo**: `cargo 1.65.0`
  - OK: **luarocks**: `/usr/bin/luarocks 3.8.0`
  - OK: **Ruby**: `ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]`
  - OK: **RubyGem**: `3.3.15`
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `9.2.0`
  - OK: **node**: `v18.13.0`
  - OK: **python3**: `Python 3.11.1`
  - OK: **pip3**: `pip 22.3.1 from /usr/lib/python3/dist-packages/pip (python 3.11)`
  - WARNING: **javac**: not available
  - OK: **java**: `openjdk version "17.0.6" 2023-01-17`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on linux-gnu.`
  - OK: **curl**: `curl 7.87.0 (x86_64-pc-linux-gnu) libcurl/7.87.0 OpenSSL/ ...
  - OK: **gzip**: `gzip 1.12`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Sat 0 ...

I ended up to install following Debian packages as required system programs.

See more :h mason.nvim

In order to make LSP/DAP/Linter/Formatter programs accessible from shell prompt, I have modifies ~/.profile to include the following:

# set PATH so it includes mason.nvim's private bin if it exists (Neovim/mason.nvim)
if [ -d "$HOME/.local/share/nvim/mason/bin/" ]; then
    PATH="$HOME/.local/share/nvim/mason/bin:$PATH"
fi

I got annoyed with automatic reformat upon file save. The upstream gave me a lesson pointing me to a solution.

I also added ~/.editorconfig to cope with sources using editorconfig.

AstroNvim on v3 branch with lazy.nvim

It looks like AstoNvim is migrating to the new package manager lazy.nvim as I see its v3 branch development.

Once we migrate, files under ~/.local/share/nvim/site/pack/packer seem to be safely removed after migration.

Previous Post Top Next Post