Neovim syntax highlighting for BIRD 2 and BIRD 3 configuration files
Version: English | 简体中文

BIRD.nvim provides Neovim syntax highlighting, filetype detection, and filetype plugin support for BIRD 2 and BIRD 3 configuration files.
This is the Neovim plugin component of the BIRD-tm-language-grammar project by the BIRD Chinese Community.
[!NOTE] This repository was renamed from
BIRD2.nvimto reflect support for both BIRD 2 and BIRD 3. GitHub redirects the old URL, while thebird2filetype,require("bird2"), commands, and configuration keys remain compatible.
.bird, .bird2, .bird3, and .conf files.conf files:help bird2Choose your preferred plugin manager:
{
"bird-chinese-community/BIRD.nvim",
version = "^1.0.14",
lazy = false,
config = function()
require("bird2").setup()
end,
}
The plugin must load before filetype detection runs; using ft = "bird2" alone
creates a detection/loading cycle for BIRD-specific filenames.
Clone the repository into a start package directory; Neovim loads it during
startup:
git clone https://github.com/bird-chinese-community/BIRD.nvim \
~/.local/share/nvim/site/pack/plugins/start/BIRD.nvim
# Clone the repository
git clone https://github.com/bird-chinese-community/BIRD.nvim.git
cd BIRD.nvim
# Add this directory to your Neovim runtime path
This repository can be used directly as a Neovim package directory.
Every GitHub Release
also includes standalone ZIP and tar.gz archives plus SHA256SUMS. Release
archives exclude the development-only shared/ submodule and include generated
doc/tags. See the release runbook for the verified package
contract.
GitHub redirects the former BIRD2.nvim repository URL, so existing checkouts continue to fetch. Update the repository name in your plugin-manager configuration, then refresh it:
" lazy.nvim
:Lazy sync
" packer.nvim
:PackerSync
For an existing native package checkout, rename its directory, update the remote, and then refresh the repository:
If an older vimdoc installation uses the lowercase directory bird2.nvim,
substitute that name for BIRD2.nvim in the first command.
mv ~/.local/share/nvim/site/pack/plugins/start/BIRD2.nvim \
~/.local/share/nvim/site/pack/plugins/start/BIRD.nvim
git -C ~/.local/share/nvim/site/pack/plugins/start/BIRD.nvim \
remote set-url origin https://github.com/bird-chinese-community/BIRD.nvim.git
git -C ~/.local/share/nvim/site/pack/plugins/start/BIRD.nvim pull --ff-only
For a manual checkout at another path, the directory name can remain unchanged; update its remote:
git -C /path/to/BIRD2.nvim remote set-url origin \
https://github.com/bird-chinese-community/BIRD.nvim.git
git -C /path/to/BIRD2.nvim pull --ff-only
The shared/ submodule is only needed when contributing syntax changes; it is
not required to use the plugin.
The compatibility API remains unchanged: keep require("bird2"), filetype=bird2, :Bird2, and :checkhealth bird2 in existing configurations.
.bird, .bird2, .bird3bird.conf, bird2.conf, bird3.conf, bird6.conf, and explicit bird-*/*.bird*.conf variantsbird, bird2, or bird3 directories.conf files. Strong BIRD-only constructs are accepted immediately; generic constructs require two independent signals to reduce false positives.After installation, view the help documentation:
:help bird2
To regenerate help tags:
:helptags ~/.local/share/nvim/site/doc
See the changelog for release history. Contributors should add a bilingual fragment following the change-fragment guide for user-visible or release-worthy changes.
No configuration is required. The plugin works out of the box.
If you want to disable content-based detection for .conf files:
require("bird2").setup({
heuristic_detect = false,
})
To add custom file extensions:
vim.filetype.add({
extension = {
myext = "bird2",
},
})
syntax/bird2.vim is stored as a regular file so this repository works when installed standalone.
To sync syntax updates from the initialized shared/bird2.vim (BIRD.vim)
submodule:
bash scripts/sync-syntax.sh
Or use an explicit source path:
bash scripts/sync-syntax.sh /path/to/BIRD.vim/syntax/bird2.vim
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Maintained with :heart: by the BIRD Chinese Community