repositories / dotfiles
dotfiles
bugabingas dorkfiles
owned by admin
neovim/justfile
Rawset shell := ['nu', '--commands']
# List available recipes.
default:
@just --list
# Reproduce some neovim issue
repro:
nvim -u repro.lua
puk:
nu puk.nu
puke:
@nu puk.nu update
@if ( "puk.plugins.updated.nuon" | path exists ) { mv puk.plugins.updated.nuon puk.plugins.nuon }
# DANGER NEVER CALL! delete all current neovim state, cache and other ephemeral data. does NOT delete the configs
nuke:
rm --interactive --recursive --force (nvim "--headless" "--clean" +'lua print(vim.fn.stdpath[[data]])' +q | complete | get stderr)
rm --interactive --recursive --force (nvim "--headless" "--clean" +'lua print(vim.fn.stdpath[[cache]])' +q | complete | get stderr)
rm --interactive --recursive --force (nvim "--headless" "--clean" +'lua print(vim.fn.stdpath[[state]])' +q | complete | get stderr)
# run all tests, or only the ones in the directory of file given
test path="tests":
timeit { nvim --headless --noplugin -u tests/minimal_init.lua -c "PlenaryBustedDirectory {{ path }} {minimal_init = 'tests/minimal_init.lua'}" +q }
# drive a live neovim over rpc and assert interactive behaviour
drive:
nvim --headless --clean -l tests/drive/run.lua
# drive a live neovim and mutate its files from the outside
drive-file-changed:
nvim --headless --clean -l tests/drive/file_changed.lua
# drive a real neovide window over rpc, without touching mouse or keyboard
drive-neovide:
nvim --headless --clean -l tests/drive/neovide.lua
# run the pi contract tests against a real `pi --mode rpc` child
test-contract:
with-env { PIVI_CONTRACT: "1" } { nvim --headless --noplugin -u tests/minimal_init.lua -c "PlenaryBustedDirectory tests/contract {minimal_init = 'tests/minimal_init.lua'}" +q }
# run manual tests
test-manual:
nvim -c "set rtp^=." -c "luafile tests/manual/input.lua"
# lint the nvim lua config code
lint:
with-env { VIMRUNTIME: (nvim --headless --clean +"lua io.stdout:write(vim.env.VIMRUNTIME)" +q | complete | get stdout) } { lua-language-server --check=. --checklevel=Warning }
# run nvim healthcheck in console
checkhealth:
@nvim --headless -c "luafile print_checkhealth.lua"
# run ast-grep refactoring on the neovim configuration
refac:
ast-grep scan --interactive