Mercurial > vim
changeset 36215:52dc0671fcef v9.1.0749
patch 9.1.0749: filetype: http files not recognized
Commit: https://github.com/vim/vim/commit/de6c1d1182076b10212342fd2d441267fbe43a22
Author: Riley Bruins <ribru17@hotmail.com>
Date: Mon Sep 30 19:34:04 2024 +0200
patch 9.1.0749: filetype: http files not recognized
Problem: filetype: http files not recognized
Solution: detect '*.http' as http filetype, include
http filetype plugin (Riley Bruins)
Based on the specification found
[here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md)
closes: #15762
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 30 Sep 2024 19:45:15 +0200 |
parents | aaedadae8ca1 |
children | 81ea63c55cbe |
files | .github/MAINTAINERS runtime/filetype.vim runtime/ftplugin/http.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 5 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -178,6 +178,7 @@ runtime/ftplugin/hgcommit.vim @k-takata runtime/ftplugin/hlsplaylist.vim @avidseeker runtime/ftplugin/hog.vim @wtfbbqhax runtime/ftplugin/html.vim @dkearns +runtime/ftplugin/http.vim @ribru17 runtime/ftplugin/hyprlang.vim @ribru17 runtime/ftplugin/i3config.vim @hiqua runtime/ftplugin/icon.vim @dkearns
--- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1065,6 +1065,9 @@ au BufNewFile,BufRead init.trans,*/etc/t au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call dist#ft#FThtml() au BufNewFile,BufRead *.cshtml setf html +" HTTP request files +au BufNewFile,BufRead *.http setf http + " HTML with Ruby - eRuby au BufNewFile,BufRead *.erb,*.rhtml setf eruby
new file mode 100644 --- /dev/null +++ b/runtime/ftplugin/http.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: HTTP +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Sep 28 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<'
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -340,6 +340,7 @@ def s:GetFilenameChecks(): dict<list<str hostsaccess: ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'], # file.component.html should be HTML, not Angular, see #13594 html: ['file.html', 'file.htm', 'file.cshtml', 'file.component.html'], + http: ['file.http'], htmlm4: ['file.html.m4'], httest: ['file.htt', 'file.htb'], hurl: ['file.hurl'],