mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cea0d08a06 | ||
|
|
43085dc02f | ||
|
|
4d8423c962 | ||
|
|
e204a7223b | ||
|
|
7a0f2d974f | ||
|
|
15aeea662e | ||
|
|
d15651463a | ||
|
|
0c79dd3e73 | ||
|
|
4e95df7c7e | ||
|
|
31c55b85a0 | ||
|
|
199846c6d8 | ||
|
|
f95026252c | ||
|
|
4f3df59be7 | ||
|
|
26790941f6 |
15
README.md
15
README.md
@@ -10,7 +10,7 @@ A collection of language packs for Vim.
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->146<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->147<!--/Package Count--> packages it consists of.
|
||||
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
@@ -119,7 +119,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent)
|
||||
- [markdown](https://github.com/gabrielelana/vim-markdown) (syntax, autoload, ftplugin)
|
||||
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin)
|
||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
||||
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
||||
@@ -129,7 +129,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin)
|
||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (syntax, indent, compiler, ftplugin)
|
||||
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
||||
- [octave](https://github.com/McSinyx/vim-octave) (syntax, indent)
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
|
||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent)
|
||||
@@ -152,7 +152,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
||||
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax)
|
||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, autoload, ftplugin)
|
||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin)
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
||||
@@ -168,7 +168,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
|
||||
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
|
||||
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax)
|
||||
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax, ftplugin)
|
||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, autoload, ftplugin)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||
@@ -178,7 +178,8 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent)
|
||||
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
||||
@@ -204,7 +205,7 @@ Please make sure you have `syntax on` in your `.vimrc`, otherwise syntax files a
|
||||
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
||||
|
||||
```viml
|
||||
" ~/.vimrc
|
||||
" ~/.vimrc, declare this variable before polyglot is loaded
|
||||
let g:polyglot_disabled = ['css']
|
||||
```
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||
|
||||
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
||||
setlocal iskeyword+=-,.,*
|
||||
setlocal commentstring=--\ %s
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||
|
||||
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
|
||||
setlocal iskeyword+='
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris') == -1
|
||||
|
||||
setlocal iskeyword+='
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: JavaScript
|
||||
" Maintainer: vim-javascript community
|
||||
@@ -11,8 +12,10 @@ if exists('b:undo_ftplugin')
|
||||
else
|
||||
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
||||
endif
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim ftplugin file
|
||||
"
|
||||
@@ -44,4 +47,5 @@ augroup jsx_comment
|
||||
augroup end
|
||||
|
||||
setlocal suffixesadd+=.jsx
|
||||
|
||||
endif
|
||||
|
||||
5
after/ftplugin/javascriptreact.vim
Normal file
5
after/ftplugin/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||
|
||||
" Copyright (c) 2018 rhysd
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -472,4 +473,5 @@ endfunction
|
||||
if !exists(':LLI')
|
||||
command! -buffer -nargs=? -bar -complete=file LLI call <SID>run_lli(<f-args>)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
|
||||
if !exists('g:puppet_align_hashes')
|
||||
let g:puppet_align_hashes = 1
|
||||
endif
|
||||
@@ -6,4 +7,5 @@ endif
|
||||
if g:puppet_align_hashes
|
||||
inoremap <buffer> <silent> => =><Esc>:call puppet#align#AlignHashrockets()<CR>$a
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
" modified from html.vim
|
||||
" For matchit plugin
|
||||
|
||||
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||
@@ -22,4 +28,5 @@ augroup jsx_comment
|
||||
augroup end
|
||||
|
||||
setlocal suffixesadd+=.tsx
|
||||
|
||||
endif
|
||||
|
||||
5
after/ftplugin/typescriptreact.vim
Normal file
5
after/ftplugin/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Yaml
|
||||
" Author: Henrique Barcelos
|
||||
@@ -6,4 +7,5 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
" URL: https://github.com/hjpbarcelos
|
||||
setlocal autoindent sw=2 ts=2 expandtab
|
||||
" vim:set sw=2:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim indent file
|
||||
"
|
||||
@@ -20,7 +21,7 @@ if exists('s:did_indent')
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||
@@ -28,4 +29,5 @@ endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
endif
|
||||
|
||||
5
after/indent/javascriptreact.vim
Normal file
5
after/indent/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Objective-C
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
@@ -92,4 +93,5 @@ endfunction
|
||||
" Restore 'cpo' options
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim indent file
|
||||
"
|
||||
@@ -8,6 +9,10 @@ if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript')
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('b:did_indent')
|
||||
let s:did_indent = b:did_indent
|
||||
unlet b:did_indent
|
||||
@@ -21,7 +26,7 @@ if exists('s:did_indent')
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e,*<Return>,<>>,<<>,/
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetTypescriptIndent'))
|
||||
@@ -29,4 +34,5 @@ endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
endif
|
||||
|
||||
5
after/indent/typescriptreact.vim
Normal file
5
after/indent/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: C Additions
|
||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||
@@ -35,6 +36,19 @@ if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
|
||||
hi def link cCustomMemVar Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Highlight POSIX functions.
|
||||
" -----------------------------------------------------------------------------
|
||||
if exists('g:cpp_posix_standard') && g:cpp_posix_standard
|
||||
syn keyword cPOSIXFunction socket accept bind connect getsockname
|
||||
syn keyword cPOSIXFunction listen recv recvfrom recvmsg
|
||||
syn keyword cPOSIXFunction send sendto sendmsg setsockopt socketpair
|
||||
syn keyword cPOSIXFunction htonl htons ntohl ntohs
|
||||
syn keyword cPOSIXFunction inet_ntop inet_pton getaddrinfo
|
||||
syn keyword cPOSIXFunction poll select pselect
|
||||
hi def link cPOSIXFunction Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Source: aftersyntaxc.vim
|
||||
" -----------------------------------------------------------------------------
|
||||
@@ -303,4 +317,5 @@ hi def link cBoolean Boolean
|
||||
"hi def link cDelimiter Delimiter
|
||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||
"hi def link cBraces Delimiter
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax=b:current_syntax
|
||||
unlet b:current_syntax
|
||||
@@ -26,4 +27,5 @@ hi def link cjsxTagName Function
|
||||
hi def link cjsxEntity Statement
|
||||
hi def link cjsxEntityPunct Type
|
||||
hi def link cjsxAttribProperty Type
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: C++ Additions
|
||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||
@@ -632,21 +633,19 @@ syntax keyword cppSTLios unitbuf
|
||||
syntax keyword cppSTLios uppercase
|
||||
"syntax keyword cppSTLios ws
|
||||
syntax keyword cppSTLiterator back_insert_iterator
|
||||
syntax keyword cppSTLiterator bidirectional_iterator
|
||||
syntax keyword cppSTLiterator const_iterator
|
||||
syntax keyword cppSTLiterator const_reverse_iterator
|
||||
syntax keyword cppSTLiterator forward_iterator
|
||||
syntax keyword cppSTLiterator front_insert_iterator
|
||||
syntax keyword cppSTLiterator input_iterator
|
||||
syntax keyword cppSTLiterator insert_iterator
|
||||
syntax keyword cppSTLiterator istreambuf_iterator
|
||||
syntax keyword cppSTLiterator istream_iterator
|
||||
syntax keyword cppSTLiterator ostreambuf_iterator
|
||||
syntax keyword cppSTLiterator ostream_iterator
|
||||
syntax keyword cppSTLiterator iterator
|
||||
syntax keyword cppSTLiterator ostream_iterator
|
||||
syntax keyword cppSTLiterator output_iterator
|
||||
syntax keyword cppSTLiterator random_access_iterator
|
||||
syntax keyword cppSTLiterator raw_storage_iterator
|
||||
syntax keyword cppSTLiterator reverse_bidirectional_iterator
|
||||
syntax keyword cppSTLiterator move_iterator
|
||||
syntax keyword cppSTLiterator reverse_iterator
|
||||
syntax keyword cppSTLiterator_tag bidirectional_iterator_tag
|
||||
syntax keyword cppSTLiterator_tag forward_iterator_tag
|
||||
@@ -1592,6 +1591,8 @@ endif " C++14
|
||||
|
||||
|
||||
if !exists("cpp_no_cpp17")
|
||||
syntax keyword cppSTLnamespace pmr
|
||||
|
||||
" algorithm
|
||||
syntax keyword cppSTLfunction clamp
|
||||
syntax keyword cppSTLfunction for_each_n
|
||||
@@ -1984,87 +1985,278 @@ endif " C++17
|
||||
|
||||
|
||||
if !exists("cpp_no_cpp20")
|
||||
" type_traits
|
||||
syntax keyword cppSTLtype remove_cvref remove_cvref_t
|
||||
syntax keyword cppType char8_t
|
||||
syntax keyword cppStatement co_yield co_return co_await
|
||||
syntax keyword cppStorageClass consteval
|
||||
syntax keyword cppSTLnamespace ranges
|
||||
|
||||
" algorithm
|
||||
syntax keyword cppSTLfunction shift_left
|
||||
syntax keyword cppSTLfunction shift_right
|
||||
syntax keyword cppSTLfunction lexicographical_compare_three_way
|
||||
|
||||
" bit
|
||||
syntax keyword cppSTLcast bit_cast
|
||||
syntax keyword cppSTLfunction ispow2
|
||||
syntax keyword cppSTLfunction ceil2
|
||||
syntax keyword cppSTLfunction floor2
|
||||
syntax keyword cppSTLfunction log2p1
|
||||
syntax keyword cppSTLfunction rotl
|
||||
syntax keyword cppSTLfunction rotr
|
||||
syntax keyword cppSTLfunction countl_zero
|
||||
syntax keyword cppSTLfunction countl_one
|
||||
syntax keyword cppSTLfunction countr_zero
|
||||
syntax keyword cppSTLfunction countr_one
|
||||
syntax keyword cppSTLfunction popcount
|
||||
syntax keyword cppSTLtype endian
|
||||
|
||||
" compare
|
||||
syntax keyword cppSTLtype weak_equality
|
||||
syntax keyword cppSTLtype strong_equality
|
||||
syntax keyword cppSTLtype partial_ordering
|
||||
syntax keyword cppSTLtype weak_ordering
|
||||
syntax keyword cppSTLtype strong_ordering
|
||||
syntax keyword cppSTLtype common_comparison_category
|
||||
syntax keyword cppSTLtype compare_three_way_result
|
||||
syntax keyword cppSTLtype compare_three_way
|
||||
syntax keyword cppSTLtype strong_order
|
||||
syntax keyword cppSTLtype weak_order
|
||||
syntax keyword cppSTLtype parital_order
|
||||
syntax keyword cppSTLtype compare_strong_order_fallback
|
||||
syntax keyword cppSTLtype compare_weak_order_fallback
|
||||
syntax keyword cppSTLtype compare_parital_order_fallback
|
||||
syntax keyword cppSTLfunction is_eq
|
||||
syntax keyword cppSTLfunction is_neq
|
||||
syntax keyword cppSTLfunction is_lt
|
||||
syntax keyword cppSTLfunction is_lteq
|
||||
syntax keyword cppSTLfunction is_gt
|
||||
syntax keyword cppSTLfunction is_gteq
|
||||
|
||||
" format
|
||||
syntax keyword cppSTLtype formatter
|
||||
syntax keyword cppSTLtype basic_format_parse_context
|
||||
syntax keyword cppSTLtype format_parse_context
|
||||
syntax keyword cppSTLtype wformat_parse_context
|
||||
syntax keyword cppSTLtype basic_format_context
|
||||
syntax keyword cppSTLtype format_context
|
||||
syntax keyword cppSTLtype wformat_context
|
||||
syntax keyword cppSTLtype basic_format_arg
|
||||
syntax keyword cppSTLtype basic_format_args
|
||||
syntax keyword cppSTLtype format_args
|
||||
syntax keyword cppSTLtype wformat_args
|
||||
syntax keyword cppSTLtype format_args_t
|
||||
syntax keyword cppSTLtype format_error
|
||||
syntax keyword cppSTLfuntion format
|
||||
syntax keyword cppSTLfuntion format_to
|
||||
syntax keyword cppSTLfuntion format_to_n
|
||||
syntax keyword cppSTLfuntion formatted_size
|
||||
syntax keyword cppSTLfuntion vformat
|
||||
syntax keyword cppSTLfuntion vformat_to
|
||||
syntax keyword cppSTLfuntion visit_format_arg
|
||||
syntax keyword cppSTLfuntion make_format_args
|
||||
syntax keyword cppSTLfuntion make_wformat_args
|
||||
|
||||
" iterator
|
||||
syntax keyword cppSTLtype default_sentinel_t unreachable_sentinel_t
|
||||
syntax keyword cppSTLiterator common_iterator
|
||||
syntax keyword cppSTLiterator counted_iterator
|
||||
syntax keyword cppSTLiterator_tag contiguous_iterator_tag
|
||||
|
||||
" memory
|
||||
syntax keyword cppSTLfunction to_address
|
||||
syntax keyword cppSTLfunction assume_aligned
|
||||
syntax keyword cppSTLfunction make_unique_default_init
|
||||
syntax keyword cppSTLfunction allocate_shared_default_init
|
||||
|
||||
" source_location
|
||||
syntax keyword cppSTLtype source_location
|
||||
|
||||
" span
|
||||
syntax keyword cppSTLtype span
|
||||
syntax keyword cppSTLfunction as_bytes
|
||||
syntax keyword cppSTLfunction as_writable_bytes
|
||||
syntax keyword cppSTLconstant dynamic_extent
|
||||
|
||||
" syncstream
|
||||
syntax keyword cppSTLtype basic_syncbuf
|
||||
syntax keyword cppSTLtype basic_osyncstream
|
||||
syntax keyword cppSTLtype syncbuf
|
||||
syntax keyword cppSTLtype wsyncbuf
|
||||
syntax keyword cppSTLtype osyncstream
|
||||
syntax keyword cppSTLtype wosyncstream
|
||||
|
||||
" type_traits
|
||||
syntax keyword cppSTLtype remove_cvref remove_cvref_t
|
||||
syntax keyword cppSTLtype common_reference common_reference_t
|
||||
syntax keyword cppSTLfunction is_constant_evaluated
|
||||
syntax keyword cppSTLfunction is_pointer_interconvertible
|
||||
syntax keyword cppSTLfunction is_corresponding_member
|
||||
syntax keyword cppSTLtype is_nothrow_convertible
|
||||
syntax keyword cppSTLbool is_nothrow_convertible_v
|
||||
syntax keyword cppSTLtype is_layout_compatible
|
||||
syntax keyword cppSTLbool is_layout_compatible_v
|
||||
syntax keyword cppSTLtype is_bounded_array
|
||||
syntax keyword cppSTLbool is_bounded_array_v
|
||||
syntax keyword cppSTLtype is_unbounded_array
|
||||
syntax keyword cppSTLbool is_unbounded_array_v
|
||||
syntax keyword cppSTLtype is_pointer_interconvertible_base_of
|
||||
syntax keyword cppSTLbool is_pointer_interconvertible_base_of_v
|
||||
syntax keyword cppSTLtype has_strong_structural_equality
|
||||
syntax keyword cppSTLbool has_strong_structural_equality_v
|
||||
|
||||
" version
|
||||
" TODO
|
||||
endif
|
||||
|
||||
|
||||
if exists('g:cpp_concepts_highlight') && g:cpp_concepts_highlight
|
||||
if exists('g:cpp_concepts_highlight')
|
||||
syntax keyword cppStatement concept
|
||||
syntax keyword cppStorageClass requires
|
||||
syntax keyword cppSTLtype DefaultConstructible
|
||||
syntax keyword cppSTLtype MoveConstructible
|
||||
syntax keyword cppSTLtype CopyConstructible
|
||||
syntax keyword cppSTLtype MoveAssignable
|
||||
syntax keyword cppSTLtype CopyAssignable
|
||||
syntax keyword cppSTLtype Destructible
|
||||
syntax keyword cppSTLtype TriviallyCopyable
|
||||
syntax keyword cppSTLtype TrivialType
|
||||
syntax keyword cppSTLtype StandardLayoutType
|
||||
syntax keyword cppSTLtype PODType
|
||||
syntax keyword cppSTLtype EqualityComparable
|
||||
syntax keyword cppSTLtype LessThanComparable
|
||||
syntax keyword cppSTLtype Swappable
|
||||
syntax keyword cppSTLtype ValueSwappable
|
||||
syntax keyword cppSTLtype NullablePointer
|
||||
syntax keyword cppSTLtype Hash
|
||||
syntax keyword cppSTLtype Allocator
|
||||
syntax keyword cppSTLtype FunctionObject
|
||||
syntax keyword cppSTLtype Callable
|
||||
syntax keyword cppSTLtype Predicate
|
||||
syntax keyword cppSTLtype BinaryPredicate
|
||||
syntax keyword cppSTLtype Compare
|
||||
syntax keyword cppSTLtype Container
|
||||
syntax keyword cppSTLtype ReversibleContainer
|
||||
syntax keyword cppSTLtype AllocatorAwareContainer
|
||||
syntax keyword cppSTLtype SequenceContainer
|
||||
syntax keyword cppSTLtype ContiguousContainer
|
||||
syntax keyword cppSTLtype AssociativeContainer
|
||||
syntax keyword cppSTLtype UnorderedAssociativeContainer
|
||||
syntax keyword cppSTLtype DefaultInsertable
|
||||
syntax keyword cppSTLtype CopyInsertable
|
||||
syntax keyword cppSTLtype CopyInsertable
|
||||
syntax keyword cppSTLtype MoveInsertable
|
||||
syntax keyword cppSTLtype EmplaceConstructible
|
||||
syntax keyword cppSTLtype Erasable
|
||||
syntax keyword cppSTLtype Iterator
|
||||
syntax keyword cppSTLtype InputIterator
|
||||
syntax keyword cppSTLtype OutputIterator
|
||||
syntax keyword cppSTLtype ForwardIterator
|
||||
syntax keyword cppSTLtype BidirectionalIterator
|
||||
syntax keyword cppSTLtype RandomAccessIterator
|
||||
syntax keyword cppSTLtype ContiguousIterator
|
||||
syntax keyword cppSTLtype UnformattedInputFunction
|
||||
syntax keyword cppSTLtype FormattedInputFunction
|
||||
syntax keyword cppSTLtype UnformattedOutputFunction
|
||||
syntax keyword cppSTLtype FormattedOutputFunction
|
||||
syntax keyword cppSTLtype SeedSequence
|
||||
syntax keyword cppSTLtype UniformRandomBitGenerator
|
||||
syntax keyword cppSTLtype RandomNumberEngine
|
||||
syntax keyword cppSTLtype RandomNumberEngineAdaptor
|
||||
syntax keyword cppSTLtype RandomNumberDistribution
|
||||
syntax keyword cppSTLtype BasicLockable
|
||||
syntax keyword cppSTLtype Lockable
|
||||
syntax keyword cppSTLtype TimedLockable
|
||||
syntax keyword cppSTLtype Mutex
|
||||
syntax keyword cppSTLtype TimedMutex
|
||||
syntax keyword cppSTLtype SharedMutex
|
||||
syntax keyword cppSTLtype SharedTimedMutex
|
||||
syntax keyword cppSTLtype UnaryTypeTrait
|
||||
syntax keyword cppSTLtype BinaryTypeTrait
|
||||
syntax keyword cppSTLtype TransformationTrait
|
||||
syntax keyword cppSTLtype Clock
|
||||
syntax keyword cppSTLtype TrivialClock
|
||||
syntax keyword cppSTLtype CharTraits
|
||||
syntax keyword cppSTLtype pos_type
|
||||
syntax keyword cppSTLtype off_type
|
||||
syntax keyword cppSTLtype BitmaskType
|
||||
syntax keyword cppSTLtype NumericType
|
||||
syntax keyword cppSTLtype RegexTraits
|
||||
syntax keyword cppSTLtype LiteralType
|
||||
|
||||
if g:cpp_concepts_highlight == 1
|
||||
syntax keyword cppSTLconcept DefaultConstructible
|
||||
syntax keyword cppSTLconcept MoveConstructible
|
||||
syntax keyword cppSTLconcept CopyConstructible
|
||||
syntax keyword cppSTLconcept MoveAssignable
|
||||
syntax keyword cppSTLconcept CopyAssignable
|
||||
syntax keyword cppSTLconcept Destructible
|
||||
syntax keyword cppSTLconcept TriviallyCopyable
|
||||
syntax keyword cppSTLconcept TrivialType
|
||||
syntax keyword cppSTLconcept StandardLayoutType
|
||||
syntax keyword cppSTLconcept PODType
|
||||
syntax keyword cppSTLconcept EqualityComparable
|
||||
syntax keyword cppSTLconcept LessThanComparable
|
||||
syntax keyword cppSTLconcept Swappable
|
||||
syntax keyword cppSTLconcept ValueSwappable
|
||||
syntax keyword cppSTLconcept NullablePointer
|
||||
syntax keyword cppSTLconcept Hash
|
||||
syntax keyword cppSTLconcept Allocator
|
||||
syntax keyword cppSTLconcept FunctionObject
|
||||
syntax keyword cppSTLconcept Callable
|
||||
syntax keyword cppSTLconcept Predicate
|
||||
syntax keyword cppSTLconcept BinaryPredicate
|
||||
syntax keyword cppSTLconcept Compare
|
||||
syntax keyword cppSTLconcept Container
|
||||
syntax keyword cppSTLconcept ReversibleContainer
|
||||
syntax keyword cppSTLconcept AllocatorAwareContainer
|
||||
syntax keyword cppSTLconcept SequenceContainer
|
||||
syntax keyword cppSTLconcept ContiguousContainer
|
||||
syntax keyword cppSTLconcept AssociativeContainer
|
||||
syntax keyword cppSTLconcept UnorderedAssociativeContainer
|
||||
syntax keyword cppSTLconcept DefaultInsertable
|
||||
syntax keyword cppSTLconcept CopyInsertable
|
||||
syntax keyword cppSTLconcept CopyInsertable
|
||||
syntax keyword cppSTLconcept MoveInsertable
|
||||
syntax keyword cppSTLconcept EmplaceConstructible
|
||||
syntax keyword cppSTLconcept Erasable
|
||||
syntax keyword cppSTLconcept Iterator
|
||||
syntax keyword cppSTLconcept InputIterator
|
||||
syntax keyword cppSTLconcept OutputIterator
|
||||
syntax keyword cppSTLconcept ForwardIterator
|
||||
syntax keyword cppSTLconcept BidirectionalIterator
|
||||
syntax keyword cppSTLconcept RandomAccessIterator
|
||||
syntax keyword cppSTLconcept ContiguousIterator
|
||||
syntax keyword cppSTLconcept UnformattedInputFunction
|
||||
syntax keyword cppSTLconcept FormattedInputFunction
|
||||
syntax keyword cppSTLconcept UnformattedOutputFunction
|
||||
syntax keyword cppSTLconcept FormattedOutputFunction
|
||||
syntax keyword cppSTLconcept SeedSequence
|
||||
syntax keyword cppSTLconcept UniformRandomBitGenerator
|
||||
syntax keyword cppSTLconcept RandomNumberEngine
|
||||
syntax keyword cppSTLconcept RandomNumberEngineAdaptor
|
||||
syntax keyword cppSTLconcept RandomNumberDistribution
|
||||
syntax keyword cppSTLconcept BasicLockable
|
||||
syntax keyword cppSTLconcept Lockable
|
||||
syntax keyword cppSTLconcept TimedLockable
|
||||
syntax keyword cppSTLconcept Mutex
|
||||
syntax keyword cppSTLconcept TimedMutex
|
||||
syntax keyword cppSTLconcept SharedMutex
|
||||
syntax keyword cppSTLconcept SharedTimedMutex
|
||||
syntax keyword cppSTLconcept UnaryTypeTrait
|
||||
syntax keyword cppSTLconcept BinaryTypeTrait
|
||||
syntax keyword cppSTLconcept TransformationTrait
|
||||
syntax keyword cppSTLconcept Clock
|
||||
syntax keyword cppSTLconcept TrivialClock
|
||||
syntax keyword cppSTLconcept CharTraits
|
||||
syntax keyword cppSTLconcept pos_type
|
||||
syntax keyword cppSTLconcept off_type
|
||||
syntax keyword cppSTLconcept BitmaskType
|
||||
syntax keyword cppSTLconcept NumericType
|
||||
syntax keyword cppSTLconcept RegexTraits
|
||||
syntax keyword cppSTLconcept LiteralType
|
||||
elseif g:cpp_concepts_highlight == 2
|
||||
syntax keyword cppSTLconcept same_as
|
||||
syntax keyword cppSTLconcept derived_from
|
||||
syntax keyword cppSTLconcept convertible_to
|
||||
syntax keyword cppSTLconcept common_reference_with
|
||||
syntax keyword cppSTLconcept common_with
|
||||
syntax keyword cppSTLconcept integral
|
||||
syntax keyword cppSTLconcept signed_integral
|
||||
syntax keyword cppSTLconcept unsigned_integral
|
||||
syntax keyword cppSTLconcept assignable_from
|
||||
syntax keyword cppSTLconcept swappable
|
||||
syntax keyword cppSTLconcept swappable_with
|
||||
syntax keyword cppSTLconcept destructible
|
||||
syntax keyword cppSTLconcept constructible_from
|
||||
syntax keyword cppSTLconcept default_constructible
|
||||
syntax keyword cppSTLconcept move_constructible
|
||||
syntax keyword cppSTLconcept copy_constructible
|
||||
syntax keyword cppSTLconcept boolean
|
||||
syntax keyword cppSTLconcept equality_comparable
|
||||
syntax keyword cppSTLconcept equality_comparable_with
|
||||
syntax keyword cppSTLconcept totally_ordered
|
||||
syntax keyword cppSTLconcept totally_ordered_with
|
||||
syntax keyword cppSTLconcept movable
|
||||
syntax keyword cppSTLconcept copyable
|
||||
syntax keyword cppSTLconcept semiregular
|
||||
syntax keyword cppSTLconcept regular
|
||||
syntax keyword cppSTLconcept invocable
|
||||
syntax keyword cppSTLconcept regular_invocable
|
||||
syntax keyword cppSTLconcept predicate
|
||||
syntax keyword cppSTLconcept relation
|
||||
syntax keyword cppSTLconcept strict_weak_order
|
||||
syntax keyword cppSTLconcept readable
|
||||
syntax keyword cppSTLconcept writable
|
||||
syntax keyword cppSTLconcept weakly_incrementable
|
||||
syntax keyword cppSTLconcept incrementable
|
||||
syntax keyword cppSTLconcept input_or_output_iterator
|
||||
syntax keyword cppSTLconcept sentinal_for
|
||||
syntax keyword cppSTLconcept sized_sentinal_for
|
||||
syntax keyword cppSTLconcept input_iterator
|
||||
syntax keyword cppSTLconcept output_iterator
|
||||
syntax keyword cppSTLconcept forward_iterator
|
||||
syntax keyword cppSTLconcept bidirectional_iterator
|
||||
syntax keyword cppSTLconcept random_access_iterator
|
||||
syntax keyword cppSTLconcept input_iterator
|
||||
syntax keyword cppSTLconcept output_iterator
|
||||
syntax keyword cppSTLconcept bidirectional_iterator
|
||||
syntax keyword cppSTLconcept random_access_iterator
|
||||
syntax keyword cppSTLconcept contiguous_iterator
|
||||
syntax keyword cppSTLconcept indirectly_unary_invocable
|
||||
syntax keyword cppSTLconcept indirectly_regular_unary_invocable
|
||||
syntax keyword cppSTLconcept indirect_unary_predicate
|
||||
syntax keyword cppSTLconcept indirect_relation
|
||||
syntax keyword cppSTLconcept indirect_strict_weak_order
|
||||
syntax keyword cppSTLconcept indirectly_movable
|
||||
syntax keyword cppSTLconcept indirectly_movable_storable
|
||||
syntax keyword cppSTLconcept indirectly_copyable
|
||||
syntax keyword cppSTLconcept indirectly_copyable_storable
|
||||
syntax keyword cppSTLconcept indirectly_swappable
|
||||
syntax keyword cppSTLconcept indirectly_comparable
|
||||
syntax keyword cppSTLconcept permutable
|
||||
syntax keyword cppSTLconcept mergeable
|
||||
syntax keyword cppSTLconcept sortable
|
||||
syntax keyword cppSTLconcept range
|
||||
syntax keyword cppSTLconcept sized_range
|
||||
syntax keyword cppSTLconcept output_range
|
||||
syntax keyword cppSTLconcept input_range
|
||||
syntax keyword cppSTLconcept bidirectional_range
|
||||
syntax keyword cppSTLconcept random_access_range
|
||||
syntax keyword cppSTLconcept contiguous_range
|
||||
syntax keyword cppSTLconcept common_range
|
||||
syntax keyword cppSTLconcept viewable_range
|
||||
syntax keyword cppSTLconcept uniform_random_bit_generator
|
||||
endif
|
||||
endif " C++ concepts
|
||||
|
||||
|
||||
@@ -2094,10 +2286,12 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
||||
HiLink cppSTLiterator Typedef
|
||||
HiLink cppSTLiterator_tag Typedef
|
||||
HiLink cppSTLenum Typedef
|
||||
HiLink cppSTLconcept Typedef
|
||||
HiLink cppSTLios Function
|
||||
HiLink cppSTLcast Statement " be consistent with official syntax
|
||||
HiLink cppRawString String
|
||||
HiLink cppRawDelimiter Delimiter
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dhall') == -1
|
||||
|
||||
" store and remove current syntax value
|
||||
let old_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
@@ -12,4 +13,5 @@ hi def link quasiQuote Underlined
|
||||
|
||||
" restore current syntax value
|
||||
let b:current_syntax = old_syntax
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
||||
|
||||
" Extends standard help syntax with highlighting of Scala code.
|
||||
"
|
||||
" Place code between !sc! and !/sc! delimiters. These will be hidden if Vim is
|
||||
@@ -13,4 +14,5 @@ if has('conceal')
|
||||
else
|
||||
syntax region rgnScala matchgroup=Ignore start='!sc!' end='!/sc!' contains=@ScalaCode
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: HTML (version 5.1)
|
||||
" Last Change: 2017 Feb 15
|
||||
@@ -11,4 +12,5 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
" https://github.com/w3c/html/issues/694
|
||||
syntax region htmlComment start=+<!--+ end=+-->+ contains=@Spell
|
||||
syntax region htmlComment start=+<!DOCTYPE+ keepend end=+>+
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris') == -1
|
||||
|
||||
" This script allows for unicode concealing of certain characters
|
||||
" For instance -> goes to →
|
||||
"
|
||||
@@ -77,4 +78,5 @@ hi link idrNiceOperator Operator
|
||||
hi! link Conceal Operator
|
||||
setlocal conceallevel=2
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim syntax file
|
||||
"
|
||||
@@ -21,34 +22,31 @@ if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
if hlexists("jsNoise") " pangloss/vim-javascript
|
||||
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
|
||||
syntax cluster jsExpression add=jsxRegion
|
||||
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||
" refine the javascript line comment
|
||||
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
syntax cluster javascriptValue add=jsxRegion
|
||||
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
||||
|
||||
" add support to arrow function which returns a tagged template string, e.g.
|
||||
" () => html`<div></div>`
|
||||
syntax cluster afterArrowFunc add=javascriptTagRef
|
||||
else " build-in javascript syntax
|
||||
" refine the javascript line comment
|
||||
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
|
||||
" refine the template string syntax
|
||||
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
|
||||
|
||||
" add a javaScriptBlock group for build-in syntax
|
||||
syntax region javaScriptBlockBuildIn
|
||||
\ contained
|
||||
syntax region javaScriptBlock
|
||||
\ matchgroup=javaScriptBraces
|
||||
\ start="{"
|
||||
\ end="}"
|
||||
\ contained
|
||||
\ extend
|
||||
\ contains=javaScriptBlockBuildIn,@javaScriptEmbededExpr,javaScript.*
|
||||
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
|
||||
\ fold
|
||||
syntax cluster javaScriptEmbededExpr add=jsxRegion
|
||||
|
||||
" refine the template string syntax
|
||||
syntax region javaScriptStringT start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend
|
||||
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr,javaScript.*
|
||||
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
|
||||
endif
|
||||
|
||||
runtime syntax/jsx_pretty.vim
|
||||
@@ -57,4 +55,5 @@ let b:current_syntax = 'javascript.jsx'
|
||||
|
||||
let &cpo = s:jsx_cpo
|
||||
unlet s:jsx_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
@@ -22,4 +23,5 @@ hi def link graphqlTemplateExpression jsTemplateExpression
|
||||
|
||||
syn cluster jsExpression add=graphqlTaggedTemplate
|
||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||
|
||||
endif
|
||||
|
||||
5
after/syntax/javascriptreact.vim
Normal file
5
after/syntax/javascriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
|
||||
endif
|
||||
@@ -1,6 +1,13 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
||||
|
||||
" detect jsx region
|
||||
syntax region jsxRegion
|
||||
\ start=+\%(\%(\_[([,?:=+\-*/>{}]\|<\s\+\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\%(>\|\z(\%(script\|T\s*>\s*(\)\@!\<[_$A-Za-z][-:._$A-Za-z0-9]*\>\)\%(\_s*\%([-+*)\]}&|?,]\|/\%([/*]\|\_s*>\)\@!\)\)\@!\)+
|
||||
\ end=++
|
||||
\ contains=jsxElement
|
||||
|
||||
" <tag id="sample">
|
||||
" ~~~~~~~~~~~~~~~~~
|
||||
" and self close tag
|
||||
@@ -11,11 +18,14 @@ syntax region jsxTag
|
||||
\ matchgroup=jsxOpenPunct
|
||||
\ end=+>+
|
||||
\ matchgroup=NONE
|
||||
\ end=+\(/\_s*>\)\@=+
|
||||
\ end=+\%(/\_s*>\)\@=+
|
||||
\ contained
|
||||
\ contains=jsxOpenTag,jsxEscapeJs,jsxAttrib,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment,jsxSpreadOperator
|
||||
\ contains=jsxOpenTag,jsxAttrib,jsxExpressionBlock,jsxSpreadOperator,jsComment,@javascriptComments,javaScriptLineComment,javaScriptComment,typescriptLineComment,typescriptComment
|
||||
\ keepend
|
||||
\ extend
|
||||
\ skipwhite
|
||||
\ skipempty
|
||||
\ nextgroup=jsxCloseString
|
||||
|
||||
" <tag></tag>
|
||||
" ~~~~~~~~~~~
|
||||
@@ -26,30 +36,15 @@ syntax region jsxTag
|
||||
" <tag />
|
||||
" ~~~~~~~
|
||||
syntax region jsxElement
|
||||
\ start=+<\_s*\(>\|\${\|\z(\<[-:_\.\$0-9A-Za-z]\+\>\)\)+
|
||||
\ start=+<\_s*\%(>\|\${\|\z(\<[-:._$A-Za-z0-9]\+\>\)\)+
|
||||
\ end=+/\_s*>+
|
||||
\ end=+<\_s*/\_s*\z1\_s*>+
|
||||
\ contains=jsxElement,jsxEscapeJs,jsxTag,jsxComment,jsxCloseString,jsxCloseTag,@Spell
|
||||
\ contains=jsxElement,jsxTag,jsxExpressionBlock,jsxComment,jsxCloseTag,@Spell
|
||||
\ keepend
|
||||
\ extend
|
||||
\ contained
|
||||
\ fold
|
||||
|
||||
" detect jsx region
|
||||
syntax region jsxRegion
|
||||
\ start=+\(\(\_[([,?:=+\-*/<>{}]\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\(>\|\z(\(script\)\@!\<[_\$A-Za-z][-:_\.\$0-9A-Za-z]*\>\)\(\_s*\([-+*)\]}&|?]\|/\([/*]\|\_s*>\)\@!\)\)\@!\)+
|
||||
\ end=++
|
||||
\ contains=jsxElement
|
||||
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~~~~~~~~~~~~~~
|
||||
syntax region jsxEscapeJs
|
||||
\ start=+{+
|
||||
\ end=++
|
||||
\ extend
|
||||
\ contained
|
||||
\ contains=jsBlock,javascriptBlock,javaScriptBlockBuildIn,typescriptBlock
|
||||
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~~
|
||||
" and fragment start tag
|
||||
@@ -65,19 +60,31 @@ exe 'syntax region jsxOpenTag
|
||||
\ contains=jsxTagName
|
||||
\ nextgroup=jsxAttrib
|
||||
\ skipwhite
|
||||
\ skipempty ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
\ skipempty
|
||||
\ ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
|
||||
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~~~~~~~~~~~~~~
|
||||
syntax region jsxExpressionBlock
|
||||
\ matchgroup=jsxBraces
|
||||
\ start=+{+
|
||||
\ end=+}+
|
||||
\ contained
|
||||
\ extend
|
||||
\ contains=@jsExpression,jsSpreadExpression,@javascriptExpression,javascriptSpreadOp,@javaScriptEmbededExpr,@typescriptExpression,typescriptObjectSpread
|
||||
|
||||
" <foo.bar>
|
||||
" ~
|
||||
syntax match jsxDot +\.+ contained display
|
||||
syntax match jsxDot +\.+ contained
|
||||
|
||||
" <foo:bar>
|
||||
" ~
|
||||
syntax match jsxNamespace +:+ contained display
|
||||
syntax match jsxNamespace +:+ contained
|
||||
|
||||
" <tag id="sample">
|
||||
" ~
|
||||
syntax match jsxEqual +=+ contained display nextgroup=jsxString,jsxEscapeJs,jsxRegion skipwhite
|
||||
syntax match jsxEqual +=+ contained skipwhite skipempty nextgroup=jsxString,jsxExpressionBlock,jsxRegion
|
||||
|
||||
" <tag />
|
||||
" ~~
|
||||
@@ -98,13 +105,12 @@ syntax region jsxCloseTag
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~
|
||||
syntax match jsxAttrib
|
||||
\ +\<[-A-Za-z_][-:_\$0-9A-Za-z]*\>+
|
||||
\ +\<[_$A-Za-z][-:_$A-Za-z0-9]*\>+
|
||||
\ contained
|
||||
\ nextgroup=jsxEqual
|
||||
\ skipwhite
|
||||
\ skipempty
|
||||
\ contains=jsxAttribKeyword
|
||||
\ display
|
||||
\ contains=jsxAttribKeyword,jsxNamespace
|
||||
|
||||
" <MyComponent ...>
|
||||
" ~~~~~~~~~~~
|
||||
@@ -112,67 +118,71 @@ syntax match jsxAttrib
|
||||
" <someCamel ...>
|
||||
" ~~~~~
|
||||
exe 'syntax match jsxComponentName
|
||||
\ +\<[A-Z][\$0-9A-Za-z]\+\>+
|
||||
\ +\<[_$]\?[A-Z][-_$A-Za-z0-9]*\>+
|
||||
\ contained
|
||||
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
\ ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
|
||||
" <tag key={this.props.key}>
|
||||
" ~~~
|
||||
exe 'syntax match jsxTagName
|
||||
\ +\<[-:_\.\$0-9A-Za-z]\+\>+
|
||||
\ +\<[-:._$A-Za-z0-9]\+\>+
|
||||
\ contained
|
||||
\ contains=jsxComponentName,jsxDot,jsxNamespace
|
||||
\ nextgroup=jsxAttrib
|
||||
\ skipempty
|
||||
\ skipwhite
|
||||
\ display ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
\ ' .(s:highlight_close_tag ? 'transparent' : '')
|
||||
|
||||
" <tag id="sample">
|
||||
" ~~~~~~~~
|
||||
" and
|
||||
" <tag id='sample'>
|
||||
" ~~~~~~~~
|
||||
syntax region jsxString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ contained contains=@Spell display
|
||||
syntax region jsxString start=+\z(["']\)+ skip=+\\\\\|\\\z1\|\\\n+ end=+\z1+ contained contains=@Spell
|
||||
|
||||
let s:tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'raw'])
|
||||
let s:tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'jsx'])
|
||||
let s:enable_tagged_jsx = !empty(s:tags)
|
||||
|
||||
" add support to JSX inside the tagged template string
|
||||
" https://github.com/developit/htm
|
||||
if s:enable_tagged_jsx
|
||||
exe 'syntax region jsxTaggedRegion
|
||||
\ start=+\%('. join(s:tags, '\|') .'\)\@<=`+ms=s+1
|
||||
\ end=+`+me=e-1
|
||||
\ extend
|
||||
\ contained
|
||||
\ containedin=jsTemplateString,javascriptTemplate,javaScriptStringT,typescriptStringB
|
||||
\ contains=jsxElement'
|
||||
exe 'syntax match jsxRegion +\%(' . join(s:tags, '\|') . '\)\%(\_s*`\)\@=+ contains=jsTemplateStringTag,jsTaggedTemplate,javascriptTagRef skipwhite skipempty nextgroup=jsxTaggedRegion'
|
||||
|
||||
syntax region jsxEscapeJs
|
||||
\ start=+\${+
|
||||
\ end=++
|
||||
syntax region jsxTaggedRegion
|
||||
\ matchgroup=jsxBackticks
|
||||
\ start=+`+
|
||||
\ end=+`+
|
||||
\ extend
|
||||
\ contained
|
||||
\ contains=jsTemplateExpression,javascriptTemplateSubstitution,javaScriptEmbed,typescriptInterpolation
|
||||
\ contains=jsxElement,jsxExpressionBlock
|
||||
\ transparent
|
||||
|
||||
syntax region jsxExpressionBlock
|
||||
\ matchgroup=jsxBraces
|
||||
\ start=+\${+
|
||||
\ end=+}+
|
||||
\ extend
|
||||
\ contained
|
||||
\ contains=@jsExpression,jsSpreadExpression,@javascriptExpression,javascriptSpreadOp,@javaScriptEmbededExpr,@typescriptExpression,typescriptObjectSpread
|
||||
|
||||
syntax region jsxOpenTag
|
||||
\ matchgroup=jsxOpenPunct
|
||||
\ start=+<\%(\${\)\@=+
|
||||
\ matchgroup=NONE
|
||||
\ end=++
|
||||
\ end=+}\@1<=+
|
||||
\ contained
|
||||
\ contains=jsxEscapeJs
|
||||
\ nextgroup=jsxAttrib,jsxSpreadOperator
|
||||
\ contains=jsxExpressionBlock
|
||||
\ skipwhite
|
||||
\ skipempty
|
||||
\ nextgroup=jsxAttrib,jsxSpreadOperator
|
||||
|
||||
syntax keyword jsxAttribKeyword class contained display
|
||||
syntax keyword jsxAttribKeyword class contained
|
||||
|
||||
syntax match jsxSpreadOperator +\.\.\.+ contained display nextgroup=jsxEscapeJs skipwhite
|
||||
syntax match jsxSpreadOperator +\.\.\.+ contained nextgroup=jsxExpressionBlock skipwhite
|
||||
|
||||
syntax match jsxCloseTag +<//>+ display
|
||||
syntax match jsxCloseTag +<//>+ contained
|
||||
|
||||
syntax match jsxComment +<!--\_.\{-}-->+ display
|
||||
syntax match jsxComment +<!--\_.\{-}-->+
|
||||
endif
|
||||
|
||||
" Highlight the tag name
|
||||
@@ -182,10 +192,14 @@ highlight def link jsxComponentName Function
|
||||
|
||||
highlight def link jsxAttrib Type
|
||||
highlight def link jsxAttribKeyword jsxAttrib
|
||||
highlight def link jsxEqual Operator
|
||||
highlight def link jsxString String
|
||||
highlight def link jsxComment Comment
|
||||
|
||||
highlight def link jsxDot Operator
|
||||
highlight def link jsxNamespace Operator
|
||||
highlight def link jsxEqual Operator
|
||||
highlight def link jsxSpreadOperator Operator
|
||||
highlight def link jsxBraces Special
|
||||
|
||||
if s:highlight_close_tag
|
||||
highlight def link jsxCloseString Identifier
|
||||
@@ -200,9 +214,6 @@ highlight def link jsxPunct jsxCloseString
|
||||
highlight def link jsxClosePunct jsxPunct
|
||||
highlight def link jsxCloseTag jsxCloseString
|
||||
|
||||
highlight def link jsxComment Comment
|
||||
highlight def link jsxSpreadOperator Operator
|
||||
|
||||
let s:vim_jsx_pretty_colorful_config = get(g:, 'vim_jsx_pretty_colorful_config', 0)
|
||||
|
||||
if s:vim_jsx_pretty_colorful_config == 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||
|
||||
" Copyright (c) 2018 rhysd
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -21,4 +22,5 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'llvm') == -1
|
||||
|
||||
syn keyword llvmKeyword attributes
|
||||
syn match llvmNoName /#\d\+\>/
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mdx') == -1
|
||||
|
||||
|
||||
" based on mxw/vim-jsx
|
||||
|
||||
if exists('b:current_syntax')
|
||||
@@ -40,4 +41,5 @@ syn cluster jsExpression add=jsxRegion
|
||||
|
||||
" Allow jsxRegion to contain reserved words.
|
||||
syn cluster javascriptNoReserved add=jsxRegion
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mathematica') == -1
|
||||
|
||||
"Vim conceal file
|
||||
" Language: Mathematica
|
||||
" Maintainer: Voldikss <dyzplus@gmail.com>
|
||||
@@ -1445,4 +1446,5 @@ endif
|
||||
hi! link Conceal Normal
|
||||
setlocal conceallevel=2
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||
|
||||
" ARC type modifiers
|
||||
syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained
|
||||
|
||||
@@ -18,4 +19,5 @@ syn match objcDirective "@property\|@synthesize\|@dynamic\|@package"
|
||||
|
||||
" Highlight property attributes as if they were type modifiers
|
||||
hi def link objcPropertyAttribute objcTypeModifier
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'reason') == -1
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rspec') == -1
|
||||
|
||||
"
|
||||
" An rspec syntax file
|
||||
" Originally from http://www.vim.org/scripts/script.php?script_id=2286
|
||||
@@ -31,4 +32,5 @@ syntax keyword rspecMessageExpectation advise any_args any_number_of_times anyth
|
||||
highlight link rspecMessageExpectation Function
|
||||
|
||||
let b:current_syntax = 'rspec'
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yard') == -1
|
||||
|
||||
" Ruby syntax extensions for highlighting YARD documentation.
|
||||
"
|
||||
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
||||
@@ -125,4 +126,5 @@ hi def link yardParametricType yardComment
|
||||
hi def link yardArrow yardComment
|
||||
hi def link yardHashAngle yardComment
|
||||
hi def link yardHashCurly yardComment
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !get(g:, 'rust_conceal', 0) || !has('conceal') || &encoding !=# 'utf-8'
|
||||
@@ -40,4 +41,5 @@ if !get(g:, 'rust_conceal_mod_path', 0)
|
||||
endif
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1
|
||||
|
||||
" adds support for cleverref package
|
||||
" \Cref, \cref, \cpageref, \labelcref, \labelcpageref
|
||||
syn region texRefZone matchgroup=texStatement start="\\Cref{" end="}\|%stopzone\>" contains=@texRefGroup
|
||||
@@ -8,4 +9,5 @@ syn region texRefZone matchgroup=texStatement start="\\\(label\|\)c\(page\|\)re
|
||||
syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>"
|
||||
syn match texInputFile "\\lstinputlisting\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
|
||||
syn match texZone "\\lstinline\s*\(\[.*\]\)\={.\{-}}"
|
||||
|
||||
endif
|
||||
|
||||
28
after/syntax/tsx.vim
Normal file
28
after/syntax/tsx.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" GraphQL Support
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
syn include @GraphQLSyntax syntax/graphql.vim
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)'
|
||||
|
||||
exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend'
|
||||
exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString'
|
||||
|
||||
" Support expression interpolation ((${...})) inside template strings.
|
||||
syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=typescriptTemplateSubstitution containedin=graphqlFold keepend
|
||||
|
||||
hi def link graphqlTemplateString typescriptTemplate
|
||||
hi def link graphqlTemplateExpression typescriptTemplateSubstitution
|
||||
|
||||
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim syntax file
|
||||
"
|
||||
@@ -8,6 +9,10 @@ if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript')
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if get(g:, 'vim_jsx_pretty_disable_tsx', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:jsx_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
@@ -25,6 +30,12 @@ endif
|
||||
" refine the typescript line comment
|
||||
syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend
|
||||
|
||||
for syntax_name in ['tsxRegion', 'tsxFragment']
|
||||
if hlexists(syntax_name)
|
||||
exe 'syntax clear ' . syntax_name
|
||||
endif
|
||||
endfor
|
||||
|
||||
if !hlexists('typescriptTypeCast')
|
||||
" add a typescriptBlock group for typescript
|
||||
syntax region typescriptBlock
|
||||
@@ -45,4 +56,5 @@ let b:current_syntax = 'typescript.tsx'
|
||||
|
||||
let &cpo = s:jsx_cpo
|
||||
unlet s:jsx_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
@@ -21,4 +22,5 @@ hi def link graphqlTemplateExpression typescriptTemplateSubstitution
|
||||
|
||||
syn cluster typescriptExpression add=graphqlTaggedTemplate
|
||||
syn cluster graphqlTaggedTemplate add=graphqlTemplateString
|
||||
|
||||
endif
|
||||
|
||||
5
after/syntax/typescriptreact.vim
Normal file
5
after/syntax/typescriptreact.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
source <sfile>:h/typescript.vim
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" To make this file do stuff, add something like the following (without the
|
||||
" leading ") to your ~/.vimrc:
|
||||
" au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim
|
||||
@@ -60,4 +61,5 @@ hi link yamlInline Operator
|
||||
hi link yamlBlock Operator
|
||||
hi link yamlString String
|
||||
hi link yamlEscape Special
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Support for LaTex-to-Unicode conversion as in the Julia REPL "
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
@@ -649,4 +650,5 @@ function! LaTeXtoUnicode#Toggle()
|
||||
endif
|
||||
return
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rst') == -1
|
||||
|
||||
" Author: Antony Lee <anntzer.lee@gmail.com>
|
||||
" Description: Helper functions for reStructuredText syntax folding
|
||||
" Last Modified: 2018-12-29
|
||||
@@ -61,4 +62,5 @@ function RstFold#GetRstFoldText()
|
||||
let text = thisline =~ '^\([=`:.''"~^_*+#-]\)\1\+$' ? getline(v:foldstart + 1) : thisline
|
||||
return indent . text
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
function! cargo#Load()
|
||||
" Utility call to get this script loaded, for debugging
|
||||
endfunction
|
||||
|
||||
function! cargo#cmd(args)
|
||||
execute "! cargo" a:args
|
||||
" Trim trailing spaces. This is necessary since :terminal command parses
|
||||
" trailing spaces as an empty argument.
|
||||
let args = substitute(a:args, '\s\+$', '', '')
|
||||
if has('terminal')
|
||||
let cmd = 'terminal'
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal'
|
||||
else
|
||||
let cmd = '!'
|
||||
endif
|
||||
execute cmd 'cargo' args
|
||||
endfunction
|
||||
|
||||
function! s:nearest_cargo(...) abort
|
||||
@@ -114,4 +125,5 @@ function! cargo#runtarget(args)
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
function! cargo#quickfix#CmdPre() abort
|
||||
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo'
|
||||
" Preserve the current directory, and 'lcd' to the nearest Cargo file.
|
||||
@@ -25,4 +26,5 @@ function! cargo#quickfix#CmdPost() abort
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||
|
||||
" Vim completion script
|
||||
" Language: Clojure
|
||||
" Maintainer: Sung Pae <self@sungpae.com>
|
||||
@@ -21,4 +22,5 @@ function! clojurecomplete#Complete(findstart, base)
|
||||
endfunction
|
||||
|
||||
" vim:sts=8:sw=8:ts=8:noet
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Mick Koch <mick@kochm.co>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
@@ -53,4 +54,5 @@ function! coffee#CoffeeSetUpErrorFormat()
|
||||
\%f:%l:%c:\ error:\ %m,
|
||||
\%-G%.%#
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
@@ -76,10 +77,17 @@ function! crystal_lang#entrypoint_for(file_path) abort
|
||||
return a:file_path
|
||||
endif
|
||||
|
||||
let required_spec_path = get(b:, 'crystal_required_spec_path', get(g:, 'crystal_required_spec_path', ''))
|
||||
if required_spec_path !=# ''
|
||||
let require_spec_str = './' . required_spec_path
|
||||
else
|
||||
let require_spec_str = './spec/**'
|
||||
endif
|
||||
|
||||
let temp_name = root_dir . '/__vim-crystal-temporary-entrypoint-' . fnamemodify(a:file_path, ':t')
|
||||
let contents = [
|
||||
\ 'require "spec"',
|
||||
\ 'require "./spec/**"',
|
||||
\ 'require "' . require_spec_str . '"',
|
||||
\ printf('require "./%s"', fnamemodify(a:file_path, ':p')[strlen(root_dir)+1 : ])
|
||||
\ ]
|
||||
|
||||
@@ -339,4 +347,5 @@ endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'csv') == -1
|
||||
|
||||
" Filetype plugin for editing CSV files. "{{{1
|
||||
" Author: Christian Brabandt <cb@256bit.org>
|
||||
" Version: 0.31
|
||||
@@ -121,7 +122,7 @@ fu! csv#Init(start, end, ...) "{{{3
|
||||
" Enable vartabs for tab delimited files
|
||||
if b:delimiter=="\t" && has("vartabs")&& !exists("b:csv_fixed_width_cols")
|
||||
if get(b:, 'col_width', []) ==# []
|
||||
call csv#CalculateColumnWidth('')
|
||||
call csv#CalculateColumnWidth(line('$'))
|
||||
endif
|
||||
let &l:vts=join(b:col_width, ',')
|
||||
let g:csv_no_conceal=1
|
||||
@@ -573,7 +574,7 @@ fu! csv#MaxColumns(...) "{{{3
|
||||
return len(b:csv_fixed_width_cols)
|
||||
endif
|
||||
endfu
|
||||
fu! csv#ColWidth(colnr, ...) "{{{3
|
||||
fu! csv#ColWidth(colnr, row, silent) "{{{3
|
||||
" if a:1 is given, specifies the row, for which to calculate the width
|
||||
"
|
||||
" Return the width of a column
|
||||
@@ -585,16 +586,15 @@ fu! csv#ColWidth(colnr, ...) "{{{3
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
if !exists("b:csv_list")
|
||||
" only check first 10000 lines, to be faster
|
||||
let last = line('$')
|
||||
if exists("a:1") && !empty(a:1)
|
||||
let last = a:1
|
||||
endif
|
||||
let last = a:row
|
||||
if !get(b:, 'csv_arrange_use_all_rows', 0)
|
||||
if last > 10000
|
||||
let last = 10000
|
||||
if !a:silent
|
||||
call csv#Warn('File too large, only checking the first 10000 rows for the width')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let b:csv_list=getline(skipfirst+1,last)
|
||||
let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\')
|
||||
call filter(b:csv_list, 'v:val !~ pat')
|
||||
@@ -749,7 +749,7 @@ fu! csv#UnArrangeCol(match) "{{{3
|
||||
" Strip leading white space, also trims empty recordcsv#
|
||||
return substitute(a:match, '\%(^ \+\)\|\%( \+\ze'.b:delimiter. '\?$\)', '', 'g')
|
||||
endfu
|
||||
fu! csv#CalculateColumnWidth(row) "{{{3
|
||||
fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" Internal function, not called from external,
|
||||
" does not work with fixed width columns
|
||||
" row for the row for which to calculate the width
|
||||
@@ -762,7 +762,7 @@ fu! csv#CalculateColumnWidth(row) "{{{3
|
||||
endif
|
||||
let s:max_cols=csv#MaxColumns(line('.'))
|
||||
for i in range(1,s:max_cols)
|
||||
call add(b:col_width, csv#ColWidth(i, a:row))
|
||||
call add(b:col_width, csv#ColWidth(i, a:row, a:silent))
|
||||
endfor
|
||||
catch /csv:no_col/
|
||||
call csv#Warn("Error: getting Column numbers, aborting!")
|
||||
@@ -1052,7 +1052,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
let maxcol=csv#MaxColumns(line('.'))
|
||||
let cpos=getpos('.')[2]
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let curwidth=CSVWidth()
|
||||
let curwidth=CSVWidth(1)
|
||||
call search(b:col, 'bc', line('.'))
|
||||
endif
|
||||
let spos=getpos('.')[2]
|
||||
@@ -1145,7 +1145,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
" leave the column (if the next column is shorter)
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let a = getpos('.')
|
||||
if CSVWidth() == curwidth
|
||||
if CSVWidth(1) == curwidth
|
||||
let a[2]+= cpos-spos
|
||||
endif
|
||||
else
|
||||
@@ -1158,7 +1158,7 @@ fu! csv#MoveCol(forward, line, ...) "{{{3
|
||||
" Move to the correct screen column
|
||||
if !exists("b:csv_fixed_width_cols")
|
||||
let a = getpos('.')
|
||||
if CSVWidth() == curwidth
|
||||
if CSVWidth(1) == curwidth
|
||||
let a[2]+= cpos-spos
|
||||
endif
|
||||
else
|
||||
@@ -1834,7 +1834,7 @@ fu! csv#ProcessFieldValue(field) "{{{3
|
||||
|
||||
if a == b:delimiter
|
||||
try
|
||||
let a=repeat(' ', csv#ColWidth(col))
|
||||
let a=repeat(' ', csv#ColWidth(col, line('$'), 1))
|
||||
catch
|
||||
" no-op
|
||||
endtry
|
||||
@@ -2133,7 +2133,7 @@ fu! csv#NewRecord(line1, line2, count) "{{{3
|
||||
if !exists("b:col_width")
|
||||
" Best guess width
|
||||
if exists("b:csv_fixed_width_cols")
|
||||
let record .= printf("%*s", csv#ColWidth(item),
|
||||
let record .= printf("%*s", csv#ColWidth(item, line('$'), 1),
|
||||
\ b:delimiter)
|
||||
else
|
||||
let record .= printf("%20s", b:delimiter)
|
||||
@@ -3144,7 +3144,9 @@ fu! CSVCount(col, fmt, first, last, ...) "{{{3
|
||||
unlet! s:additional['distinct']
|
||||
return (empty(result) ? 0 : result)
|
||||
endfu
|
||||
fu! CSVWidth() "{{{3
|
||||
fu! CSVWidth(...) "{{{3
|
||||
" do not output any warning
|
||||
let silent = get(a:000, 0, 1)
|
||||
" does not work with fixed width columns
|
||||
if exists("b:csv_fixed_width_cols")
|
||||
let c = getline(1,'$')
|
||||
@@ -3163,7 +3165,7 @@ fu! CSVWidth() "{{{3
|
||||
" Add width for last column
|
||||
call add(width, max-y+1)
|
||||
else
|
||||
call csv#CalculateColumnWidth('')
|
||||
call csv#CalculateColumnWidth(line('$'), silent)
|
||||
let width=map(copy(b:col_width), 'v:val-1')
|
||||
endif
|
||||
return width
|
||||
@@ -3186,4 +3188,5 @@ endfun
|
||||
|
||||
" Vim Modeline " {{{2
|
||||
" vim: set foldmethod=marker et sw=0 sts=-1 ts=4:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
|
||||
function! s:error(text) abort
|
||||
echohl Error
|
||||
echomsg printf('[dart-vim-plugin] %s', a:text)
|
||||
@@ -27,17 +28,22 @@ function! s:clearQfList(reason) abort
|
||||
endfunction
|
||||
|
||||
function! dart#fmt(q_args) abort
|
||||
if executable('dartfmt')
|
||||
let buffer_content = join(getline(1, '$'), "\n")
|
||||
let cmd = s:FindDartFmt()
|
||||
if type(cmd) != type('') | return | endif
|
||||
let buffer_content = getline(1, '$')
|
||||
let args = '--stdin-name '.expand('%').' '.a:q_args
|
||||
let joined_lines = system(printf('dartfmt %s', args), buffer_content)
|
||||
if buffer_content ==# joined_lines[:-2]
|
||||
let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n"))
|
||||
" TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the
|
||||
" tool no longer emits this line on SDK upgrades.
|
||||
if lines[-1] ==# 'Isolate creation failed'
|
||||
let lines = lines[:-2]
|
||||
endif
|
||||
if buffer_content == lines
|
||||
call s:clearQfList('dartfmt')
|
||||
return
|
||||
endif
|
||||
if 0 == v:shell_error
|
||||
let win_view = winsaveview()
|
||||
let lines = split(joined_lines, "\n")
|
||||
silent keepjumps call setline(1, lines)
|
||||
if line('$') > len(lines)
|
||||
silent keepjumps execute string(len(lines)+1).',$ delete'
|
||||
@@ -45,43 +51,33 @@ function! dart#fmt(q_args) abort
|
||||
call winrestview(win_view)
|
||||
call s:clearQfList('dartfmt')
|
||||
else
|
||||
let errors = split(joined_lines, "\n")[2:]
|
||||
let errors = lines[2:]
|
||||
let error_format = '%Aline %l\, column %c of %f: %m,%C%.%#'
|
||||
call s:cexpr(error_format, errors, 'dartfmt')
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartfmt')
|
||||
endfunction
|
||||
|
||||
function! s:FindDartFmt() abort
|
||||
if executable('dartfmt') | return 'dartfmt' | endif
|
||||
if executable('flutter')
|
||||
let l:flutter_cmd = resolve(exepath('flutter'))
|
||||
let l:bin = fnamemodify(l:flutter_cmd, ':h')
|
||||
let l:dartfmt = l:bin.'/cache/dart-sdk/bin/dartfmt'
|
||||
if executable(l:dartfmt) | return l:dartfmt | endif
|
||||
endif
|
||||
call s:error('Cannot find a `dartfmt` command')
|
||||
endfunction
|
||||
|
||||
function! dart#analyzer(q_args) abort
|
||||
if executable('dartanalyzer')
|
||||
let path = expand('%:p:gs:\:/:')
|
||||
if filereadable(path)
|
||||
let command = printf('dartanalyzer %s %s', a:q_args, shellescape(path))
|
||||
let lines = systemlist(command)
|
||||
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dartanalyzer')
|
||||
else
|
||||
call s:error(printf('cannot read a file: "%s"', path))
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartanalyzer')
|
||||
endif
|
||||
call s:error('DartAnalyzer support has been removed. '.
|
||||
\'If this broke your workflow please comment on '.
|
||||
\'https://github.com/dart-lang/dart-vim-plugin/issues/89')
|
||||
endfunction
|
||||
|
||||
function! dart#tojs(q_args) abort
|
||||
if executable('dart2js')
|
||||
let path = expand('%:p:gs:\:/:')
|
||||
if filereadable(path)
|
||||
let command = printf('dart2js %s %s', a:q_args, shellescape(path))
|
||||
let lines = systemlist(command)
|
||||
call s:cexpr('%m (%f\, line %l\, col %c)', lines, 'dart2js')
|
||||
else
|
||||
call s:error(printf('cannot read a file: "%s"', path))
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartanalyzer')
|
||||
endif
|
||||
call s:error('Dart2JS support has been removed. '.
|
||||
\'If this broke your workflow please comment on '.
|
||||
\'https://github.com/dart-lang/dart-vim-plugin/issues/89')
|
||||
endfunction
|
||||
|
||||
" Finds the path to `uri`.
|
||||
@@ -183,4 +179,5 @@ function! dart#setModifiable() abort
|
||||
setlocal nomodifiable
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
let s:path = expand('<sfile>:h')
|
||||
let s:cmd = join(['mix', 'run', '--no-start', '--no-compile', shellescape(s:path.'/get_repos.exs')])
|
||||
|
||||
@@ -19,4 +20,5 @@ endfunction
|
||||
function! db#adapter#ecto#complete_opaque(url) abort
|
||||
return map(s:repo_list(), 'v:val[0]')
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
if !exists("g:elixir_indent_max_lookbehind")
|
||||
let g:elixir_indent_max_lookbehind = 30
|
||||
endif
|
||||
@@ -360,4 +361,5 @@ function! elixir#indent#handle_inside_generic_block(context)
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
function! elixir#util#get_filename(word) abort
|
||||
let word = a:word
|
||||
|
||||
@@ -23,4 +24,5 @@ function! elixir#util#get_filename(word) abort
|
||||
|
||||
return word
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
let s:errors = []
|
||||
|
||||
function! s:elmOracle(...) abort
|
||||
@@ -380,4 +381,5 @@ function! s:ExecuteInRoot(cmd) abort
|
||||
|
||||
return l:out
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
" IsWin returns 1 if current OS is Windows or 0 otherwise
|
||||
fun! elm#util#IsWin() abort
|
||||
let l:win = ['win16', 'win32', 'win32unix', 'win64', 'win95']
|
||||
@@ -179,4 +180,5 @@ function! s:error(msg)
|
||||
echohl NONE
|
||||
let v:errmsg = a:msg
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||
|
||||
function! fish#Indent()
|
||||
let l:shiftwidth = shiftwidth()
|
||||
let l:prevlnum = prevnonblank(v:lnum - 1)
|
||||
@@ -66,4 +67,5 @@ endfunction
|
||||
function! fish#errorformat()
|
||||
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
" don't spam the user when Vim is started in Vi compatibility mode
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
@@ -206,9 +207,10 @@ endfunction
|
||||
|
||||
function! go#config#DebugWindows() abort
|
||||
return get(g:, 'go_debug_windows', {
|
||||
\ 'stack': 'leftabove 20vnew',
|
||||
\ 'out': 'botright 10new',
|
||||
\ 'vars': 'leftabove 30vnew',
|
||||
\ 'stack': 'leftabove 20new',
|
||||
\ 'goroutines': 'botright 10new',
|
||||
\ 'out': 'botright 5new',
|
||||
\ }
|
||||
\ )
|
||||
|
||||
@@ -259,7 +261,7 @@ function! go#config#SetTemplateAutocreate(value) abort
|
||||
endfunction
|
||||
|
||||
function! go#config#MetalinterCommand() abort
|
||||
return get(g:, "go_metalinter_command", "gometalinter")
|
||||
return get(g:, "go_metalinter_command", "golangci-lint")
|
||||
endfunction
|
||||
|
||||
function! go#config#MetalinterAutosaveEnabled() abort
|
||||
@@ -351,7 +353,7 @@ function! go#config#FmtCommand() abort
|
||||
endfunction
|
||||
|
||||
function! go#config#FmtOptions() abort
|
||||
return get(g:, "go_fmt_options", {})
|
||||
return get(b:, "go_fmt_options", get(g:, "go_fmt_options", {}))
|
||||
endfunction
|
||||
|
||||
function! go#config#FmtFailSilently() abort
|
||||
@@ -366,6 +368,11 @@ function! go#config#PlayOpenBrowser() abort
|
||||
return get(g:, "go_play_open_browser", 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#RenameCommand() abort
|
||||
" delegate to go#config#GorenameBin for backwards compatability.
|
||||
return get(g:, "go_rename_command", go#config#GorenameBin())
|
||||
endfunction
|
||||
|
||||
function! go#config#GorenameBin() abort
|
||||
return get(g:, "go_gorename_bin", "gorename")
|
||||
endfunction
|
||||
@@ -461,6 +468,14 @@ function! go#config#HighlightVariableDeclarations() abort
|
||||
return get(g:, 'go_highlight_variable_declarations', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#HighlightDiagnosticErrors() abort
|
||||
return get(g:, 'go_highlight_diagnostic_errors', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#HighlightDiagnosticWarnings() abort
|
||||
return get(g:, 'go_highlight_diagnostic_warnings', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#HighlightDebug() abort
|
||||
return get(g:, 'go_highlight_debug', 1)
|
||||
endfunction
|
||||
@@ -480,6 +495,35 @@ function! go#config#CodeCompletionEnabled() abort
|
||||
return get(g:, "go_code_completion_enabled", 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#Updatetime() abort
|
||||
let go_updatetime = get(g:, 'go_updatetime', 800)
|
||||
return go_updatetime == 0 ? &updatetime : go_updatetime
|
||||
endfunction
|
||||
|
||||
function! go#config#ReferrersMode() abort
|
||||
return get(g:, 'go_referrers_mode', 'gopls')
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsCompleteUnimported() abort
|
||||
return get(g:, 'go_gopls_complete_unimported', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsDeepCompletion() abort
|
||||
return get(g:, 'go_gopls_deep_completion', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsFuzzyMatching() abort
|
||||
return get(g:, 'go_gopls_fuzzy_matching', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsUsePlaceholders() abort
|
||||
return get(g:, 'go_gopls_use_placeholders', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsEnabled() abort
|
||||
return get(g:, 'go_gopls_enabled', 1)
|
||||
endfunction
|
||||
|
||||
" Set the default value. A value of "1" is a shortcut for this, for
|
||||
" compatibility reasons.
|
||||
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1
|
||||
@@ -491,4 +535,5 @@ let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
|
||||
" Vim plugin
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
@@ -11,4 +12,5 @@ let g:autoloaded_graphql = 1
|
||||
function! graphql#javascript_tags() abort
|
||||
return get(g:, 'graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim completion script
|
||||
" Language: HTML and XHTML
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
@@ -840,4 +841,5 @@ function! htmlcomplete#CheckDoctype() " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
" vim:set foldmethod=marker:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
function! jsx_pretty#comment#update_commentstring(original)
|
||||
let syn_current = s:syn_name(line('.'), col('.'))
|
||||
let syn_start = s:syn_name(line('.'), 1)
|
||||
@@ -36,4 +37,5 @@ function! s:syn_contains(lnum, cnum, syn_name)
|
||||
let syn_names = map(stack, 'synIDattr(v:val, "name")')
|
||||
return index(syn_names, a:syn_name) >= 0
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
if exists('*shiftwidth')
|
||||
function! s:sw()
|
||||
return shiftwidth()
|
||||
@@ -9,208 +10,297 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Get the syntax group of start of line
|
||||
function! s:syn_sol(lnum)
|
||||
let line = getline(a:lnum)
|
||||
let sol = matchstr(line, '^\s*')
|
||||
return map(synstack(a:lnum, len(sol) + 1), 'synIDattr(v:val, "name")')
|
||||
" Regexp for the start tag
|
||||
let s:start_tag = '<\_s*\%(>\|\${\|\%(\<[-:._$A-Za-z0-9]\+\>\)\)'
|
||||
" Regexp for the end tag
|
||||
let s:end_tag = '\%(<\_s*/\_s*\%(\<[-:._$A-Za-z0-9]\+\>\)\_s*>\|/\_s*>\)'
|
||||
|
||||
function s:trim(line)
|
||||
return substitute(a:line, '^\s*\|\s*$', '', 'g')
|
||||
endfunction
|
||||
|
||||
" Get the syntax group of end of line
|
||||
function! s:syn_eol(lnum)
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
let col = strlen(getline(lnum))
|
||||
return map(synstack(lnum, col), 'synIDattr(v:val, "name")')
|
||||
" Get the syntax stack at the given position
|
||||
function s:syntax_stack_at(lnum, col)
|
||||
return map(synstack(a:lnum, a:col), 'synIDattr(v:val, "name")')
|
||||
endfunction
|
||||
|
||||
function! s:prev_indent(lnum)
|
||||
let lnum = prevnonblank(a:lnum - 1)
|
||||
return indent(lnum)
|
||||
" Get the syntax at the given position
|
||||
function s:syntax_at(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name')
|
||||
endfunction
|
||||
|
||||
function! s:prev_line(lnum)
|
||||
let lnum = prevnonblank(a:lnum - 1)
|
||||
return substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
||||
" Get the start col of the non-space charactor
|
||||
function s:start_col(lnum)
|
||||
return len(matchstr(getline(a:lnum), '^\s*')) + 1
|
||||
endfunction
|
||||
|
||||
function! s:syn_attr_jsx(synattr)
|
||||
return a:synattr =~? "^jsx"
|
||||
" Get the start syntax of a given line number
|
||||
function s:start_syntax(lnum)
|
||||
return s:syntax_at(a:lnum, s:start_col(a:lnum))
|
||||
endfunction
|
||||
|
||||
function! s:syn_xmlish(syns)
|
||||
return s:syn_attr_jsx(get(a:syns, -1))
|
||||
" The skip function for searchpair
|
||||
function s:skip_if_not(current_lnum, ...)
|
||||
" Skip the match in current line
|
||||
if line('.') == a:current_lnum
|
||||
return 1
|
||||
endif
|
||||
|
||||
let syntax = s:syntax_at(line('.'), col('.'))
|
||||
return syntax !~? join(a:000, '\|')
|
||||
endfunction
|
||||
|
||||
function! s:syn_jsx_element(syns)
|
||||
return get(a:syns, -1) =~? 'jsxElement'
|
||||
" Whether the specified stytax group is the opening tag
|
||||
function s:is_opening_tag(syntax)
|
||||
return a:syntax =~? 'jsxOpenPunct'
|
||||
endfunction
|
||||
|
||||
function! s:syn_js_comment(syns)
|
||||
return get(a:syns, -1) =~? 'Comment$'
|
||||
" Whether the specified stytax group is the closing tag
|
||||
function s:is_closing_tag(syntax)
|
||||
return a:syntax =~? 'jsxClose'
|
||||
endfunction
|
||||
|
||||
function! s:syn_jsx_escapejs(syns)
|
||||
return get(a:syns, -1) =~? '\(\(js\(Template\)\?\|javaScript\(Embed\)\?\|typescript\)Braces\|javascriptTemplateSB\|typescriptInterpolationDelimiter\)' &&
|
||||
\ (get(a:syns, -2) =~? 'jsxEscapeJs' ||
|
||||
\ get(a:syns, -3) =~? 'jsxEscapeJs')
|
||||
" Whether the specified syntax group is the jsxRegion
|
||||
function s:is_jsx_region(syntax)
|
||||
return a:syntax =~? 'jsxRegion'
|
||||
endfunction
|
||||
|
||||
function! s:syn_jsx_attrib(syns)
|
||||
return len(filter(copy(a:syns), 'v:val =~? "jsxAttrib"'))
|
||||
" Whether the specified syntax group is the jsxElement
|
||||
function s:is_jsx_element(syntax)
|
||||
return a:syntax =~? 'jsxElement'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxExpressionBlock
|
||||
function s:is_jsx_expression(syntax)
|
||||
return a:syntax =~? 'jsxExpressionBlock'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxBraces
|
||||
function s:is_jsx_brace(syntax)
|
||||
return a:syntax =~? 'jsxBraces'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxComment
|
||||
function s:is_jsx_comment(syntax)
|
||||
return a:syntax =~? 'jsxComment'
|
||||
endfunction
|
||||
|
||||
" Whether the specified line is comment related syntax
|
||||
function s:is_comment(syntax)
|
||||
return a:syntax =~? 'comment'
|
||||
endfunction
|
||||
|
||||
" Whether the specified syntax group is the jsxComment
|
||||
function s:is_jsx_backticks(syntax)
|
||||
return a:syntax =~? 'jsxBackticks'
|
||||
endfunction
|
||||
|
||||
" Get the prvious line number
|
||||
function s:prev_lnum(lnum)
|
||||
return prevnonblank(a:lnum - 1)
|
||||
endfunction
|
||||
|
||||
" Whether the given pos is the parent of the given element who has
|
||||
" element_count jsxElement syntax
|
||||
function s:is_parent_element(pos, element_count)
|
||||
let syntax_stack = s:syntax_stack_at(a:pos[0], a:pos[1])
|
||||
return s:is_opening_tag(syntax_stack[-1]) &&
|
||||
\ count(syntax_stack, 'jsxElement') <= a:element_count
|
||||
endfunction
|
||||
|
||||
" Compute the indention of the trail punct
|
||||
function s:jsx_indent_trail_punct(lnum)
|
||||
let pair_line = searchpair('<', '', '>', 'bW', 's:skip_if_not(a:lnum, "jsxOpenPunct", "jsxClose")')
|
||||
return indent(pair_line)
|
||||
endfunction
|
||||
|
||||
" Compute the indention of the closing tag
|
||||
function s:jsx_indent_closing_tag(lnum)
|
||||
let pair_line = searchpair(s:start_tag, '', s:end_tag, 'bW', 's:skip_if_not(a:lnum, "jsxOpenPunct", "jsxClose")')
|
||||
return pair_line ? indent(pair_line) : indent(a:lnum)
|
||||
endfunction
|
||||
|
||||
" Compute the indentation of the jsxElement
|
||||
function s:jsx_indent_element(lnum)
|
||||
let syntax_stack = s:syntax_stack_at(a:lnum, s:start_col(a:lnum))
|
||||
let syntax_name = syntax_stack[-1]
|
||||
let element_count = count(syntax_stack, 'jsxElement')
|
||||
|
||||
if s:trim(getline(a:lnum)) =~ '^>'
|
||||
return s:jsx_indent_trail_punct(a:lnum)
|
||||
endif
|
||||
|
||||
" If current tag is closing tag
|
||||
if s:is_closing_tag(syntax_name)
|
||||
return s:jsx_indent_closing_tag(a:lnum)
|
||||
endif
|
||||
|
||||
" Normalize the jsxElement count for opening tag
|
||||
if s:is_opening_tag(syntax_name)
|
||||
" <div>
|
||||
" <div></div> <-- jsxRegion->jsxElement->jsxElement->jsxTag->jsxOpenTag->jsxOpenPunct
|
||||
" </div>
|
||||
if s:is_jsx_element(syntax_stack[-4]) && s:is_jsx_element(syntax_stack[-5])
|
||||
let element_count = element_count - 1
|
||||
endif
|
||||
endif
|
||||
|
||||
let start_time = localtime()
|
||||
let pos = searchpos(s:start_tag, 'bW')
|
||||
|
||||
while !s:is_parent_element(pos, element_count)
|
||||
if localtime() - start_time >= 0.5
|
||||
return -1
|
||||
endif
|
||||
let pos = searchpos(s:start_tag, 'bW')
|
||||
endwhile
|
||||
|
||||
return indent(pos[0]) + s:sw()
|
||||
endfunction
|
||||
|
||||
" Compute the indentation of the comment
|
||||
function s:jsx_indent_comment(lnum)
|
||||
let line = s:trim(getline(a:lnum))
|
||||
|
||||
if s:is_jsx_comment(s:start_syntax(a:lnum))
|
||||
if line =~ '^<!--' || line =~ '^-->'
|
||||
return s:jsx_indent_element(a:lnum)
|
||||
else
|
||||
return s:jsx_indent_element(a:lnum) + s:sw()
|
||||
endif
|
||||
else
|
||||
if line =~ '^/\*' || line =~ '^//'
|
||||
return s:jsx_indent_element(a:lnum)
|
||||
else
|
||||
return s:jsx_indent_element(a:lnum) + 1
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Compute the indentation of jsxBackticks
|
||||
function s:jsx_indent_backticks(lnum)
|
||||
let tags = get(g:, 'vim_jsx_pretty_template_tags', ['html', 'jsx'])
|
||||
let start_tag = '\%(' . join(tags, '\|') . '\)`'
|
||||
let end_tag = '\%(' . join(tags, '\|') . '\)\@<!`'
|
||||
let pair_line = searchpair(start_tag, '', end_tag, 'bW', 's:skip_if_not(a:lnum)')
|
||||
|
||||
return indent(pair_line)
|
||||
endfunction
|
||||
|
||||
" Syntax context types:
|
||||
" - jsxRegion
|
||||
" - jsxTaggedRegion
|
||||
" - jsxElement
|
||||
" - jsxExpressionBlock
|
||||
" - Other
|
||||
function s:syntax_context(lnum)
|
||||
let start_col = s:start_col(a:lnum)
|
||||
let syntax_stack = s:syntax_stack_at(a:lnum, start_col)
|
||||
let start_syntax = syntax_stack[-1]
|
||||
let reversed = reverse(syntax_stack)
|
||||
let i = 0
|
||||
|
||||
for syntax_name in reversed
|
||||
" If the current line is jsxExpressionBlock and not starts with jsxBraces
|
||||
if s:is_jsx_expression(syntax_name)
|
||||
return 'jsxExpressionBlock'
|
||||
endif
|
||||
|
||||
if s:is_jsx_region(syntax_name)
|
||||
return 'jsxRegion'
|
||||
endif
|
||||
|
||||
if s:is_jsx_element(syntax_name)
|
||||
" If current line starts with the opening tag
|
||||
if s:is_opening_tag(start_syntax) || s:is_closing_tag(start_syntax)
|
||||
" And the next syntax is jsxRegion
|
||||
if s:is_jsx_region(reversed[i+1])
|
||||
return 'jsxRegion'
|
||||
elseif reversed[i+1] =~ 'jsxTaggedRegion'
|
||||
return 'jsxTaggedRegion'
|
||||
else
|
||||
return 'jsxElement'
|
||||
endif
|
||||
elseif reversed[i+1] =~ 'jsxTaggedRegion'
|
||||
return 'jsxTaggedRegion'
|
||||
else
|
||||
return 'jsxElement'
|
||||
endif
|
||||
endif
|
||||
|
||||
let i = i + 1
|
||||
endfor
|
||||
|
||||
return 'Other'
|
||||
endfunction
|
||||
|
||||
let s:start_tag = '<\s*\([-:_\.\$0-9A-Za-z]\+\|>\)'
|
||||
" match `/end_tag>` and `//>`
|
||||
let s:end_tag = '/\%(\s*[-:_\.\$0-9A-Za-z]*\s*\|/\)>'
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
|
||||
|
||||
function! jsx_pretty#indent#get(js_indent)
|
||||
let lnum = v:lnum
|
||||
let line = substitute(getline(lnum), '^\s*\|\s*$', '', 'g')
|
||||
let current_syn = s:syn_sol(lnum)
|
||||
let current_syn_eol = s:syn_eol(lnum)
|
||||
let prev_line_num = prevnonblank(lnum - 1)
|
||||
let prev_syn_sol = s:syn_sol(prev_line_num)
|
||||
let prev_syn_eol = s:syn_eol(prev_line_num)
|
||||
let prev_line = s:prev_line(lnum)
|
||||
let prev_ind = s:prev_indent(lnum)
|
||||
let line = s:trim(getline(v:lnum))
|
||||
let start_syntax = s:start_syntax(v:lnum)
|
||||
|
||||
if s:syn_xmlish(current_syn)
|
||||
if s:is_jsx_backticks(start_syntax)
|
||||
return s:jsx_indent_backticks(v:lnum)
|
||||
endif
|
||||
|
||||
if !s:syn_xmlish(prev_syn_sol)
|
||||
\ && !s:syn_jsx_escapejs(prev_syn_sol)
|
||||
\ && !s:syn_jsx_escapejs(prev_syn_eol)
|
||||
\ && !s:syn_js_comment(prev_syn_sol)
|
||||
if line =~ '^/\s*>' || line =~ '^<\s*' . s:end_tag
|
||||
return prev_ind
|
||||
if s:is_jsx_brace(start_syntax)
|
||||
return s:jsx_indent_element(v:lnum)
|
||||
endif
|
||||
|
||||
if s:is_opening_tag(start_syntax) && line =~ '^>'
|
||||
return s:jsx_indent_trail_punct(v:lnum)
|
||||
endif
|
||||
|
||||
let syntax_context = s:syntax_context(v:lnum)
|
||||
|
||||
if syntax_context == 'jsxRegion'
|
||||
if s:is_closing_tag(start_syntax)
|
||||
return s:jsx_indent_closing_tag(v:lnum)
|
||||
endif
|
||||
|
||||
let prev_lnum = s:prev_lnum(v:lnum)
|
||||
let prev_line = s:trim(getline(prev_lnum))
|
||||
|
||||
if prev_line =~ '[([{=?]$'
|
||||
return indent(prev_lnum) + s:sw()
|
||||
elseif prev_line =~ '[:|&<>]$' &&
|
||||
\ s:trim(getline(s:prev_lnum(prev_lnum))) !~ '[?:|&<>]$'
|
||||
return indent(prev_lnum) + s:sw()
|
||||
else
|
||||
return prev_ind + s:sw()
|
||||
return indent(prev_lnum)
|
||||
endif
|
||||
elseif !s:syn_xmlish(prev_syn_sol) && !s:syn_js_comment(prev_syn_sol) && s:syn_jsx_attrib(current_syn)
|
||||
" For #79
|
||||
return prev_ind + s:sw()
|
||||
" {
|
||||
" <div></div>
|
||||
" ##} <--
|
||||
elseif s:syn_jsx_element(current_syn) && line =~ '}$'
|
||||
let pair_line = searchpair('{', '', '}', 'b')
|
||||
return indent(pair_line)
|
||||
elseif line =~ '^-->$'
|
||||
if prev_line =~ '^<!--'
|
||||
return prev_ind
|
||||
elseif syntax_context == 'jsxTaggedRegion'
|
||||
if s:is_closing_tag(start_syntax)
|
||||
return s:jsx_indent_closing_tag(v:lnum)
|
||||
elseif s:is_jsx_comment(start_syntax)
|
||||
return s:jsx_indent_comment(v:lnum)
|
||||
else
|
||||
return prev_ind - s:sw()
|
||||
return indent(s:prev_lnum(v:lnum)) + s:sw()
|
||||
endif
|
||||
elseif prev_line =~ '-->$'
|
||||
return prev_ind
|
||||
" close tag </tag> or /> including </>
|
||||
elseif prev_line =~ s:end_tag . '$'
|
||||
if line =~ '^<\s*' . s:end_tag
|
||||
return prev_ind - s:sw()
|
||||
elseif s:syn_jsx_attrib(prev_syn_sol)
|
||||
return prev_ind - s:sw()
|
||||
else
|
||||
return prev_ind
|
||||
elseif syntax_context == 'jsxElement'
|
||||
if s:is_jsx_comment(start_syntax)
|
||||
return s:jsx_indent_comment(v:lnum)
|
||||
endif
|
||||
elseif line =~ '^\(>\|/\s*>\)'
|
||||
if prev_line =~ '^<'
|
||||
return prev_ind
|
||||
else
|
||||
return prev_ind - s:sw()
|
||||
|
||||
if s:is_comment(start_syntax)
|
||||
return s:jsx_indent_comment(v:lnum)
|
||||
endif
|
||||
elseif prev_line =~ '^\(<\|>\)' &&
|
||||
\ (s:syn_xmlish(prev_syn_eol) || s:syn_js_comment(prev_syn_eol))
|
||||
if line =~ '^<\s*' . s:end_tag
|
||||
return prev_ind
|
||||
else
|
||||
return prev_ind + s:sw()
|
||||
endif
|
||||
elseif line =~ '^<\s*' . s:end_tag
|
||||
if !s:syn_xmlish(prev_syn_sol)
|
||||
if s:syn_jsx_escapejs(prev_syn_eol)
|
||||
\ || s:syn_jsx_escapejs(prev_syn_sol)
|
||||
return prev_ind - s:sw()
|
||||
else
|
||||
return prev_ind
|
||||
endif
|
||||
elseif prev_line =~ '^\<return'
|
||||
return prev_ind
|
||||
else
|
||||
return prev_ind - s:sw()
|
||||
endif
|
||||
elseif !s:syn_xmlish(prev_syn_eol)
|
||||
if prev_line =~ '\(&&\|||\|=>\|[([{]\|`\)$'
|
||||
" <div>
|
||||
" {
|
||||
" }
|
||||
" </div>
|
||||
if line =~ '^[)\]}]'
|
||||
return prev_ind
|
||||
else
|
||||
return prev_ind + s:sw()
|
||||
endif
|
||||
else
|
||||
return prev_ind
|
||||
endif
|
||||
else
|
||||
return prev_ind
|
||||
endif
|
||||
elseif s:syn_jsx_escapejs(current_syn)
|
||||
if line =~ '^}'
|
||||
let char = getline('.')[col('.') - 1]
|
||||
" When pressing enter after the }, keep the indent
|
||||
if char != '}' && search('}', 'b', lnum)
|
||||
return indent(lnum)
|
||||
else
|
||||
let pair_line = searchpair('{', '', '}', 'bW')
|
||||
return indent(pair_line)
|
||||
endif
|
||||
elseif line =~ '^{' || line =~ '^\${'
|
||||
if s:syn_jsx_escapejs(prev_syn_eol)
|
||||
\ || s:syn_jsx_attrib(prev_syn_sol)
|
||||
return prev_ind
|
||||
elseif s:syn_xmlish(prev_syn_eol) && (prev_line =~ s:end_tag || prev_line =~ '-->$')
|
||||
return prev_ind
|
||||
else
|
||||
return prev_ind + s:sw()
|
||||
endif
|
||||
endif
|
||||
elseif line =~ '^`' && s:syn_jsx_escapejs(current_syn_eol)
|
||||
" For `} of template syntax
|
||||
let pair_line = searchpair('{', '', '}', 'bW')
|
||||
return indent(pair_line)
|
||||
elseif line =~ '^/[/*]' " js comment in jsx tag
|
||||
if get(prev_syn_sol, -1) =~ 'Punct'
|
||||
return prev_ind + s:sw()
|
||||
elseif synIDattr(synID(lnum - 1, 1, 1), 'name') =~ 'jsxTag'
|
||||
return prev_ind
|
||||
|
||||
return s:jsx_indent_element(v:lnum)
|
||||
elseif syntax_context == 'jsxExpressionBlock'
|
||||
let prev_lnum = s:prev_lnum(v:lnum)
|
||||
let prev_line = s:trim(getline(prev_lnum))
|
||||
|
||||
if line =~ '^?'
|
||||
return indent(prev_lnum) + s:sw()
|
||||
elseif line =~ '^:'
|
||||
return indent(prev_lnum)
|
||||
else
|
||||
return a:js_indent()
|
||||
endif
|
||||
else
|
||||
let ind = a:js_indent()
|
||||
|
||||
" Issue #68
|
||||
" return (<div>
|
||||
" |<div>)
|
||||
if (line =~ '^/\s*>' || line =~ '^<\s*' . s:end_tag)
|
||||
\ && !s:syn_xmlish(prev_syn_sol)
|
||||
return prev_ind
|
||||
endif
|
||||
|
||||
" If current syntax is not a jsx syntax group
|
||||
if s:syn_xmlish(prev_syn_eol) && line !~ '^[)\]}]'
|
||||
let sol = matchstr(line, s:opfirst)
|
||||
if sol is ''
|
||||
" Fix javascript continue indent
|
||||
return ind - s:sw()
|
||||
else
|
||||
return ind
|
||||
endif
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
|
||||
return a:js_indent()
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
function! julia#set_syntax_version(jvers)
|
||||
if &filetype != "julia"
|
||||
echo "Not a Julia file"
|
||||
@@ -183,4 +184,5 @@ function! julia#gotodefinition()
|
||||
return
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
" path to the julia binary to communicate with
|
||||
if has('win32') || has('win64')
|
||||
if exists('g:julia#doc#juliapath')
|
||||
@@ -241,4 +242,5 @@ function! s:likely(str) abort
|
||||
let output = systemlist(cmd)
|
||||
return split(matchstr(output[0], '\C^search: \zs.*'))
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
" Facilities for moving around Julia blocks (e.g. if/end, function/end etc.)
|
||||
" (AKA a collection of horrible hacks)
|
||||
|
||||
@@ -793,4 +794,5 @@ function! s:cursor_moved(...)
|
||||
let b:jlblk_did_select = b:jlblk_doing_select
|
||||
let b:jlblk_doing_select = 0
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
|
||||
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
||||
" The symbols are based on Julia version 1.3.0-DEV.263
|
||||
|
||||
@@ -3329,4 +3330,5 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:baggage_claim:': '🛄',
|
||||
\ '\:left_luggage:': '🛅'}
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
532
autoload/markdown.vim
Normal file
532
autoload/markdown.vim
Normal file
@@ -0,0 +1,532 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
|
||||
" {{{ FOLDING
|
||||
|
||||
function! markdown#FoldLevelOfLine(lnum)
|
||||
let currentline = getline(a:lnum)
|
||||
let nextline = getline(a:lnum + 1)
|
||||
|
||||
" an empty line is not going to change the indentation level
|
||||
if match(currentline, '^\s*$') >= 0
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding lists
|
||||
if s:SyntaxGroupOfLineIs(a:lnum, '^markdownListItem')
|
||||
if s:SyntaxGroupOfLineIs(a:lnum - 1, '^markdownListItem')
|
||||
return 'a1'
|
||||
endif
|
||||
if s:SyntaxGroupOfLineIs(a:lnum + 1, '^markdownListItem')
|
||||
return 's1'
|
||||
endif
|
||||
return '='
|
||||
endif
|
||||
|
||||
" we are not going to fold things inside list items, too hairy
|
||||
let is_inside_a_list_item = s:SyntaxGroupOfLineIs(a:lnum, '^markdownListItem')
|
||||
if is_inside_a_list_item
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding atx headers
|
||||
if match(currentline, '^#\{1,6}\s') >= 0
|
||||
let header_level = strlen(substitute(currentline, '^\(#\{1,6}\).*', '\1', ''))
|
||||
return '>' . header_level
|
||||
endif
|
||||
|
||||
" folding fenced code blocks
|
||||
let next_line_syntax_group = synIDattr(synID(a:lnum + 1, 1, 1), 'name')
|
||||
if match(currentline, '^\s*```') >= 0
|
||||
if next_line_syntax_group ==# 'markdownFencedCodeBlock'
|
||||
return 'a1'
|
||||
endif
|
||||
return 's1'
|
||||
endif
|
||||
|
||||
" folding code blocks
|
||||
let current_line_syntax_group = synIDattr(synID(a:lnum, 1, 1), 'name')
|
||||
let prev_line_syntax_group = synIDattr(synID(a:lnum - 1, 1, 1), 'name')
|
||||
if match(currentline, '^\s\{4,}') >= 0
|
||||
if current_line_syntax_group ==# 'markdownCodeBlock'
|
||||
if prev_line_syntax_group !=# 'markdownCodeBlock'
|
||||
return 'a1'
|
||||
endif
|
||||
if next_line_syntax_group !=# 'markdownCodeBlock'
|
||||
return 's1'
|
||||
endif
|
||||
endif
|
||||
return '='
|
||||
endif
|
||||
|
||||
" folding setex headers
|
||||
if (match(currentline, '^.*$') >= 0)
|
||||
if (match(nextline, '^=\+$') >= 0)
|
||||
return '>1'
|
||||
endif
|
||||
if (match(nextline, '^-\+$') >= 0)
|
||||
return '>2'
|
||||
endif
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxGroupOfLineIs(lnum, pattern)
|
||||
let stack = synstack(a:lnum, a:cnum)
|
||||
if len(stack) > 0
|
||||
return synIDattr(stack[0], 'name') =~# a:pattern
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
" {{{ EDIT
|
||||
|
||||
function! markdown#EditBlock() range abort
|
||||
if exists('b:markdown_temporary_buffer') && b:markdown_temporary_buffer
|
||||
echo 'Sorry, you cannot edit a code block inside a temporary buffer'
|
||||
return
|
||||
endif
|
||||
" Github fenced code blocks like ```ruby
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*`\{3,}\(\w\+\)\%(\s.*$\|$\)',
|
||||
\ '^\s*`\{3,}\s*$'
|
||||
\ )
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Github fenced code blocks with metadata like ```{ruby, <WHATEVER>}
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*`\{3,}{\(\w\+\),[^}]\+}\%(\s.*$\|$\)',
|
||||
\ '^\s*`\{3,}\s*$'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Github fenced code blocks alternate style like ~~~ruby
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*\~\{3,}\(\w\+\)\%(\s.*$\|$\)',
|
||||
\ '^\s*\~\{3,}\s*$'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
" Liquid fenced code blocks {% highlight ruby %}
|
||||
" (since we support some liquid/jekyll tags, why not?)
|
||||
let code_block = s:LocateFencedCodeBlock(a:firstline,
|
||||
\ '^\s*{%\s*highlight\s\+\(\w\+\)\s*%}\%(\s.*$\|$\)',
|
||||
\ '^\s*{%\s*endhighlight\s*%}\%(\s.*$\|$\)'
|
||||
\ )
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
let code_block = s:LocateRangeBlock(a:firstline, a:lastline)
|
||||
endif
|
||||
if code_block['from'] == 0 || code_block['to'] == 0
|
||||
echo 'Sorry, I did not find any suitable code block to edit or create'
|
||||
return
|
||||
endif
|
||||
|
||||
let code_block['file_extension'] = '.' . code_block['language']
|
||||
if has_key(s:known_file_extensions, code_block['language'])
|
||||
let code_block['file_extension'] = s:known_file_extensions[code_block['language']]
|
||||
endif
|
||||
let code_block['file_path'] = tempname() . code_block['file_extension']
|
||||
let code_block['content'] = getline(code_block['from'], code_block['to'])
|
||||
let code_block['content'] = s:UnindentBlock(code_block['content'], code_block['indentation'])
|
||||
|
||||
call writefile(code_block['content'], code_block['file_path'])
|
||||
augroup MarkdownReplaceEditedBlock
|
||||
autocmd BufEnter <buffer> call s:ReplaceEditedBlock()
|
||||
augroup END
|
||||
|
||||
let b:code_block = code_block
|
||||
execute 'split ' . code_block['file_path']
|
||||
let b:markdown_temporary_buffer = 1
|
||||
autocmd BufLeave <buffer> wq
|
||||
endfunction
|
||||
|
||||
function! s:ReplaceEditedBlock()
|
||||
augroup MarkdownReplaceEditedBlock
|
||||
autocmd!
|
||||
augroup END
|
||||
augroup! MarkdownReplaceEditedBlock
|
||||
|
||||
if b:code_block['to'] - b:code_block['from'] >= 0
|
||||
execute b:code_block['from'] . ',' b:code_block['to'] . ' delete _'
|
||||
endif
|
||||
let content = readfile(b:code_block['file_path'])
|
||||
let content = s:IndentBlock(l:content, b:code_block['indentation'])
|
||||
let content = s:SurroundWithFencedCodeBlock(l:content, b:code_block)
|
||||
call append(b:code_block['from']-1, content)
|
||||
call setpos('.', b:code_block['back_to_position'])
|
||||
|
||||
execute 'silent bwipeout! ' . b:code_block['file_path']
|
||||
call delete(b:code_block['file_path'])
|
||||
unlet! b:code_block
|
||||
endfunction
|
||||
|
||||
function! s:UnindentBlock(content, indentation)
|
||||
return map(a:content, 'substitute(v:val, ''^' . a:indentation . ''', '''', ''g'')')
|
||||
endfunction
|
||||
|
||||
function! s:IndentBlock(content, indentation)
|
||||
return map(a:content, 'substitute(v:val, ''^'', ''' . a:indentation . ''', ''g'')')
|
||||
endfunction
|
||||
|
||||
function! s:SurroundWithFencedCodeBlock(code, editing)
|
||||
if !a:editing['surround'] | return a:code | endif
|
||||
if a:editing['language'] =~# 'markdown' | return a:code | endif
|
||||
let before =
|
||||
\ (a:editing['make_room_before'] ? [''] : []) +
|
||||
\ [a:editing['indentation'] . '```' . a:editing['language']]
|
||||
let after =
|
||||
\ [a:editing['indentation'] . '```'] +
|
||||
\ (a:editing['make_room_after'] ? [''] : [])
|
||||
return l:before + a:code + l:after
|
||||
endfunction
|
||||
|
||||
function! s:LocateRangeBlock(from, to)
|
||||
" TODO: extract initialize_code_block
|
||||
let code_block = {'from': 0, 'to': 0, 'language': 'txt', 'indentation': '', 'surround': 0}
|
||||
if a:to >= a:from
|
||||
let code_block['from'] = a:from
|
||||
let code_block['to'] = a:to
|
||||
let code_block['back_to_position'] = getpos('.')
|
||||
let code_block['language'] = 'markdown'
|
||||
|
||||
if a:from == a:to && getline(a:from) =~ '^\s*$'
|
||||
let code_block['surround'] = 1
|
||||
let code_block['make_room_before'] = getline(a:from - 1) !~ '^\s*$'
|
||||
let code_block['make_room_after'] = getline(a:to + 1) !~ '^\s*$'
|
||||
let code_block['language'] = input('filetype? (default: markdown) ', '', 'filetype')
|
||||
if code_block['language'] =~ '^\s*$'
|
||||
let code_block['language'] = 'markdown'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return code_block
|
||||
endfunction
|
||||
|
||||
function! s:LocateFencedCodeBlock(starting_from, upper_delimiter, lower_delimiter)
|
||||
" TODO: extract initialize_code_block
|
||||
let code_block = {'from': 0, 'to': 0, 'language': 'txt', 'indentation': '', 'surround': 0}
|
||||
let initial_position = getpos('.')
|
||||
let search_position = copy(initial_position)
|
||||
let search_position[1] = a:starting_from
|
||||
let search_position[2] = 0
|
||||
cal setpos('.', search_position)
|
||||
|
||||
let start_code_block_backward = search(a:upper_delimiter, 'cbnW')
|
||||
let end_code_block_backward = search(a:lower_delimiter, 'cbnW')
|
||||
let end_code_block_forward = search(a:lower_delimiter, 'cnW')
|
||||
|
||||
let found_code_block =
|
||||
\ start_code_block_backward > 0 &&
|
||||
\ end_code_block_forward > 0
|
||||
let between_two_code_blocks =
|
||||
\ start_code_block_backward < end_code_block_backward &&
|
||||
\ end_code_block_backward <= a:starting_from
|
||||
let starting_inside_code_block =
|
||||
\ found_code_block &&
|
||||
\ !between_two_code_blocks &&
|
||||
\ start_code_block_backward <= a:starting_from &&
|
||||
\ end_code_block_forward >= a:starting_from
|
||||
|
||||
if starting_inside_code_block
|
||||
let code_block['language'] = s:ExtractLanguage(start_code_block_backward, a:upper_delimiter)
|
||||
let code_block['indentation'] = s:ExtractIndentation(start_code_block_backward)
|
||||
let code_block['back_to_position'] = initial_position
|
||||
let code_block['back_to_position'][1] = start_code_block_backward
|
||||
let code_block['back_to_position'][2] = 0
|
||||
let code_block['from'] = start_code_block_backward + 1
|
||||
let code_block['to'] = end_code_block_forward - 1
|
||||
endif
|
||||
return code_block
|
||||
endfunction
|
||||
|
||||
function! s:ExtractLanguage(start_at, upper_delimiter)
|
||||
return substitute(getline(a:start_at), a:upper_delimiter, '\1', '')
|
||||
endfunction
|
||||
|
||||
function! s:ExtractIndentation(start_at)
|
||||
return substitute(getline(a:start_at), '\(^\s*\).\+$', '\1', '')
|
||||
endfunction
|
||||
|
||||
let s:known_file_extensions = {
|
||||
\ 'abap': '.abap',
|
||||
\ 'antlr': '.g4',
|
||||
\ 'asp': '.asp',
|
||||
\ 'ats': '.dats',
|
||||
\ 'actionscript': '.as',
|
||||
\ 'ada': '.adb',
|
||||
\ 'agda': '.agda',
|
||||
\ 'apacheconf': '.apacheconf',
|
||||
\ 'apex': '.cls',
|
||||
\ 'applescript': '.applescript',
|
||||
\ 'arc': '.arc',
|
||||
\ 'arduino': '.ino',
|
||||
\ 'asciidoc': '.asciidoc',
|
||||
\ 'assembly': '.asm',
|
||||
\ 'augeas': '.aug',
|
||||
\ 'autohotkey': '.ahk',
|
||||
\ 'autoit': '.au3',
|
||||
\ 'awk': '.awk',
|
||||
\ 'batchfile': '.bat',
|
||||
\ 'befunge': '.befunge',
|
||||
\ 'blitzbasic': '.bb',
|
||||
\ 'blitzmax': '.bmx',
|
||||
\ 'bluespec': '.bsv',
|
||||
\ 'boo': '.boo',
|
||||
\ 'brainfuck': '.b',
|
||||
\ 'brightscript': '.brs',
|
||||
\ 'bro': '.bro',
|
||||
\ 'c': '.c',
|
||||
\ 'c++': '.cpp',
|
||||
\ 'cpp': '.cpp',
|
||||
\ 'clips': '.clp',
|
||||
\ 'cmake': '.cmake',
|
||||
\ 'cobol': '.cob',
|
||||
\ 'css': '.css',
|
||||
\ 'ceylon': '.ceylon',
|
||||
\ 'chuck': '.ck',
|
||||
\ 'cirru': '.cirru',
|
||||
\ 'clean': '.icl',
|
||||
\ 'clojure': '.clj',
|
||||
\ 'coffeescript': '.coffee',
|
||||
\ 'coldfusion': '.cfm',
|
||||
\ 'coq': '.coq',
|
||||
\ 'creole': '.creole',
|
||||
\ 'crystal': '.cr',
|
||||
\ 'cucumber': '.feature',
|
||||
\ 'cuda': '.cu',
|
||||
\ 'cython': '.pyx',
|
||||
\ 'd': '.d',
|
||||
\ 'dm': '.dm',
|
||||
\ 'dot': '.dot',
|
||||
\ 'dart': '.dart',
|
||||
\ 'diff': '.diff',
|
||||
\ 'dylan': '.dylan',
|
||||
\ 'ecl': '.ecl',
|
||||
\ 'eiffel': '.e',
|
||||
\ 'elixir': '.ex',
|
||||
\ 'elm': '.elm',
|
||||
\ 'erlang': '.erl',
|
||||
\ 'flux': '.fx',
|
||||
\ 'fortran': '.f90',
|
||||
\ 'factor': '.factor',
|
||||
\ 'fancy': '.fy',
|
||||
\ 'fantom': '.fan',
|
||||
\ 'forth': '.fth',
|
||||
\ 'gas': '.s',
|
||||
\ 'glsl': '.glsl',
|
||||
\ 'genshi': '.kid',
|
||||
\ 'glyph': '.glf',
|
||||
\ 'go': '.go',
|
||||
\ 'gosu': '.gs',
|
||||
\ 'groff': '.man',
|
||||
\ 'groovy': '.groovy',
|
||||
\ 'html': '.html',
|
||||
\ 'http': '.http',
|
||||
\ 'haml': '.haml',
|
||||
\ 'handlebars': '.handlebars',
|
||||
\ 'harbour': '.hb',
|
||||
\ 'haskell': '.hs',
|
||||
\ 'haxe': '.hx',
|
||||
\ 'hy': '.hy',
|
||||
\ 'idl': '.pro',
|
||||
\ 'ini': '.ini',
|
||||
\ 'idris': '.idr',
|
||||
\ 'io': '.io',
|
||||
\ 'ioke': '.ik',
|
||||
\ 'j': '.ijs',
|
||||
\ 'json': '.json',
|
||||
\ 'json5': '.json5',
|
||||
\ 'jsonld': '.jsonld',
|
||||
\ 'jade': '.jade',
|
||||
\ 'java': '.java',
|
||||
\ 'javascript': '.js',
|
||||
\ 'julia': '.jl',
|
||||
\ 'krl': '.krl',
|
||||
\ 'kotlin': '.kt',
|
||||
\ 'lfe': '.lfe',
|
||||
\ 'llvm': '.ll',
|
||||
\ 'lasso': '.lasso',
|
||||
\ 'less': '.less',
|
||||
\ 'lilypond': '.ly',
|
||||
\ 'livescript': '.ls',
|
||||
\ 'logos': '.xm',
|
||||
\ 'logtalk': '.lgt',
|
||||
\ 'lua': '.lua',
|
||||
\ 'm': '.mumps',
|
||||
\ 'makefile': '.mak',
|
||||
\ 'mako': '.mako',
|
||||
\ 'markdown': '.md',
|
||||
\ 'mask': '.mask',
|
||||
\ 'matlab': '.matlab',
|
||||
\ 'max': '.maxpat',
|
||||
\ 'mediawiki': '.mediawiki',
|
||||
\ 'mirah': '.druby',
|
||||
\ 'monkey': '.monkey',
|
||||
\ 'moocode': '.moo',
|
||||
\ 'moonscript': '.moon',
|
||||
\ 'myghty': '.myt',
|
||||
\ 'nsis': '.nsi',
|
||||
\ 'nemerle': '.n',
|
||||
\ 'netlogo': '.nlogo',
|
||||
\ 'nginx': '.nginxconf',
|
||||
\ 'nimrod': '.nim',
|
||||
\ 'nu': '.nu',
|
||||
\ 'numpy': '.numpy',
|
||||
\ 'ocaml': '.ml',
|
||||
\ 'objdump': '.objdump',
|
||||
\ 'omgrofl': '.omgrofl',
|
||||
\ 'opa': '.opa',
|
||||
\ 'opencl': '.cl',
|
||||
\ 'org': '.org',
|
||||
\ 'oxygene': '.oxygene',
|
||||
\ 'pawn': '.pwn',
|
||||
\ 'php': '.php',
|
||||
\ 'parrot': '.parrot',
|
||||
\ 'pascal': '.pas',
|
||||
\ 'perl': '.pl',
|
||||
\ 'perl6': '.p6',
|
||||
\ 'pike': '.pike',
|
||||
\ 'pod': '.pod',
|
||||
\ 'pogoscript': '.pogo',
|
||||
\ 'postscript': '.ps',
|
||||
\ 'powershell': '.ps1',
|
||||
\ 'processing': '.pde',
|
||||
\ 'prolog': '.prolog',
|
||||
\ 'puppet': '.pp',
|
||||
\ 'python': '.py',
|
||||
\ 'qml': '.qml',
|
||||
\ 'r': '.r',
|
||||
\ 'rdoc': '.rdoc',
|
||||
\ 'realbasic': '.rbbas',
|
||||
\ 'rhtml': '.rhtml',
|
||||
\ 'rmarkdown': '.rmd',
|
||||
\ 'racket': '.rkt',
|
||||
\ 'rebol': '.rebol',
|
||||
\ 'redcode': '.cw',
|
||||
\ 'robotframework': '.robot',
|
||||
\ 'rouge': '.rg',
|
||||
\ 'ruby': '.rb',
|
||||
\ 'rust': '.rs',
|
||||
\ 'scss': '.scss',
|
||||
\ 'sql': '.sql',
|
||||
\ 'sage': '.sage',
|
||||
\ 'sass': '.sass',
|
||||
\ 'scala': '.scala',
|
||||
\ 'scaml': '.scaml',
|
||||
\ 'scheme': '.scm',
|
||||
\ 'scilab': '.sci',
|
||||
\ 'self': '.self',
|
||||
\ 'shell': '.sh',
|
||||
\ 'shen': '.shen',
|
||||
\ 'slash': '.sl',
|
||||
\ 'smalltalk': '.st',
|
||||
\ 'smarty': '.tpl',
|
||||
\ 'squirrel': '.nut',
|
||||
\ 'stylus': '.styl',
|
||||
\ 'supercollider': '.scd',
|
||||
\ 'toml': '.toml',
|
||||
\ 'txl': '.txl',
|
||||
\ 'tcl': '.tcl',
|
||||
\ 'tcsh': '.tcsh',
|
||||
\ 'tex': '.tex',
|
||||
\ 'tea': '.tea',
|
||||
\ 'textile': '.textile',
|
||||
\ 'turing': '.t',
|
||||
\ 'twig': '.twig',
|
||||
\ 'typescript': '.ts',
|
||||
\ 'unrealscript': '.uc',
|
||||
\ 'vhdl': '.vhdl',
|
||||
\ 'vala': '.vala',
|
||||
\ 'verilog': '.v',
|
||||
\ 'viml': '.vim',
|
||||
\ 'volt': '.volt',
|
||||
\ 'xc': '.xc',
|
||||
\ 'xml': '.xml',
|
||||
\ 'xproc': '.xpl',
|
||||
\ 'xquery': '.xquery',
|
||||
\ 'xs': '.xs',
|
||||
\ 'xslt': '.xslt',
|
||||
\ 'xtend': '.xtend',
|
||||
\ 'yaml': '.yml',
|
||||
\ 'ec': '.ec',
|
||||
\ 'edn': '.edn',
|
||||
\ 'fish': '.fish',
|
||||
\ 'mupad': '.mu',
|
||||
\ 'nesc': '.nc',
|
||||
\ 'ooc': '.ooc',
|
||||
\ 'restructuredtext': '.rst',
|
||||
\ 'wisp': '.wisp',
|
||||
\ 'xbase': '.prg',
|
||||
\ }
|
||||
|
||||
" }}}
|
||||
|
||||
" {{{ FORMAT
|
||||
function! markdown#FormatTable()
|
||||
let p = '^\s*|\s.*\s|\s*$'
|
||||
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
|
||||
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
|
||||
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
|
||||
let separator_line_number = search('^\s*|\s*-\{3,}', 'cbnW')
|
||||
|
||||
call s:ShrinkTableHeaderSeparator(separator_line_number)
|
||||
Tabularize/|/l1
|
||||
call s:ExpandTableHeaderSeparator(separator_line_number)
|
||||
normal! 0
|
||||
|
||||
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:ShrinkTableHeaderSeparator(separator_line_number)
|
||||
if a:separator_line_number > 0
|
||||
let separator_line = getline(a:separator_line_number)
|
||||
let separator_line = substitute(separator_line, '-\+', '---', 'g')
|
||||
call setline(a:separator_line_number, separator_line)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:ExpandTableHeaderSeparator(separator_line_number)
|
||||
if a:separator_line_number > 0
|
||||
let separator_line = getline(a:separator_line_number)
|
||||
let separator_line = substitute(
|
||||
\ separator_line,
|
||||
\ '|\([^|]*\)',
|
||||
\ '\="| " . repeat("-", strlen(submatch(1)) - 2) . " "',
|
||||
\ 'g')
|
||||
let separator_line = substitute(separator_line, '\s*$', '', '')
|
||||
call setline(a:separator_line_number, separator_line)
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
" {{{ SWITCH STATUS
|
||||
function! markdown#SwitchStatus()
|
||||
let current_line = getline('.')
|
||||
if match(current_line, '^\s*[*\-+] \[ \]') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\) \[ \]', '\1 [x]', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*[*\-+] \[x\]') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\) \[x\]', '\1', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*[*\-+] \(\[[x ]\]\)\@!') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*[*\-+]\)', '\1 [ ]', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*#\{1,5}\s') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*#\{1,5}\) \(.*$\)', '\1# \2', ''))
|
||||
return
|
||||
endif
|
||||
if match(current_line, '^\s*#\{6}\s') >= 0
|
||||
call setline('.', substitute(current_line, '^\(\s*\)#\{6} \(.*$\)', '\1# \2', ''))
|
||||
return
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
|
||||
|
||||
" Vim plugin file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
@@ -531,4 +532,5 @@ endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
|
||||
function! puppet#align#IndentLevel(lnum)
|
||||
return indent(a:lnum) / &shiftwidth
|
||||
endfunction
|
||||
@@ -67,4 +68,5 @@ function! puppet#align#AlignHashrockets(...) abort
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
|
||||
|
||||
if !exists('s:ctags_type')
|
||||
let s:ctags_type = 0
|
||||
endif
|
||||
@@ -35,4 +36,5 @@ function! puppet#ctags#Type()
|
||||
return s:ctags_type
|
||||
endfunction
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
|
||||
"
|
||||
" Simple format using puppet's l:indents and align hashrockets function
|
||||
function! puppet#format#Format() abort
|
||||
let l:start_lnum = v:lnum
|
||||
let l:end_lnum = v:lnum + v:count - 1
|
||||
" Don't modify indentation or alignment if called by textwidth. We'll only
|
||||
" let the fallback function do its thing in this case so that textwidth
|
||||
" still performs the expected feature.
|
||||
if mode() !~# '[iR]'
|
||||
call puppet#format#Indention(l:start_lnum, l:end_lnum)
|
||||
call puppet#format#Hashrocket(l:start_lnum, l:end_lnum)
|
||||
endif
|
||||
call puppet#format#Fallback(l:start_lnum, l:end_lnum)
|
||||
" explicitly avoid falling back to default formatting
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
""
|
||||
@@ -36,10 +44,16 @@ endfunction
|
||||
" lines which exeed &widthline are formated
|
||||
"
|
||||
function! puppet#format#Fallback(start_lnum, end_lnum) abort
|
||||
" We shouldn't wrap lines based on textwidth if it is disabled
|
||||
if &textwidth == 0
|
||||
return
|
||||
endif
|
||||
|
||||
" I'm using it to check if autoformat expand range
|
||||
let l:eof_lnum = line('$')
|
||||
let l:lnum = a:start_lnum
|
||||
let l:end_lnum = a:end_lnum
|
||||
|
||||
while l:lnum <= l:end_lnum
|
||||
if strlen(getline(l:lnum)) > &textwidth
|
||||
call cursor(l:lnum)
|
||||
@@ -56,4 +70,5 @@ function! puppet#format#Fallback(start_lnum, end_lnum) abort
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'python-compiler') == -1
|
||||
|
||||
" Sometimes Python issues debugging messages
|
||||
" which don't belong to a call stack context
|
||||
" this function filters these messages
|
||||
@@ -16,4 +17,5 @@ function! python#utils#fix_qflist() " {{{
|
||||
call setqflist(l:traceback)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||
|
||||
" Vim completion script
|
||||
" Language: Ruby
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
@@ -875,4 +876,5 @@ call s:DefRuby()
|
||||
"}}} ruby-side code
|
||||
|
||||
" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
" Author: Kevin Ballard
|
||||
|
||||
" Description: Helper functions for Rust commands/mappings
|
||||
" Last Modified: May 27, 2014
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
@@ -397,10 +397,19 @@ function! s:RmDir(path)
|
||||
echoerr 'Attempted to delete empty path'
|
||||
return 0
|
||||
elseif a:path ==# '/' || a:path ==# $HOME
|
||||
let l:path = expand(a:path)
|
||||
if l:path ==# '/' || l:path ==# $HOME
|
||||
echoerr 'Attempted to delete protected path: ' . a:path
|
||||
return 0
|
||||
endif
|
||||
return system("rm -rf " . shellescape(a:path))
|
||||
endif
|
||||
|
||||
if !isdirectory(a:path)
|
||||
return 0
|
||||
endif
|
||||
|
||||
" delete() returns 0 when removing file successfully
|
||||
return delete(a:path, 'rf') == 0
|
||||
endfunction
|
||||
|
||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||
@@ -500,14 +509,23 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
return matchstr(getline(test_func_line), '\m\C^\s*fn\s\+\zs\h\w*')
|
||||
endfunction
|
||||
|
||||
function! rust#Test(all, options) abort
|
||||
function! rust#Test(mods, winsize, all, options) abort
|
||||
let manifest = findfile('Cargo.toml', expand('%:p:h') . ';')
|
||||
if manifest ==# ''
|
||||
return rust#Run(1, '--test ' . a:options)
|
||||
endif
|
||||
|
||||
if has('terminal') || has('nvim')
|
||||
let cmd = 'terminal '
|
||||
" <count> defaults to 0, but we prefer an empty string
|
||||
let winsize = a:winsize ? a:winsize : ''
|
||||
|
||||
if has('terminal')
|
||||
if has('patch-8.0.910')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ++curwin ', a:mods, winsize)
|
||||
else
|
||||
let cmd = printf('%s terminal ', a:mods)
|
||||
endif
|
||||
elseif has('nvim')
|
||||
let cmd = printf('%s noautocmd %snew | terminal ', a:mods, winsize)
|
||||
else
|
||||
let cmd = '!'
|
||||
let manifest = shellescape(manifest)
|
||||
@@ -545,4 +563,5 @@ endfunction
|
||||
" }}}1
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" For debugging, inspired by https://github.com/w0rp/rust/blob/master/autoload/rust/debugging.vim
|
||||
|
||||
let s:global_variable_list = [
|
||||
@@ -102,4 +103,5 @@ function! rust#debugging#InfoToFile(filename) abort
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||
|
||||
" For this buffer, when delimitMate issues the `User delimitMate_map`
|
||||
@@ -43,4 +44,5 @@ endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" Tagbar support code, for the sake of not automatically overriding its
|
||||
" configuration in case Universal Ctags is detected.
|
||||
|
||||
@@ -7,7 +8,8 @@ let s:checked_ctags = 0
|
||||
|
||||
function! rust#tags#IsUCtags() abort
|
||||
if s:checked_ctags == 0
|
||||
if system('ctags --version') =~? 'universal ctags'
|
||||
let l:ctags_bin = get(g:, 'tagbar_ctags_bin', 'ctags')
|
||||
if system(l:ctags_bin.' --version') =~? 'universal ctags'
|
||||
let s:ctags_is_uctags = 1
|
||||
endif
|
||||
let s:checked_ctags = 1
|
||||
@@ -16,4 +18,5 @@ function! rust#tags#IsUCtags() abort
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||
"
|
||||
" Adapted from https://github.com/fatih/vim-go
|
||||
@@ -111,7 +112,7 @@ function! s:DeleteLines(start, end) abort
|
||||
silent! execute a:start . ',' . a:end . 'delete _'
|
||||
endfunction
|
||||
|
||||
function! s:RunRustfmt(command, tmpname, fail_silently)
|
||||
function! s:RunRustfmt(command, tmpname, from_writepre)
|
||||
mkview!
|
||||
|
||||
let l:stderr_tmpname = tempname()
|
||||
@@ -148,8 +149,10 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
||||
|
||||
let l:open_lwindow = 0
|
||||
if v:shell_error == 0
|
||||
if a:from_writepre
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
endif
|
||||
|
||||
if a:tmpname ==# ''
|
||||
let l:content = l:out
|
||||
@@ -169,7 +172,7 @@ function! s:RunRustfmt(command, tmpname, fail_silently)
|
||||
call setloclist(0, [])
|
||||
let l:open_lwindow = 1
|
||||
endif
|
||||
elseif g:rustfmt_fail_silently == 0 && a:fail_silently == 0
|
||||
elseif g:rustfmt_fail_silently == 0 && !a:from_writepre
|
||||
" otherwise get the errors and put them in the location list
|
||||
let l:errors = []
|
||||
|
||||
@@ -223,12 +226,12 @@ function! rustfmt#FormatRange(line1, line2)
|
||||
let l:tmpname = tempname()
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||
call s:RunRustfmt(command, l:tmpname, 0)
|
||||
call s:RunRustfmt(command, l:tmpname, v:false)
|
||||
call delete(l:tmpname)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#Format()
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', 0)
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', v:false)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#Cmd()
|
||||
@@ -256,9 +259,10 @@ function! rustfmt#PreWrite()
|
||||
return
|
||||
endif
|
||||
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', 1)
|
||||
call s:RunRustfmt(s:RustfmtCommand(), '', v:true)
|
||||
endfunction
|
||||
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'smt2') == -1
|
||||
|
||||
" Invokes the solver on current file
|
||||
function! smt2#RunSolver()
|
||||
silent !clear
|
||||
@@ -29,4 +30,5 @@ function! smt2#PrintSolverVersion()
|
||||
silent !clear
|
||||
execute "!" . g:smt2_solver_command . " " . g:smt2_solver_version_switch
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'terraform') == -1
|
||||
|
||||
" Ensure no conflict with arguments from the environment
|
||||
let $TF_CLI_ARGS_fmt=''
|
||||
|
||||
function! terraform#fmt()
|
||||
if !filereadable(expand('%:p'))
|
||||
return
|
||||
@@ -27,8 +31,8 @@ function! terraform#align()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! terraform#commands(A, L, P)
|
||||
return [
|
||||
function! terraform#commands(ArgLead, CmdLine, CursorPos)
|
||||
let l:commands = [
|
||||
\ 'apply',
|
||||
\ 'console',
|
||||
\ 'destroy',
|
||||
@@ -54,5 +58,7 @@ function! terraform#commands(A, L, P)
|
||||
\ 'push',
|
||||
\ 'state'
|
||||
\ ]
|
||||
return join(l:commands, "\n")
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||
|
||||
" common functions for vifm command-line editing buffer filetype plugins
|
||||
" Maintainer: xaizek <xaizek@posteo.net>
|
||||
" Last Change: August 18, 2013
|
||||
@@ -13,4 +14,5 @@ function! vifm#edit#Init()
|
||||
" Start buffer editing in insert mode
|
||||
startinsert
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
||||
|
||||
" common functions for vifm plugin related to globals
|
||||
" Maintainer: xaizek <xaizek@posteo.net>
|
||||
" Last Change: November 03, 2018
|
||||
@@ -30,4 +31,5 @@ function! vifm#globals#Init()
|
||||
let g:vifm_embed_term = has('gui_running')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
let s:_plugin_name = expand('<sfile>:t:r')
|
||||
|
||||
function! vital#{s:_plugin_name}#new() abort
|
||||
@@ -8,4 +9,5 @@ endfunction
|
||||
function! vital#{s:_plugin_name}#function(funcname) abort
|
||||
silent! return function(a:funcname)
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" ___vital___
|
||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||
" Do not mofidify the code nor insert new lines before '" ___vital___'
|
||||
@@ -186,4 +187,5 @@ endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" ___vital___
|
||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||
" Do not mofidify the code nor insert new lines before '" ___vital___'
|
||||
@@ -463,4 +464,5 @@ let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" ___vital___
|
||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||
" Do not mofidify the code nor insert new lines before '" ___vital___'
|
||||
@@ -626,4 +627,5 @@ endfunction
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" ___vital___
|
||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||
" Do not mofidify the code nor insert new lines before '" ___vital___'
|
||||
@@ -172,4 +173,5 @@ let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" ___vital___
|
||||
" NOTE: lines between '" ___vital___' is generated by :Vitalize.
|
||||
" Do not mofidify the code nor insert new lines before '" ___vital___'
|
||||
@@ -177,4 +178,5 @@ let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
let s:plugin_name = expand('<sfile>:t:r')
|
||||
let s:vital_base_dir = expand('<sfile>:h')
|
||||
let s:project_root = expand('<sfile>:h:h:h')
|
||||
@@ -327,4 +328,5 @@ else
|
||||
return a:list
|
||||
endfunction
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
crystal
|
||||
bee84ae23effb0510137ad177e98c94d8b3657a6
|
||||
|
||||
Process
|
||||
Web.JSON
|
||||
ColorEcho
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim completion for WAI-ARIA data file
|
||||
" Language: HTML + WAI-ARIA
|
||||
" Maintainer: othree <othree@gmail.com>
|
||||
@@ -456,4 +457,5 @@ let g:xmldata_aria = {
|
||||
\ 'default_role': default_role,
|
||||
\ 'vimariaattrinfo': aria_attributes_value
|
||||
\ }
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
|
||||
|
||||
" Vim completion for HTML5 data file
|
||||
" Language: HTML (version 5.1 Draft 2016 Jan 13)
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
@@ -745,6 +746,10 @@ let g:xmldata_html5 = {
|
||||
\ [],
|
||||
\ global_attributes
|
||||
\ ],
|
||||
\ 'slot': [
|
||||
\ [],
|
||||
\ extend(copy(global_attributes), {'name': []})
|
||||
\ ],
|
||||
\ 'small': [
|
||||
\ phrasing_elements,
|
||||
\ global_attributes
|
||||
@@ -869,4 +874,5 @@ let g:xmldata_html5 = {
|
||||
\ 'wbr': ['/>', ''],
|
||||
\ },
|
||||
\ }
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||
|
||||
function! zig#config#ListTypeCommands() abort
|
||||
return get(g:, 'zig_list_type_commands', {})
|
||||
endfunction
|
||||
@@ -38,4 +39,5 @@ endfunction
|
||||
function! zig#config#Debug() abort
|
||||
return get(g:, 'zig_debug', [])
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||
|
||||
" Adapted from fatih/vim-go: autoload/go/fmt.vim
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
@@ -165,4 +166,5 @@ function! zig#fmt#ToggleFmtAutoSave() abort
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||
|
||||
" Adapted from fatih/vim-go: autoload/go/list.vim
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
@@ -157,4 +158,5 @@ function! zig#list#Type(for) abort
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||
|
||||
" Adapted from vim-go: autoload/go/util.vim
|
||||
"
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
@@ -389,4 +390,5 @@ function! zig#util#HasDebug(flag)
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
5
build
5
build
@@ -233,7 +233,7 @@ PACKS="
|
||||
log:MTDL9/vim-log-highlighting
|
||||
lua:tbastos/vim-lua
|
||||
mako:sophacles/vim-bundle-mako
|
||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||
markdown:gabrielelana/vim-markdown
|
||||
mathematica:voldikss/vim-mma
|
||||
mdx:jxnblk/vim-mdx-js
|
||||
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
||||
@@ -243,7 +243,7 @@ PACKS="
|
||||
nix:LnL7/vim-nix
|
||||
objc:b4winckler/vim-objc
|
||||
ocaml:rgrinberg/vim-ocaml
|
||||
octave:vim-scripts/octave.vim--
|
||||
octave:McSinyx/vim-octave
|
||||
opencl:petRUShka/vim-opencl
|
||||
perl:vim-perl/vim-perl
|
||||
pgsql:lifepillar/pgsql.vim
|
||||
@@ -292,6 +292,7 @@ PACKS="
|
||||
tptp:c-cube/vim-tptp
|
||||
twig:lumiliet/vim-twig
|
||||
typescript:HerringtonDarkholme/yats.vim
|
||||
v:ollykel/v-vim
|
||||
vala:arrufat/vala.vim
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
vcl:smerrill/vcl-vim-plugin
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Mick Koch <mick@kochm.co>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
@@ -14,4 +15,5 @@ call coffee#CoffeeSetUpVariables()
|
||||
exec 'CompilerSet makeprg=' . escape(g:coffee_cake . ' ' .
|
||||
\ g:coffee_cake_options . ' $*', ' ')
|
||||
call coffee#CoffeeSetUpErrorFormat()
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: Cargo Compiler
|
||||
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||
@@ -48,4 +49,5 @@ unlet s:save_cpo
|
||||
" vint: +ProhibitAbbreviationOption
|
||||
|
||||
" vim: set et sw=4 sts=4 ts=8:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||
|
||||
" Language: CoffeeScript
|
||||
" Maintainer: Mick Koch <mick@kochm.co>
|
||||
" URL: http://github.com/kchmck/vim-coffee-script
|
||||
@@ -81,4 +82,5 @@ augroup CoffeeUpdateMakePrg
|
||||
autocmd BufWritePre,BufFilePost call s:UpdateMakePrg()
|
||||
endif
|
||||
augroup END
|
||||
|
||||
endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user