(experimental) Neovim package manager, minimal, literal
Alpha software, be careful but have fun.
See it in action here, kickstart.nvim rewritten with lit.nvim in markdown.
- ποΈ Manage all your Neovim plugins with one markdown file, with out of box configured lsp, completion and formatting
- πΎ Partial clones instead of shallow clones
- π Automatic lazy-loading of Lua modules and lazy-loading on events, commands, filetypes, and key mappings, powered by lz.n
- πͺ Async execution for improved performance
- π οΈ No need to manually compile plugins
- π Lockfile
lit-lock.json
to keep track of installed plugins - π Commit, branch, tag, version, and full Semver support
- π¦ Package formats support: lazy.lua, packspec, rockspec
- Have an UI
- Take over Neovim initialization
In your init.lua:
local litpath = vim.fn.stdpath("data") .. "/site/pack/lit/start/lit.nvim"
if not (vim.uv or vim.loop).fs_stat(litpath) then
local litrepo = "https://github.com/neo451/lit.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", litrepo, litpath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lit.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
Note
You can place init.lua
and init.md
in a separate directory like .config/litvim
and just try out with:
NVIM_APPNAME=litvim nvim
No need for a setup function
vim.g.lit = {
-- not much here yet
}
Write your config in markdown in .config/nvim/init.md
:
- author/repo or url -> heading
# Fuzzy Finder
## nvim-lua/plenary.nvim
## nvim-telescope/telescope.nvim
- plugin config ->
lua
code blocks
# stevearc/oil.nvim
```lua
require"oil".setup{}
```
- plugin spec -> list items
- Use
build
field for build setups- if starts with
:
-> vim cmd - else -> shell command
- if starts with
- If something is a dependency/library, use
opt
flag - For other supported fields, see documentation for lz.n
# nvim-treesitter/nvim-treesitter
- build: `:TSUpdate`
# saghen/blink.cmp
- build: `cargo build --release`
# nvim-lua/plenary.nvim
- opt: `true`
# saghen/blink.cmp
- event: `InsertEnter`
# nvim-neorg/neorg
- ft: `norg`
# NeogitOrg/neogit
- cmd: `Neogit`
- keys: `{ { "<leader>gg", "<cmd>Neogit<cr>" } }`
- options and vars -> yaml header
.x
forvim.o.x
.g.x
forvim.g.x
---
.g.mapleader: " "
.g.localmapleader: " "
.laststatus: 3
.wrap: true
.signcolumn: "yes"
---
- parser and code runner
- config blocks
- multiple blocks
- extensible for languages
- config syntax
- YAML header as vim.o / vim.g
- lazy loading with lz.n
- support markdown/html comments
- versioning
- branch
- pin
- commit
- tag
- semver
- actions
- clone
- update
- sync
- list
- edit
- build
- resolve
- editing
- lsp -> otter.nvim
- formatter -> conform.nvim
- completion
- cool to have
- nice ts folds
- fold yaml header
- plugin url in any heading level for organization
- native snippets for code blocks -> NativeVim
- native heading completion with activate.nvim
- update info as diagnostic hover markdown
- nice ts folds
- paq-nvim for all the plugin management logic
- LitLua for the idea for a literate config
- lz.n for handling lazy loading