runtime(env): add ftplugin for env filetype#19522
Closed
snelling-a wants to merge 1 commit intovim:masterfrom
Closed
runtime(env): add ftplugin for env filetype#19522snelling-a wants to merge 1 commit intovim:masterfrom
snelling-a wants to merge 1 commit intovim:masterfrom
Conversation
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.
Member
|
thanks |
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
runtime/ftplugin/env.vimto setcommentstring,comments, andformatoptionsfor theenvfiletype.Problem
#19260 (patch 9.2.0033) introduced a dedicated
envfiletype for.envfiles, which were previously detected assh. A syntax file was added but no ftplugin, leavingcommentstringempty. This breaks commenting (e.g.gcin Neovim, or any plugin relying oncommentstring).Changes
Sets
comments=b:#,commentstring=#\ %s, andformatoptions-=t formatoptions+=croql, matching the options.envfiles previously inherited from theshftplugin.