Skip to content

runtime(env): add ftplugin for env filetype#19522

Closed
snelling-a wants to merge 1 commit intovim:masterfrom
snelling-a:ftplugin-env
Closed

runtime(env): add ftplugin for env filetype#19522
snelling-a wants to merge 1 commit intovim:masterfrom
snelling-a:ftplugin-env

Conversation

@snelling-a
Copy link
Contributor

Summary

Add runtime/ftplugin/env.vim to set commentstring, comments, and formatoptions for the env filetype.

Problem

#19260 (patch 9.2.0033) introduced a dedicated env filetype for .env files, which were previously detected as sh. A syntax file was added but no ftplugin, leaving commentstring empty. This breaks commenting (e.g. gc in Neovim, or any plugin relying on commentstring).

Changes

Sets comments=b:#, commentstring=#\ %s, and formatoptions-=t formatoptions+=croql, matching the options .env files previously inherited from the sh ftplugin.

Patch 9.2.0033 (vim#19260) introduced a dedicated `env` filetype for
.env files, which were previously detected as `sh`. This left env
files without `commentstring`, `comments`, or `formatoptions` since
no ftplugin was added alongside the new filetype.

Add runtime/ftplugin/env.vim to set these options, matching the
behavior that .env files had when they used the `sh` filetype.
@chrisbra
Copy link
Member

thanks

@chrisbra chrisbra closed this in 9148644 Feb 27, 2026
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 27, 2026
Patch 9.2.0033 (vim/vim#19260) introduced a dedicated `env` filetype for
.env files, which were previously detected as `sh`. This left env
files without `commentstring`, `comments`, or `formatoptions` since
no ftplugin was added alongside the new filetype.

Add runtime/ftplugin/env.vim to set these options, matching the
behavior that .env files had when they used the `sh` filetype.

closes: vim/vim#19522

vim/vim@9148644

Co-authored-by: snelling-a <[email protected]>
zeertzjq added a commit to neovim/neovim that referenced this pull request Feb 28, 2026
Patch 9.2.0033 (vim/vim#19260) introduced a dedicated `env` filetype for
.env files, which were previously detected as `sh`. This left env
files without `commentstring`, `comments`, or `formatoptions` since
no ftplugin was added alongside the new filetype.

Add runtime/ftplugin/env.vim to set these options, matching the
behavior that .env files had when they used the `sh` filetype.

closes: vim/vim#19522

vim/vim@9148644

Co-authored-by: snelling-a <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants