Neovim Language Support
LazyVim Linting and Formatting
Section titled “LazyVim Linting and Formatting”Source: LazyVim: Linting and Formatting - YouTube with Elijah Manor
-
Use LazyVim’s language extras to setup environment for your language
-
Can configure linters like ESLint for JS
- Modify
.eslintrc.jsonand configure linter messages- Can extend to use prettier
- Modify
-
How to find errors/warnings?
- See neo tree indicators
- View code diagnostics for buffer: SPC x x
- View code diagnostics for line: SPC c d
- Search diagnostics: SPC s d (buffer) / D (root dir)
-
Fixing errors
- Code action: SPC c a …
- Code action, fix all issues: SPC c A
-
Additional formatting with prettier in LazyVim extras
- Create prettier config
npx prettier-initin code directory
- Create prettier config
-
null-ls.nvim has formatting sources
- proselint - formatter for English
- Can register formatters with mason, configure null-ls for diagnostics
Understanding Neovim with Treesitter
Section titled “Understanding Neovim with Treesitter”Source: Understanding Neovim #4 - Treesitter - YouTube
Treesitter does efficient parsing of languages. It creates a tree of a syntax, incremental as the file changes without re-parsing the whole file
It helps with things like:
- Highlights words
- Pattern matching, like search
nvim-treesitter plugin helps with installation of the correct parsers with specific queries.
:TSInstallinstalls parsers for languages:InspectTreebrowse syntax tree
Allows navigation of code like:
- Comment
- Function
- Declaration
- Fields
- Statements
Running nvim-treesitter with tree-sitter CLI on Windows 11 using MinGW
Section titled “Running nvim-treesitter with tree-sitter CLI on Windows 11 using MinGW”Following is a solution to using MinGW on Windows with the tree-sitter CLI
I was able to get tree-sitter build compilations working using mingw’s `gcc` without installing MSVC (cl.exe is not installed). Per discussion in the link above, the workaround is not related to nvim-treesitter, but rather setting the compiler for the the Rust `cc` crate used by the tree-sitter cli build commands.
- Install mingw’s gcc. For example, follow instructions recommended by the cc crate which uses msys2 and the mingw gcc package.
- Set shell environment variable of `CC` to `gcc`. The environment variable setting is from the cc Rust crate documentation on setting the compiler used.
- Run nvim and compilation should work now
Example workaround assuming nvim, tree-sitter CLI, and msys2 are installed
# Go into msys2ucrt64
# Install mingw gccpacman -Syu mingw-w64-ucrt-x86_64-gcc
# Verify the gcc in the environment points to the mingw onewhich gcc
# Set compiler that tree-sitter CLI will useexport CC="gcc"
nvimTested on 2025-09-18 with:
- NVIM v0.11.4
- tree-sitter 0.25.9
- Neovim distribution: LazyVim 15.x
On Windows, Mason Installs hitting Long Path Error
Section titled “On Windows, Mason Installs hitting Long Path Error”Error may be caused during Python ruff, ty, and other language
server installs.
For ruff and ty, a fix is to create a Python virtual environment in
a short directory like ~/nm. Run neovim inside the virtual
environment. The install should use virtual environment python for
installations, bypassing long file names that otherwise would be
created.