1 unstable release

0.4.0 Aug 29, 2024

#235 in Text editors

22 downloads per month
Used in vim-plugin-metadata

MIT license

4.5MB
151K SLoC

C 148K SLoC // 0.0% comments JavaScript 2.5K SLoC // 0.0% comments Scheme 311 SLoC // 0.1% comments Rust 36 SLoC

tree-sitter-vim

CI discord matrix

A tree-sitter parser for Vimscript files.

References


lib.rs:

This crate provides vim language support for the tree-sitter parsing library.

Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
echo "hello world" | q
"#;
let mut parser = tree_sitter::Parser::new();
parser.set_language(&tree_sitter_vim::language()).expect("Error loading vim grammar");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~3–4MB
~80K SLoC