annotate runtime/ftplugin/liquid.vim @ 34591:19caff944d87 v9.1.0188

patch 9.1.0188: filetype: no support for Vento files Commit: https://github.com/vim/vim/commit/9f26e5a9bcedb3caef26e9d77849ea37a3626bbf Author: wrapperup <wrapperup4@gmail.com> Date: Tue Mar 19 18:06:22 2024 +0100 patch 9.1.0188: filetype: no support for Vento files Problem: Vento files are not recognized. Solution: Recognize *.vto files as filetype "vento" (wrapperup) Vento is a templating engine https://vento.js.org/ closes: #14229 Signed-off-by: wrapperup <wrapperup4@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Mar 2024 18:15:07 +0100
parents dce918af0c00
children 7c7432a53a6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: Liquid
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
28141
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
4 " Last Change: 2022 Mar 15
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
5
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6 if exists('b:did_ftplugin')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 finish
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 if !exists('g:liquid_default_subtype')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 let g:liquid_default_subtype = 'html'
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 if !exists('b:liquid_subtype')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 if b:liquid_subtype == ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18 let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 if b:liquid_subtype == ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 if b:liquid_subtype == ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 let b:liquid_subtype = g:liquid_default_subtype
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 if exists('b:liquid_subtype') && b:liquid_subtype != ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
29 exe 'runtime! ftplugin/'.b:liquid_subtype.'.vim ftplugin/'.b:liquid_subtype.'_*.vim ftplugin/'.b:liquid_subtype.'/*.vim'
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
30 else
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33 let b:did_ftplugin = 1
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
35 if exists('b:undo_ftplugin')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
36 let b:undo_ftplugin .= '|'
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 else
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 let b:undo_ftplugin = ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 if exists('b:browsefilter')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 let b:browsefilter = "\n".b:browsefilter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 else
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 let b:browsefilter = ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 if exists('b:match_words')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 let b:match_words .= ','
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 elseif exists('loaded_matchit')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48 let b:match_words = ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
49 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 if has('gui_win32')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 let b:browsefilter="Liquid Files (*.liquid)\t*.liquid" . b:browsefilter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 if exists('loaded_matchit')
28141
dce918af0c00 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 2202
diff changeset
56 let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,\<\(capture\|comment\|highlight\)\>:\<end\1\>'
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59 setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %}
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words'