diff options
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/dhall.vim | 14 | ||||
-rw-r--r-- | ftplugin/graphql.vim | 21 |
2 files changed, 34 insertions, 1 deletions
diff --git a/ftplugin/dhall.vim b/ftplugin/dhall.vim index 3e7c2d0a..d09f4c31 100644 --- a/ftplugin/dhall.vim +++ b/ftplugin/dhall.vim @@ -32,6 +32,20 @@ if exists('g:dhall_strip_whitespace') endif endif +function! DhallFormat() + let cursor = getpos('.') + exec 'silent %!dhall format' + call setpos('.', cursor) +endfunction + +if exists('g:dhall_format') + if g:dhall_format == 1 + augroup dhall + au BufWritePre *.dhall call DhallFormat() + augroup END + endif +endif + augroup dhall au BufNewFile,BufRead *.dhall setl shiftwidth=2 augroup END diff --git a/ftplugin/graphql.vim b/ftplugin/graphql.vim index e6c59d92..df6004fb 100644 --- a/ftplugin/graphql.vim +++ b/ftplugin/graphql.vim @@ -1,6 +1,25 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1 -" Vim filetype plugin +" Copyright (c) 2016-2019 Jon Parise <jon@indelible.org> +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to +" deal in the Software without restriction, including without limitation the +" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +" sell copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +" IN THE SOFTWARE. +" " Language: GraphQL " Maintainer: Jon Parise <jon@indelible.org> |