Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
liquid.vim63 linesDownload Raw Back to ftplugin
1" Vim filetype plugin2" Language:     Liquid3" Maintainer:   Tim Pope <vimNOSPAM@tpope.org>4" Last Change:	2022 Mar 155"             	2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')6 7if exists('b:did_ftplugin')8  finish9endif10 11if !exists('g:liquid_default_subtype')12  let g:liquid_default_subtype = 'html'13endif14 15if !exists('b:liquid_subtype')16  let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")17  let b:liquid_subtype = matchstr(s:lines,'liquid_subtype=\zs\w\+')18  if b:liquid_subtype == ''19    let b:liquid_subtype = matchstr(&filetype,'^liquid\.\zs\w\+')20  endif21  if b:liquid_subtype == ''22    let b:liquid_subtype = matchstr(substitute(expand('%:t'),'\c\%(\.liquid\)\+$','',''),'\.\zs\w\+$')23  endif24  if b:liquid_subtype == ''25    let b:liquid_subtype = g:liquid_default_subtype26  endif27endif28 29if exists('b:liquid_subtype') && b:liquid_subtype != ''30  exe 'runtime! ftplugin/'.b:liquid_subtype.'.vim ftplugin/'.b:liquid_subtype.'_*.vim ftplugin/'.b:liquid_subtype.'/*.vim'31else32  runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim33endif34let b:did_ftplugin = 135 36if exists('b:undo_ftplugin')37  let b:undo_ftplugin .= '|'38else39  let b:undo_ftplugin = ''40endif41if exists('b:browsefilter')42  let b:browsefilter = "\n".b:browsefilter43else44  let b:browsefilter = ''45endif46if exists('b:match_words')47  let b:match_words .= ','48elseif exists('loaded_matchit')49  let b:match_words = ''50endif51 52if has('gui_win32')53  let b:browsefilter="Liquid Files (*.liquid)\t*.liquid" . b:browsefilter54endif55 56if exists('loaded_matchit')57  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\>'58endif59 60setlocal commentstring={%\ comment\ %}\ %s\ {%\ endcomment\ %}61 62let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words'63 
codekingpro/portable-devtools · Team Ai