mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-13 22:13:50 -05:00
Update
This commit is contained in:
@@ -5,6 +5,11 @@ if exists('b:did_ftplugin')
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" This file is loaded on 'ecrystal' filetype
|
||||
if &filetype !=# 'crystal'
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
@@ -76,6 +81,11 @@ if &l:ofu ==# ''
|
||||
setlocal omnifunc=crystal_lang#complete
|
||||
endif
|
||||
|
||||
if exists('AutoPairsLoaded')
|
||||
let b:AutoPairs = { '{%': '%}' }
|
||||
call extend(b:AutoPairs, g:AutoPairs, 'force')
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
|
||||
100
ftplugin/ecrystal.vim
Normal file
100
ftplugin/ecrystal.vim
Normal file
@@ -0,0 +1,100 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Define some defaults in case the included ftplugins don't set them.
|
||||
let s:comments = ''
|
||||
let s:shiftwidth = ''
|
||||
let s:undo_ftplugin = ''
|
||||
let s:browsefilter = 'All Files (*.*)\t*.*\n'
|
||||
let s:match_words = ''
|
||||
|
||||
call ecrystal#SetSubtype()
|
||||
|
||||
if b:ecrystal_subtype !=# ''
|
||||
exe 'runtime! ftplugin/'.b:ecrystal_subtype.'.vim ftplugin/'.b:ecrystal_subtype.'_*.vim ftplugin/'.b:ecrystal_subtype.'/*.vim'
|
||||
unlet! b:did_ftplugin
|
||||
|
||||
" Keep the comments for this filetype
|
||||
let s:comments = escape(&comments, ' \')
|
||||
|
||||
" Keep the shiftwidth for this filetype
|
||||
let s:shiftwidth = &shiftwidth
|
||||
|
||||
" Override our defaults if these were set by an included ftplugin.
|
||||
if exists('b:undo_ftplugin')
|
||||
let s:undo_ftplugin = b:undo_ftplugin
|
||||
unlet b:undo_ftplugin
|
||||
endif
|
||||
if exists('b:browsefilter')
|
||||
let s:browsefilter = b:browsefilter
|
||||
unlet b:browsefilter
|
||||
endif
|
||||
if exists('b:match_words')
|
||||
let s:match_words = b:match_words
|
||||
unlet b:match_words
|
||||
endif
|
||||
endif
|
||||
|
||||
runtime! ftplugin/crystal.vim ftplugin/crystal_*.vim ftplugin/crystal/*.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Combine the new set of values with those previously included.
|
||||
if exists('b:undo_ftplugin')
|
||||
let s:undo_ftplugin = b:undo_ftplugin . ' | ' . s:undo_ftplugin
|
||||
endif
|
||||
if exists ('b:browsefilter')
|
||||
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
|
||||
endif
|
||||
if exists('b:match_words')
|
||||
let s:match_words = b:match_words . ',' . s:match_words
|
||||
endif
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly eCrystal-related files
|
||||
if has('gui_win32')
|
||||
let b:browsefilter='eCrystal Files (*.ecr)\t*.ecr\n' . s:browsefilter
|
||||
endif
|
||||
|
||||
" Load the combined list of match_words for matchit.vim
|
||||
if exists('loaded_matchit')
|
||||
let b:match_words = s:match_words
|
||||
endif
|
||||
|
||||
" Define additional pairs for jiangmiao/auto-pairs
|
||||
if exists('AutoPairsLoaded')
|
||||
let b:AutoPairs = {
|
||||
\ '<%': '%>',
|
||||
\ '<%=': '%>',
|
||||
\ '<%#': '%>',
|
||||
\ '<%-': '-%>',
|
||||
\ '<%-=': '-%>',
|
||||
\ '<%-#': '-%>',
|
||||
\ }
|
||||
|
||||
call extend(b:AutoPairs, g:AutoPairs, 'force')
|
||||
endif
|
||||
|
||||
" Load the subtype's vim-endwise settings
|
||||
if exists('loaded_endwise') && b:ecrystal_subtype !=# ''
|
||||
exec 'doautocmd endwise FileType ' . b:ecrystal_subtype
|
||||
endif
|
||||
|
||||
" Start RagTag
|
||||
if exists('loaded_ragtag')
|
||||
call RagtagInit()
|
||||
endif
|
||||
|
||||
exec 'setlocal comments='.s:comments
|
||||
exec 'setlocal shiftwidth='.s:shiftwidth
|
||||
setlocal commentstring=<%#%s%>
|
||||
|
||||
setlocal suffixesadd=.ecr
|
||||
|
||||
let b:undo_ftplugin = 'setlocal comments< commentstring< shiftwidth<' .
|
||||
\ '| unlet! b:browsefilter b:match_words ' .
|
||||
\ '| unlet! b:AutoPairs ' .
|
||||
\ '| ' . s:undo_ftplugin
|
||||
|
||||
endif
|
||||
@@ -7,7 +7,6 @@ setlocal foldexpr=fish#Fold()
|
||||
setlocal formatoptions+=ron1
|
||||
setlocal formatoptions-=t
|
||||
setlocal include=\\v^\\s*\\.>
|
||||
setlocal iskeyword=@,48-57,-,_,.,/
|
||||
setlocal suffixesadd^=.fish
|
||||
|
||||
" Use the 'j' format option when available.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" Copyright (c) 2016-2019 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2020 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
|
||||
|
||||
@@ -30,8 +30,30 @@ if has("gui_win32")
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Look up keywords by Get-Help:
|
||||
" check for PowerShell Core in Windows, Linux or MacOS
|
||||
if executable('pwsh') | let s:pwsh_cmd = 'pwsh'
|
||||
" on Windows Subsystem for Linux, check for PowerShell Core in Windows
|
||||
elseif exists('$WSLENV') && executable('pwsh.exe') | let s:pwsh_cmd = 'pwsh.exe'
|
||||
" check for PowerShell <= 5.1 in Windows
|
||||
elseif executable('powershell.exe') | let s:pwsh_cmd = 'powershell.exe'
|
||||
endif
|
||||
|
||||
if exists('s:pwsh_cmd')
|
||||
if !has('gui_running') && executable('less') &&
|
||||
\ !(exists('$ConEmuBuild') && &term =~? '^xterm')
|
||||
" For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048
|
||||
command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
else
|
||||
command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
endif
|
||||
endif
|
||||
setlocal keywordprg=:GetHelp
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,6 @@ endfunction
|
||||
|
||||
vnoremap <buffer> K :call <SID>Racket_visual_doc()<cr>
|
||||
|
||||
nnoremap <buffer> <f9> :!racket -t %<cr>
|
||||
|
||||
"setl commentstring=;;%s
|
||||
setl commentstring=#\|\ %s\ \|#
|
||||
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'razor') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: LessCSS
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Last Change: 2011 Sep 30
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
:UltiSnipsAddFiletypes razor.html
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
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
|
||||
|
||||
"let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||
|
||||
" vim:set sw=2:
|
||||
|
||||
endif
|
||||
|
||||
@@ -123,7 +123,7 @@ command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
command! -bar -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
|
||||
47
ftplugin/svelte.vim
Normal file
47
ftplugin/svelte.vim
Normal file
@@ -0,0 +1,47 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'svelte') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: Svelte 3 (HTML/JavaScript)
|
||||
" Author: Evan Lecklider <evan@lecklider.com>
|
||||
" Maintainer: Evan Lecklide <evan@lecklider.com>
|
||||
" URL: https://github.com/evanleck/vim-svelte
|
||||
if (exists('b:did_ftplugin'))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Matchit support
|
||||
if exists('loaded_matchit') && !exists('b:match_words')
|
||||
let b:match_ignorecase = 0
|
||||
|
||||
" In order:
|
||||
"
|
||||
" 1. Svelte control flow keywords.
|
||||
" 2. Parens.
|
||||
" 3-5. HTML tags pulled from Vim itself.
|
||||
"
|
||||
" https://github.com/vim/vim/blob/5259275347667a90fb88d8ea74331f88ad68edfc/runtime/ftplugin/html.vim#L29-L35
|
||||
let b:match_words =
|
||||
\ '#\%(if\|await\|each\)\>:\:\%(else\|catch\|then\)\>:\/\%(if\|await\|each\)\>,' .
|
||||
\ '{:},' .
|
||||
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
|
||||
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
|
||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||
endif
|
||||
|
||||
" ALE fixing and linting.
|
||||
if exists('g:loaded_ale')
|
||||
if !exists('b:ale_fixers')
|
||||
let b:ale_fixers = ['eslint', 'prettier', 'prettier_standard']
|
||||
endif
|
||||
|
||||
if !exists('b:ale_linter_aliases')
|
||||
let b:ale_linter_aliases = ['css', 'javascript']
|
||||
endif
|
||||
|
||||
if !exists('b:ale_linters')
|
||||
let b:ale_linters = ['stylelint', 'eslint']
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -10,6 +10,10 @@ if exists("loaded_matchit") && !exists('b:tsx_match_words')
|
||||
\ : b:tsx_match_words
|
||||
endif
|
||||
|
||||
" Comment formatting
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
set suffixesadd+=.tsx
|
||||
|
||||
endif
|
||||
|
||||
@@ -37,7 +37,7 @@ endfunction
|
||||
command! -buffer -bar CCode call CCode()
|
||||
command! -buffer -bar ValaCodingStyle call ValaCodingStyle()
|
||||
|
||||
if get(g:, 'vala_syntax_folding_enabled', 1)
|
||||
if get(g:, 'vala_syntax_folding_enabled', 0)
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user