mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
runtime/cabal: 23515b4ef7580af8b9d3b964a558ab2007cacda5
port cabal, cabalconfig, cabalproject syntax file
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
" Maintainer: Marcin Szamotulski <profunctor@pm.me>
|
" Maintainer: Marcin Szamotulski <profunctor@pm.me>
|
||||||
" Previous Maintainer: Vincent Berthoux <twinside@gmail.com>
|
" Previous Maintainer: Vincent Berthoux <twinside@gmail.com>
|
||||||
" File Types: .cabal
|
" File Types: .cabal
|
||||||
" Last Change: 3 Oct 2020
|
" Last Change: 21 Nov 2020
|
||||||
" v1.5: Incorporated changes from
|
" v1.5: Incorporated changes from
|
||||||
" https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim
|
" https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim
|
||||||
" Use `syn keyword` instead of `syn match`.
|
" Use `syn keyword` instead of `syn match`.
|
||||||
@@ -78,10 +78,13 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
|
|||||||
\ default-extensions
|
\ default-extensions
|
||||||
\ author
|
\ author
|
||||||
\ autogen-modules
|
\ autogen-modules
|
||||||
|
\ asm-sources
|
||||||
|
\ asm-options
|
||||||
\ branch
|
\ branch
|
||||||
\ bug-reports
|
\ bug-reports
|
||||||
\ build-depends
|
\ build-depends
|
||||||
\ build-tools
|
\ build-tools
|
||||||
|
\ build-tools-depends
|
||||||
\ build-type
|
\ build-type
|
||||||
\ buildable
|
\ buildable
|
||||||
\ c-sources
|
\ c-sources
|
||||||
@@ -89,33 +92,46 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
|
|||||||
\ category
|
\ category
|
||||||
\ cc-options
|
\ cc-options
|
||||||
\ copyright
|
\ copyright
|
||||||
|
\ cmm-sources
|
||||||
|
\ cmm-options
|
||||||
\ cpp-options
|
\ cpp-options
|
||||||
|
\ cxx-sources
|
||||||
\ data-dir
|
\ data-dir
|
||||||
\ data-files
|
\ data-files
|
||||||
\ default
|
\ default
|
||||||
|
\ default-extensions
|
||||||
\ description
|
\ description
|
||||||
\ executable
|
\ executable
|
||||||
\ exposed-modules
|
\ exposed-modules
|
||||||
\ exposed
|
\ exposed
|
||||||
\ extensions
|
\ extensions
|
||||||
\ extra-tmp-files
|
\ extra-bundled-libraries
|
||||||
\ extra-doc-files
|
\ extra-doc-files
|
||||||
|
\ extra-dynamic-library-flavours
|
||||||
|
\ extra-framework-dirs
|
||||||
|
\ extra-ghci-libraries
|
||||||
\ extra-lib-dirs
|
\ extra-lib-dirs
|
||||||
\ extra-libraries
|
\ extra-libraries
|
||||||
|
\ extra-library-flavours
|
||||||
\ extra-source-files
|
\ extra-source-files
|
||||||
\ exta-tmp-files
|
\ extra-tmp-files
|
||||||
\ for example
|
\ for example
|
||||||
\ frameworks
|
\ frameworks
|
||||||
\ ghc-options
|
\ ghc-options
|
||||||
\ ghc-prof-options
|
\ ghc-prof-options
|
||||||
\ ghc-shared-options
|
\ ghc-shared-options
|
||||||
|
\ ghcjs-options
|
||||||
|
\ ghcjs-prof-options
|
||||||
|
\ ghcjs-shared-options
|
||||||
\ homepage
|
\ homepage
|
||||||
|
\ hs-source-dir
|
||||||
\ hs-source-dirs
|
\ hs-source-dirs
|
||||||
\ hugs-options
|
\ hugs-options
|
||||||
\ import
|
\ import
|
||||||
\ include-dirs
|
\ include-dirs
|
||||||
\ includes
|
\ includes
|
||||||
\ install-includes
|
\ install-includes
|
||||||
|
\ js-sources
|
||||||
\ ld-options
|
\ ld-options
|
||||||
\ license
|
\ license
|
||||||
\ license-file
|
\ license-file
|
||||||
@@ -123,10 +139,13 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
|
|||||||
\ main-is
|
\ main-is
|
||||||
\ maintainer
|
\ maintainer
|
||||||
\ manual
|
\ manual
|
||||||
|
\ mixins
|
||||||
\ module
|
\ module
|
||||||
\ name
|
\ name
|
||||||
\ nhc98-options
|
\ nhc98-options
|
||||||
\ other-extensions
|
\ other-extensions
|
||||||
|
\ other-language
|
||||||
|
\ other-languages
|
||||||
\ other-modules
|
\ other-modules
|
||||||
\ package-url
|
\ package-url
|
||||||
\ pkgconfig-depends
|
\ pkgconfig-depends
|
||||||
|
30
runtime/syntax/cabalconfig.vim
Normal file
30
runtime/syntax/cabalconfig.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Cabal Config
|
||||||
|
" Maintainer: profunctor@pm.me
|
||||||
|
" Last Change: Marcin Szamotulski
|
||||||
|
" Original Author: Marcin Szamotulski
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match CabalConfigSection /^\S[[:alpha:]]\+\%(-[[:alpha:]]\+\)*[^:]*$/
|
||||||
|
syn region CabalConfigRegion matchgroup=CabalConfigKey start=/^\s*[[:alpha:]]\+\%(-[[:alpha:]]\+\)*:/ matchgroup=NONE end=/$/ contains=CabalConfigSeparator,CabalConfigKeyword,CabalConfigPath keepend
|
||||||
|
syn match CabalConfigComment /^\s*--.*$/
|
||||||
|
syn match CabalConfigValue /.*$/ contained
|
||||||
|
syn match CabalConfigKey /[[:alpha:]]\+\%(-[[:alpha:]]\+\)*\ze:/
|
||||||
|
syn keyword CabalConfigSeparator : contained
|
||||||
|
syn match CabalConfigVariable /\$[[:alpha:]]\+/
|
||||||
|
syn keyword CabalConfigKeyword True False ghc
|
||||||
|
syn match CabalConfigPath /\%([[:alpha:]]\+:\)\?\%(\/[[:print:]]\+\)\+/
|
||||||
|
|
||||||
|
hi def link CabalConfigComment Comment
|
||||||
|
hi def link CabalConfigSection Title
|
||||||
|
hi def link CabalConfigKey Statement
|
||||||
|
hi def link CabalConfigSeparator NonText
|
||||||
|
hi def link CabalConfigValue Normal
|
||||||
|
hi def link CabalConfigVariable Identifier
|
||||||
|
hi def link CabalConfigKeyword Keyword
|
||||||
|
hi def link CabalConfigPath Directory
|
||||||
|
|
||||||
|
let b:current_syntax = "cabal.config"
|
28
runtime/syntax/cabalproject.vim
Normal file
28
runtime/syntax/cabalproject.vim
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Cabal Project
|
||||||
|
" Maintainer: profunctor@pm.me
|
||||||
|
" Last Change: Marcin Szamotulski
|
||||||
|
" Original Author: Marcin Szamotulski
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match CabalProjectComment /^\s*--.*/ contains=@Spell
|
||||||
|
syn match CabalProjectField /^\w\%(\w\|-\)\+/ contains=@NoSpell
|
||||||
|
|
||||||
|
syn keyword CabalProjectBoolean true false True False
|
||||||
|
syn keyword CabalProjectCompiler ghc ghcjs jhc lhc uhc haskell-suite
|
||||||
|
syn match CabalProjectNat /\<\d\+\>/
|
||||||
|
syn keyword CabalProjectJobs $ncpus
|
||||||
|
syn keyword CabalProjectProfilingLevel default none exported-functions toplevel-functions all-functions
|
||||||
|
|
||||||
|
hi def link CabalProjectComment Comment
|
||||||
|
hi def link CabalProjectField Statement
|
||||||
|
hi def link CabalProjectBoolean Boolean
|
||||||
|
hi def link CabalProjectCompiler Identifier
|
||||||
|
hi def link CabalProjectNat Number
|
||||||
|
hi def link CabalProjectJobs Number
|
||||||
|
hi def link CabalProjectProfilingLevel Statement
|
||||||
|
|
||||||
|
let b:current_syntax = "cabal.project"
|
Reference in New Issue
Block a user