Skip to content

Instantly share code, notes, and snippets.

@ouuan
Last active September 30, 2025 04:30
Show Gist options
  • Select an option

  • Save ouuan/7413373e0a815d95484ad49706f83117 to your computer and use it in GitHub Desktop.

Select an option

Save ouuan/7413373e0a815d95484ad49706f83117 to your computer and use it in GitHub Desktop.
Verus neovim configuration
#!/bin/bash
base="$(dirname "$(realpath "$1")")"
PATH_add "$base"
export VERUS_BINARY_PATH="${VERUS_BINARY_PATH:-/usr/bin/verus}"
export VERUS_SINGULAR_PATH="${VERUS_SINGULAR_PATH:-/usr/bin/Singular}"
on_init = function(client)
local path = os.getenv('PATH')
if path and path:find('verus') then
client.config.settings['rust-analyzer'] = {
check = {
extraArgs = { '--expand-errors' },
},
procMacro = {
enable = false,
},
diagnostics = {
disabled = {
'unresolved-proc-macro',
},
},
}
client.notify('workspace/didChangeConfiguration', { settings = client.config.settings })
end
return true
end,
ln -s /usr/bin/verus-analyzer rust-analyzer
[toolchain]
channel = "1.88.0"
profile = "minimal"
components = ["rustfmt", "clippy"]
#!/bin/bash
set -euo pipefail
if [[ "$#" == 0 || "$*" == "--edition 20"[0-9][0-9] ]]; then
tmp=$(mktemp --tmpdir verusfmt.XXXX.rs)
cat > "$tmp"
verusfmt --verus-only "$tmp"
"$(rustup which rustfmt)" < "$tmp"
rm "$tmp"
else
"$(rustup which rustfmt)" "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment