diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-28 18:28:56 +0200 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-09-28 18:28:56 +0200 | 
| commit | f431aee86e51cb416ee83f895526d0ea46e46e5e (patch) | |
| tree | 7ece8278b8ce20638584233c4c578b13913a8f65 | |
| parent | 6a086b0c797f703b713bc887b1a4cee5a70d01ec (diff) | |
| download | vim-polyglot-f431aee86e51cb416ee83f895526d0ea46e46e5e.tar.gz vim-polyglot-f431aee86e51cb416ee83f895526d0ea46e46e5e.zip | |
Change less provider, closes #567
Diffstat (limited to '')
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | ftplugin/less.vim | 22 | ||||
| -rw-r--r-- | indent/less.vim | 10 | ||||
| -rw-r--r-- | packages.yaml | 6 | ||||
| -rw-r--r-- | syntax/less.vim | 121 | 
5 files changed, 86 insertions, 75 deletions
| @@ -152,7 +152,7 @@ If you need full functionality of any plugin, please use it directly with your p  - [julia](https://github.com/JuliaEditorSupport/julia-vim)  - [kotlin](https://github.com/udalov/kotlin-vim)  - [ledger](https://github.com/ledger/vim-ledger) -- [less](https://github.com/groenewege/vim-less) +- [less](https://github.com/vim/vim/tree/master/runtime)  - [lilypond](https://github.com/anowlcalledjosh/vim-lilypond)  - [livescript](https://github.com/gkz/vim-ls)  - [llvm](https://github.com/rhysd/vim-llvm) diff --git a/ftplugin/less.vim b/ftplugin/less.vim index ecb060b9..2a8ff172 100644 --- a/ftplugin/less.vim +++ b/ftplugin/less.vim @@ -1,10 +1,10 @@  if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1  " Vim filetype plugin -" Language:	    LessCSS -" Author:	    Tim Pope <vimNOSPAM@tpope.org> -" Maintainer:   Leonard Ehrenfried <leonard.ehrenfried@web.de> -" Last Change:  2011 Sep 30 +" Language:	less +" Maintainer:	Alessandro Vioni <jenoma@gmail.com> +" URL: https://github.com/genoma/vim-less +" Last Change:	2014 November 24  " Only do this when not done yet for this buffer  if exists("b:did_ftplugin") @@ -14,17 +14,11 @@ let b:did_ftplugin = 1  let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" -setlocal iskeyword+=- -setlocal commentstring=//%s -setlocal define=^\\s*\\%(@mixin\\\|=\\) -setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') -setlocal omnifunc=csscomplete#CompleteCSS -setlocal suffixesadd=.less -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,:// -setlocal fo=croql +setlocal formatoptions-=t formatoptions+=croql -let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' +setlocal comments=:// commentstring=//\ %s -" vim:set sw=2: +setlocal omnifunc=csscomplete#CompleteCSS +setlocal suffixesadd=.less  endif diff --git a/indent/less.vim b/indent/less.vim index 61739f73..628f2ff3 100644 --- a/indent/less.vim +++ b/indent/less.vim @@ -1,13 +1,17 @@  if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1  " Vim indent file -" Language:            LessCSS -" Maintainer:        Leonard Ehrenfried <leonard.ehrenfried@web.de> -" Last Change:        2011 Sep 26 +" Language:	less +" Maintainer:	Alessandro Vioni <jenoma@gmail.com> +" URL: https://github.com/genoma/vim-less +" Last Change:	2014 November 24  if exists("b:did_indent")    finish  endif  runtime! indent/css.vim + +" vim:set sw=2: +  endif diff --git a/packages.yaml b/packages.yaml index 4796a1b5..855a2305 100644 --- a/packages.yaml +++ b/packages.yaml @@ -958,10 +958,8 @@ filetypes:    - journal  ---  name: less -remote: groenewege/vim-less -ignored_dirs: -# We don't want to slow down .html files -- after +remote: vim/vim:runtime +glob: '**/less.vim'  filetypes:  - name: less    linguist: Less diff --git a/syntax/less.vim b/syntax/less.vim index 3f497bc6..0b0c5373 100644 --- a/syntax/less.vim +++ b/syntax/less.vim @@ -1,68 +1,83 @@  if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1 +" Vim syntax file +" Language:	less +" Maintainer:	Alessandro Vioni <jenoma@gmail.com> +" URL: https://github.com/genoma/vim-less +" Last Change:	2014 November 24 +  if exists("b:current_syntax")    finish  endif  runtime! syntax/css.vim  runtime! after/syntax/css.vim -" load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax) -runtime! after/syntax/css/*.vim  syn case ignore -syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors fold - -syn match lessVariable "@[[:alnum:]_-]\+" contained -syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite -syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite -syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted - -syn match lessOperator "+" contained -syn match lessOperator "-" contained -syn match lessOperator "/" contained -syn match lessOperator "*" contained - -syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty -syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained - -syn match lessDefault "!default" contained - -syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass -syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass -syn match lessClass "[[:alnum:]_-]\+" contained - -" functions {{{ - -" string functions -syn keyword lessFunction escape e % containedin=cssDefinition contained -" misc functions -syn keyword lessFunction unit containedin=cssDefinition contained -" math functions -syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained -" color definition -syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained -" color channel information -syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained -" color operations -syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained -" color blending -syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained - -" }}} - -syn match lessComment "//.*$" contains=@Spell - -hi def link lessVariable Special -hi def link lessVariableValue Constant -hi def link lessDefault Special -hi def link lessComment Comment -hi def link lessFunction Function -hi def link lessMixinChar Special -hi def link lessAmpersandChar Special -hi def link lessNestedProperty Type -hi def link lessClass PreProc +syn cluster lessCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp +syn cluster lessCssAttributes contains=css.*Attr,lessEndOfLineComment,lessComment,cssValue.*,cssColor,cssURL,lessDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp + +syn region lessDefinition matchgroup=cssBraces start="{" end="}" contains=TOP + +syn match lessProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=lessCssAttribute contained containedin=lessDefinition +syn match lessProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute +syn match lessProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute +syn match lessCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@lessCssAttributes,lessVariable,lessFunction,lessInterpolation +syn match lessDefault "!default\>" contained + +" less variables and media queries +syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessCssAttribute skipwhite +syn match lessMedia "@media" nextgroup=lessCssAttribute skipwhite + +" Less functions +syn match lessFunction "\<\%(escape\|e\|unit\)\>(\@=" contained +syn match lessFunction "\<\%(ceil\|floor\|percentage\|round\|sqrt\|abs\|sin\|asin\|cos\|acos\|tan\|atan\|pi\|pow\|min\|max\)\>(\@=" contained +syn match lessFunction "\<\%(rgb\|rgba\|argb\|argb\|hsl\|hsla\|hsv\|hsva\)\>(\@=" contained +syn match lessFunction "\<\%(hue\|saturation\|lightness\|red\|green\|blue\|alpha\|luma\)\>(\@=" contained +syn match lessFunction "\<\%(saturate\|desaturate\|lighten\|darken\|fadein\|fadeout\|fade\|spin\|mix\|greyscale\|contrast\)\>(\@=" contained +syn match lessFunction "\<\%(multiply\|screen\|overlay\|softlight\|hardlight\|difference\|exclusion\|average\|negation\)\>(\@=" contained + +" Less id class visualization +syn match lessIdChar     "#[[:alnum:]_-]\@=" nextgroup=lessId,lessClassIdCall +syn match lessId         "[[:alnum:]_-]\+" contained +syn match lessClassIdCall  "[[:alnum:]_-]\+()" contained + +syn match lessClassChar  "\.[[:alnum:]_-]\@=" nextgroup=lessClass,lessClassCall +syn match lessClass      "[[:alnum:]_-]\+" contained +syn match lessClassCall  "[[:alnum:]_-]\+()" contained + +syn match lessAmpersand  "&" contains=lessIdChar,lessClassChar + +syn region lessInclude start="@import" end=";\|$" contains=lessComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ + +syn keyword lessTodo        FIXME NOTE TODO OPTIMIZE XXX contained +syn region  lessComment     start="^\z(\s*\)//"  end="^\%(\z1 \)\@!" contains=lessTodo,@Spell +syn region  lessCssComment  start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell +syn match   lessEndOfLineComment "//.*" contains=lessComment,lessTodo,@Spell + +hi def link lessEndOfLineComment        lessComment +hi def link lessCssComment              lessComment +hi def link lessComment                 Comment +hi def link lessDefault                 cssImportant +hi def link lessVariable                Identifier +hi def link lessFunction                PreProc +hi def link lessTodo                    Todo +hi def link lessInclude                 Include +hi def link lessIdChar                  Special +hi def link lessClassChar               Special +hi def link lessAmpersand               Character +hi def link lessId                      Identifier +hi def link lessClass                   Type +hi def link lessCssAttribute            PreProc +hi def link lessClassCall               Type +hi def link lessClassIdCall             Type +hi def link lessTagName                 cssTagName +hi def link lessDeprecated              cssDeprecated +hi def link lessMedia                   cssMedia  let b:current_syntax = "less" +" vim:set sw=2: +  endif | 
