20 changed files with 484 additions and 2 deletions
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
if exists('b:dhall_ftplugin') |
||||
finish |
||||
endif |
||||
let b:dhall_ftplugin = 1 |
||||
|
||||
setlocal commentstring=--\ %s |
||||
|
||||
set smarttab |
||||
|
||||
if exists('g:dhall_use_ctags') |
||||
if g:dhall_use_ctags == 1 |
||||
autocmd BufWritePost *.dhall silent !ctags -R . |
||||
endif |
||||
endif |
||||
|
||||
function! StripTrailingWhitespace() |
||||
let myline=line('.') |
||||
let mycolumn = col('.') |
||||
exec 'silent %s/ *$//' |
||||
call cursor(myline, mycolumn) |
||||
endfunction |
||||
|
||||
if exists('g:dhall_strip_whitespace') |
||||
if g:dhall_strip_whitespace == 1 |
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace() |
||||
endif |
||||
endif |
||||
|
||||
function! DhallFormat() |
||||
let cursor = getpos('.') |
||||
exec 'normal! gg' |
||||
exec 'silent !dhall format ' . expand('%') |
||||
exec 'e' |
||||
call setpos('.', cursor) |
||||
endfunction |
||||
|
||||
if exists('g:dhall_format') |
||||
if g:dhall_format == 1 |
||||
au BufWritePost *.dhall call DhallFormat() |
||||
endif |
||||
endif |
||||
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2 |
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
|
||||
command! DockerBuild execute ":split term://DOCKER_BUILDKIT=1 docker build ." |
||||
command! DockerBuild execute ":split term://DOCKER_BUILDKIT=1 docker build -f % ." |
||||
command! DockerDive execute ":split term://dive " . expand("<cword>") |
||||
command! DockerRun execute ":split term://docker run -it " . expand("<cword>") |
||||
|
||||
|
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
hi diffAdded ctermfg=black ctermbg=157 |
||||
hi diffChanged ctermbg=229 |
||||
hi diffRemoved ctermfg=1 ctermbg=225 |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
Copyright Vanessa McHale (c) 2018 |
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
# dhall-vim |
||||
|
||||
This package provides syntax highlighting for |
||||
[Dhall](https://hackage.haskell.org/package/dhall), a configuration language. |
||||
|
||||
## Installation |
||||
|
||||
Using [vim-plug](https://github.com/junegunn/vim-plug): |
||||
|
||||
```vim |
||||
Plug 'vmchale/dhall-vim' |
||||
``` |
||||
## Screenshot |
||||
|
||||
 |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
" store and remove current syntax value |
||||
let old_syntax = b:current_syntax |
||||
unlet b:current_syntax |
||||
|
||||
syn include @dhall syntax/dhall.vim |
||||
unlet b:current_syntax |
||||
|
||||
syn region dhallBlock matchgroup=quasiQuote start=/\[\$\?staticDhallExpression|/ end=/|\]/ contains=@dhall |
||||
|
||||
hi def link quasiQuote Underlined |
||||
|
||||
" restore current syntax value |
||||
let b:current_syntax = old_syntax |
After Width: | Height: | Size: 128 KiB |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
*dhall* Dhall syntax highlighting for Vim |
||||
____ |
||||
===================================================================== |
||||
CONTENTS *DhallContents* |
||||
|
||||
1. Config ......................................... ❘DhallConfig❘ |
||||
2. License ....................................... ❘DhallLicense❘ |
||||
|
||||
====================================================================== |
||||
Section 1: Config *DhallConfig* |
||||
|
||||
---------------------------------------------------------------------- |
||||
*'g:dhall_use_ctags'* |
||||
Values: 0, 1 |
||||
Default: '' |
||||
|
||||
Generate tags file for vim on write, using universal ctags. > |
||||
let g:dhall_use_ctags=1 |
||||
< |
||||
|
||||
*'g:dhall_format'* |
||||
Values: 0, 1 |
||||
Default: '' |
||||
|
||||
Format Dhall files on write > |
||||
let g:dhall_format=1 |
||||
< |
||||
*'g:dhall_strip_whitespace'* |
||||
Values: 0, 1 |
||||
Default: '' |
||||
|
||||
To enable whitespace stripping > |
||||
let g:dhall_strip_whitespace=1 |
||||
< |
||||
|
||||
====================================================================== |
||||
Section 2: License *DhallLicense* |
||||
|
||||
This plugin is licensed under the BDS3 license. |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
autocmd BufNewFile,BufRead *.dhall set filetype=dhall |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
if exists('b:dhall_ftplugin') |
||||
finish |
||||
endif |
||||
let b:dhall_ftplugin = 1 |
||||
|
||||
setlocal commentstring=--\ %s |
||||
|
||||
set smarttab |
||||
|
||||
if exists('g:dhall_use_ctags') |
||||
if g:dhall_use_ctags == 1 |
||||
autocmd BufWritePost *.dhall silent !ctags -R . |
||||
endif |
||||
endif |
||||
|
||||
function! StripTrailingWhitespace() |
||||
let myline=line('.') |
||||
let mycolumn = col('.') |
||||
exec 'silent %s/ *$//' |
||||
call cursor(myline, mycolumn) |
||||
endfunction |
||||
|
||||
if exists('g:dhall_strip_whitespace') |
||||
if g:dhall_strip_whitespace == 1 |
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace() |
||||
endif |
||||
endif |
||||
|
||||
function! DhallFormat() |
||||
let cursor = getpos('.') |
||||
exec 'normal! gg' |
||||
exec 'silent !dhall format ' . expand('%') |
||||
exec 'e' |
||||
call setpos('.', cursor) |
||||
endfunction |
||||
|
||||
if exists('g:dhall_format') |
||||
if g:dhall_format == 1 |
||||
au BufWritePost *.dhall call DhallFormat() |
||||
endif |
||||
endif |
||||
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2 |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
scriptencoding utf-8 |
||||
|
||||
if exists('b:current_syntax') |
||||
finish |
||||
endif |
||||
|
||||
syntax match dhallInterpolation "\v\$\{([^\}]|\n)*\}" |
||||
syntax keyword dhallTodo TODO FIXME |
||||
syntax match dhallBrackets "[<>|]" |
||||
syntax match dhallOperator "+\|*\|#" |
||||
syntax match dhallOperator "//\|⫽" |
||||
syntax match dhallOperator "/\\\|∧" |
||||
syntax match dhallOperator "//\\\\\|⩓" |
||||
syntax match dhallNumber "\v[0-9]" |
||||
syntax match dhallNumber "\v\+[0-9]" |
||||
syntax match dhallIndex "\v\@[0-9]+" contains=dhallNumber |
||||
syntax match dhallLambda "∀\|λ\|→\|->\|\\" |
||||
syntax match dhallType "\v[A-Z][a-z0-9A-Z_]*" |
||||
syntax match dhallSpecialLabel "\v`[A-Z][a-z]*`" |
||||
syntax match dhallLabel "\v[A-Z][a-z]*/[a-z_][A-Za-z0-9\.\-]*" |
||||
syntax match dhallLabel "\v[a-z_][A-Za-z0-9\-]*" |
||||
syntax match dhallType "\v[a-zA-Z]+\.[A-Z][a-z0-9A-Z_]*" |
||||
syntax match dhallParens "(\|)\|\[\|\]\|," |
||||
syntax match dhallRecord "{\|}\|:" |
||||
syntax keyword dhallKeyword let in forall constructors if then else merge env as with |
||||
syntax match dhallEsc +\\["\\abfnrtv$/]+ |
||||
syntax match dhallSingleSpecial +'''+ |
||||
syntax match dhallSingleSpecial +''${+ |
||||
syntax match dhallComment '\v--.*$' contains=@Spell,dhallTodo |
||||
syntax region dhallMultilineComment start="{-" end="-}" contains=@Spell,dhallTodo,dhallMultilineComment |
||||
syntax match dhallUrl "https://[a-zA-Z0-9/.\-_\?\=\&]*" |
||||
syntax match dhallUrl "http://[a-zA-Z0-9/.\-_\?\=\&]*" |
||||
syntax match dhallUrl "/[a-zA-Z0-9/.\-_]*" |
||||
syntax match dhallUrl "\.\./[a-zA-Z0-9/.\-_]*" |
||||
syntax match dhallUrl "\./[a-zA-Z0-9/.\-_]*" |
||||
syntax region dhallString start=+''+ end=+''+ contains=@Spell,dhallInterpolation,dhallSingleSpecial |
||||
syntax region dhallString start=+"+ end=+"+ contains=dhallInterpolation,dhallEsc |
||||
syntax region dhallString start=+"/+ end=+"+ contains=dhallInterpolation,dhallEsc |
||||
syntax keyword dhallBool True False |
||||
syntax match dhallHash "sha256:[a-f0-9]+" |
||||
|
||||
highlight link dhallSingleSpecial Special |
||||
highlight link dhallIndex Special |
||||
highlight link dhallSpecialLabel Operator |
||||
highlight link dhallEsc Special |
||||
highlight link dhallInterpolation Special |
||||
highlight link dhallTodo Todo |
||||
highlight link dhallBrackets Operator |
||||
highlight link dhallBool Underlined |
||||
highlight link dhallUrl String |
||||
highlight link dhallOperator Operator |
||||
highlight link dhallNumber Number |
||||
highlight link dhallLambda Special |
||||
highlight link dhallString String |
||||
highlight link dhallLabel Identifier |
||||
highlight link dhallRecord Special |
||||
highlight link dhallKeyword Keyword |
||||
highlight link dhallType Structure |
||||
highlight link dhallParens Special |
||||
highlight link dhallComment Comment |
||||
highlight link dhallMultilineComment Comment |
||||
highlight link dhallHash Keyword |
||||
|
||||
let b:current_syntax = 'dhall' |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
" store and remove current syntax value |
||||
let old_syntax = b:current_syntax |
||||
unlet b:current_syntax |
||||
|
||||
syn include @dhall syntax/dhall.vim |
||||
unlet b:current_syntax |
||||
|
||||
syn region dhallBlock matchgroup=quasiQuote start=/\[\$\?staticDhallExpression|/ end=/|\]/ contains=@dhall |
||||
|
||||
hi def link quasiQuote Underlined |
||||
|
||||
" restore current syntax value |
||||
let b:current_syntax = old_syntax |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
../../+ftplugin/dhall.vim |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
../../+ftplugin/diff.vim |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
../../+ftplugin/git.vim |
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
scriptencoding utf-8 |
||||
|
||||
if exists('b:current_syntax') |
||||
finish |
||||
endif |
||||
|
||||
syntax match dhallInterpolation "\v\$\{([^\}]|\n)*\}" |
||||
syntax keyword dhallTodo TODO FIXME |
||||
syntax match dhallBrackets "[<>|]" |
||||
syntax match dhallOperator "+\|*\|#" |
||||
syntax match dhallOperator "//\|⫽" |
||||
syntax match dhallOperator "/\\\|∧" |
||||
syntax match dhallOperator "//\\\\\|⩓" |
||||
syntax match dhallNumber "\v[0-9]" |
||||
syntax match dhallNumber "\v\+[0-9]" |
||||
syntax match dhallIndex "\v\@[0-9]+" contains=dhallNumber |
||||
syntax match dhallLambda "∀\|λ\|→\|->\|\\" |
||||
syntax match dhallType "\v[A-Z][a-z0-9A-Z_]*" |
||||
syntax match dhallSpecialLabel "\v`[A-Z][a-z]*`" |
||||
syntax match dhallLabel "\v[A-Z][a-z]*/[a-z_][A-Za-z0-9\.\-]*" |
||||
syntax match dhallLabel "\v[a-z_][A-Za-z0-9\-]*" |
||||
syntax match dhallType "\v[a-zA-Z]+\.[A-Z][a-z0-9A-Z_]*" |
||||
syntax match dhallParens "(\|)\|\[\|\]\|," |
||||
syntax match dhallRecord "{\|}\|:" |
||||
syntax keyword dhallKeyword let in forall constructors if then else merge env as with |
||||
syntax match dhallEsc +\\["\\abfnrtv$/]+ |
||||
syntax match dhallSingleSpecial +'''+ |
||||
syntax match dhallSingleSpecial +''${+ |
||||
syntax match dhallComment '\v--.*$' contains=@Spell,dhallTodo |
||||
syntax region dhallMultilineComment start="{-" end="-}" contains=@Spell,dhallTodo,dhallMultilineComment |
||||
syntax match dhallUrl "https://[a-zA-Z0-9/.\-_\?\=\&]*" |
||||
syntax match dhallUrl "http://[a-zA-Z0-9/.\-_\?\=\&]*" |
||||
syntax match dhallUrl "/[a-zA-Z0-9/.\-_]*" |
||||
syntax match dhallUrl "\.\./[a-zA-Z0-9/.\-_]*" |
||||
syntax match dhallUrl "\./[a-zA-Z0-9/.\-_]*" |
||||
syntax region dhallString start=+''+ end=+''+ contains=@Spell,dhallInterpolation,dhallSingleSpecial |
||||
syntax region dhallString start=+"+ end=+"+ contains=dhallInterpolation,dhallEsc |
||||
syntax region dhallString start=+"/+ end=+"+ contains=dhallInterpolation,dhallEsc |
||||
syntax keyword dhallBool True False |
||||
syntax match dhallHash "sha256:[a-f0-9]+" |
||||
|
||||
highlight link dhallSingleSpecial Number |
||||
highlight link dhallIndex Number |
||||
highlight link dhallSpecialLabel Operator |
||||
highlight link dhallEsc Number |
||||
highlight link dhallInterpolation Statement |
||||
highlight link dhallTodo Todo |
||||
highlight link dhallBrackets Operator |
||||
highlight link dhallBool Boolean |
||||
highlight link dhallUrl Statement |
||||
highlight link dhallOperator Operator |
||||
highlight link dhallNumber Number |
||||
highlight link dhallLambda Number |
||||
highlight link dhallString String |
||||
highlight link dhallLabel Identifier |
||||
highlight link dhallRecord Number |
||||
highlight link dhallKeyword Function |
||||
highlight link dhallType Type |
||||
highlight link dhallParens Number |
||||
highlight link dhallComment Comment |
||||
highlight link dhallMultilineComment Comment |
||||
highlight link dhallHash Keyword |
||||
|
||||
let b:current_syntax = 'dhall' |
Loading…
Reference in new issue