mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-18 08:23:40 -05:00
Compare commits
1 Commits
bfe3c80946
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f061eddb7c |
27
README.md
27
README.md
@@ -1,7 +1,3 @@
|
||||
This is my top-starred repository on Github, so I've decided to put this ad here:
|
||||
|
||||
If you work for big corp and seek consulting, please visit following repository: https://github.com/sheerun/consultation
|
||||
|
||||

|
||||
|
||||
A collection of language packs for Vim.
|
||||
@@ -9,7 +5,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-->599<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->598<!--/Package Count--> packages it consists of.
|
||||
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
||||
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
||||
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
||||
@@ -56,7 +52,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [bicep](https://github.com/carlsmedstad/vim-bicep) (Syntax highlighting for bicep files)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting for blade and blade.php files)
|
||||
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cppm and 20 more files)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cxx and 18 more files)
|
||||
- [caddyfile](https://github.com/isobit/vim-caddyfile)
|
||||
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx)
|
||||
@@ -78,7 +74,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [elm](https://github.com/andys8/vim-elm-syntax) (Elm syntax highlighting for elm files)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (EmberScript syntax highlighting for em and emberscript files)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (Syntax highlighting for emblem and em files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app, app.src, es, escript, hrl, xrl, yrl and yaws files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app.src, es, escript, hrl, xrl, yrl, app and yaws files)
|
||||
- [fennel](https://github.com/bakpakin/fennel.vim) (Syntax highlighting for fnl files)
|
||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (Syntax highlighting for ferm files)
|
||||
- [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files)
|
||||
@@ -86,8 +82,8 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files)
|
||||
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
|
||||
- [gitignore](https://github.com/SirJson/fzf-gitignore)
|
||||
- [gleam](https://github.com/gleam-lang/gleam.vim/tree/main) (Syntax highlighting for gleam files)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 19 more files)
|
||||
- [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 18 more files)
|
||||
- [gmpl](https://github.com/maelvalais/gmpl.vim) (Syntax highlighting for mod files)
|
||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (Gnuplot syntax highlighting for gp, gnu, gnuplot, p, plot, plt and gpi files)
|
||||
- [go](https://github.com/fatih/vim-go) (Go syntax highlighting for go and tmpl files)
|
||||
@@ -112,13 +108,13 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (Syntax highlighting for jenkinsfile and Jenkinsfile files)
|
||||
- [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files)
|
||||
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files)
|
||||
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 16 more files)
|
||||
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 15 more files)
|
||||
- [jsonc](https://github.com/neoclide/jsonc.vim) (Syntax highlighting for cjson and jsonc files)
|
||||
- [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting for jsonnet and libsonnet files)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files)
|
||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (Syntax highlighting for jsx files)
|
||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (Julia syntax highlighting for jl files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just/tree/main) (Syntax highlighting for just files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just) (Syntax highlighting for just files)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (Kotlin syntax highlighting for kt, ktm and kts files)
|
||||
- [ledger](https://github.com/ledger/vim-ledger) (Syntax highlighting for ldg, ledger and journal files)
|
||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond/tree/main) (LilyPond syntax highlighting for ly and ily files)
|
||||
@@ -150,16 +146,15 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
|
||||
- [pony](https://github.com/dleonard0/pony-vim-syntax) (Pony syntax highlighting for pony files)
|
||||
- [pony](https://github.com/jakwings/vim-pony) (Pony syntax highlighting for pony files)
|
||||
- [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files)
|
||||
- [prisma](https://github.com/prisma/vim-prisma) (Prisma syntax highlighting for prisma files)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (Protocol Buffer syntax highlighting for proto files)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting for jade and pug files)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (Puppet syntax highlighting for pp and epp files)
|
||||
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting for purs files)
|
||||
- [python-compiler](https://github.com/aliev/vim-compiler-python)
|
||||
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 13 more files)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 14 more files)
|
||||
- [qmake](https://github.com/artoj/qmake-syntax-vim) (QMake syntax highlighting for pro and pri files)
|
||||
- [qml](https://github.com/peterhoeg/vim-qml) (QML syntax highlighting for qml and qbs files)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting for r, rsx, s, S and rd files)
|
||||
@@ -205,11 +200,11 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files)
|
||||
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 100 more files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 97 more files)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
|
||||
- [yard](https://github.com/noprompt/vim-yardoc)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting for zir, zig, zig.zon and zir files)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting for zir, zig and zir files)
|
||||
- [zinit](https://github.com/zdharma-continuum/zinit-vim-syntax/tree/main)
|
||||
<!--/Language Packs-->
|
||||
|
||||
|
||||
11
after/ftplugin/just.vim
Normal file
11
after/ftplugin/just.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'after/ftplugin/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2021 May 19
|
||||
|
||||
setlocal iskeyword+=-
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/php.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" Original Author: Mikhail Wolfson <mywolfson@gmail.com>
|
||||
" Maintainer: bfrg <https://github.com/bfrg>
|
||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||
" Last Change: Jul 9, 2024
|
||||
" Last Change: Jul 24, 2021
|
||||
"
|
||||
" This syntax file is based on:
|
||||
" https://github.com/octol/vim-cpp-enhanced-highlight
|
||||
@@ -21,10 +21,8 @@ syn keyword cTodo contained BUG NOTE
|
||||
|
||||
" Highlight function names
|
||||
if get(g:, 'cpp_function_highlight', 1)
|
||||
syn match cUserFunction "\<\h\w*\ze\_s\{-}(\%(\*\h\w*)\_s\{-}(\)\@!"
|
||||
syn match cUserFunctionPointer "\%((\s*\*\s*\)\@6<=\h\w*\ze\s*)\_s\{-}(.*)"
|
||||
syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cParen,cCppParen
|
||||
hi def link cUserFunction Function
|
||||
hi def link cUserFunctionPointer Function
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" Original Author: Jon Haggblad <https://github.com/octol>
|
||||
" Maintainer: bfrg <https://github.com/bfrg>
|
||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||
" Last Change: Oct 13, 2023
|
||||
" Last Change: Sep 15, 2022
|
||||
"
|
||||
" This syntax file is based on:
|
||||
" https://github.com/octol/vim-cpp-enhanced-highlight
|
||||
@@ -177,9 +177,9 @@ endif
|
||||
|
||||
" C++23 extensions {{{1
|
||||
if !exists('cpp_no_cpp23')
|
||||
syntax keyword cppSTLtype basic_stacktrace stacktrace_entry is_scoped_enum mdspan extents default_accessor layout_left layout_right layout_stride flat_set flat_map flat_multiset flat_multimap is_implicit_lifetime reference_constructs_from_temporary reference_converts_from_temporary
|
||||
syntax keyword cppSTLtypedef stacktrace dextents
|
||||
syntax keyword cppSTLbool is_implicit_lifetime_v is_scoped_enum_v reference_constructs_from_temporary_v reference_converts_from_temporary_v
|
||||
syntax keyword cppSTLtype basic_stacktrace stacktrace_entry is_scoped_enum
|
||||
syntax keyword cppSTLtypedef stacktrace
|
||||
syntax keyword cppSTLbool is_scoped_enum_v
|
||||
syntax keyword cppSTLfunction invoke_r
|
||||
syntax keyword cppSTLtype expected unexpected unexpect_t bad_expected_access
|
||||
syntax keyword cppSTLvariable unexpect
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/php/g
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/reaso
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/rescr
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
24
autoload/coc/source/requirements.vim
Normal file
24
autoload/coc/source/requirements.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/coc/source/requirements.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
function! coc#source#requirements#init() abort
|
||||
return {
|
||||
\ 'shortcut': 'pip',
|
||||
\ 'priority': 9,
|
||||
\ 'filetypes': ['requirements'],
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
""
|
||||
" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source
|
||||
"
|
||||
" Completion pip option and PYPI package names.
|
||||
" Note: completion PYPI package names need install pip-cache from PYPI,
|
||||
" and run `pip-cache update` first to generate cache.
|
||||
function! coc#source#requirements#complete(opt, cb) abort
|
||||
call a:cb(g:requirements#items)
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
216
autoload/csv.vim
216
autoload/csv.vim
@@ -224,11 +224,11 @@ endfu
|
||||
|
||||
fu! csv#RemoveAutoHighlight() "{{{3
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au! "
|
||||
exe "au! CursorMoved <buffer=".bufnr('').">"
|
||||
aug end
|
||||
exe "aug! CSV_HI".bufnr('')
|
||||
" Remove any existing highlighting
|
||||
call csv#HiCol('', 1)
|
||||
HiColumn!
|
||||
endfu
|
||||
|
||||
fu! csv#DoAutoCommands() "{{{3
|
||||
@@ -246,8 +246,9 @@ fu! csv#DoAutoCommands() "{{{3
|
||||
endif
|
||||
" undo autocommand:
|
||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI'.bufnr('').' CursorMoved <buffer> "'
|
||||
let b:undo_ftplugin .= '| call csv#RemoveAutoHighlight()'
|
||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI'.bufnr('').'"'
|
||||
let b:undo_ftplugin = 'exe "sil! HiColumn!" |' . b:undo_ftplugin
|
||||
|
||||
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
||||
augroup CSV_Menu
|
||||
au!
|
||||
@@ -442,14 +443,10 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
if exists("s:matchid")
|
||||
" ignore errors, that come from already deleted matches
|
||||
sil! call matchdelete(s:matchid)
|
||||
if a:bang
|
||||
unlet! s:matchid
|
||||
return
|
||||
endif
|
||||
endif
|
||||
" Additionally, filter all matches, that could have been used earlier
|
||||
let matchlist=getmatches()
|
||||
call filter(matchlist, 'v:val["group"] !~? s:hiGroup')
|
||||
call filter(matchlist, 'v:val["group"] !~ s:hiGroup')
|
||||
call setmatches(matchlist)
|
||||
if a:bang
|
||||
return
|
||||
@@ -458,10 +455,6 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
elseif !a:bang
|
||||
exe ":2match " . s:hiGroup . ' /' . pat . '/'
|
||||
endif
|
||||
" Remove Highlighting once switching away from the buffer
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au BufWinLeave <buffer=".bufnr('')."> call csv#RemoveAutoHighlight()"
|
||||
aug end
|
||||
endfu
|
||||
fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" This depends on the locale. Hopefully it works
|
||||
@@ -489,16 +482,12 @@ fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" :silent :s does not work with lazyredraw
|
||||
let _lz = &lz
|
||||
set nolz
|
||||
" substitute without output when cmdheight=0
|
||||
let _cmdheight = &cmdheight
|
||||
set cmdheight=1
|
||||
for i in values(Delim)
|
||||
redir => temp[i]
|
||||
" use very non-magic
|
||||
exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
|
||||
redir END
|
||||
endfor
|
||||
let &cmdheight = _cmdheight
|
||||
let &lz = _lz
|
||||
let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")')
|
||||
let Delim = filter(temp, 'v:val=~''\d''')
|
||||
@@ -790,11 +779,7 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" does not work with fixed width columns
|
||||
" row for the row for which to calculate the width
|
||||
let b:col_width=[]
|
||||
let vts_save=""
|
||||
if has( 'vartabs' ) && b:delimiter == "\t"
|
||||
if &l:vts
|
||||
let vts_save=&vts
|
||||
endif
|
||||
setlocal vts=
|
||||
endif
|
||||
try
|
||||
@@ -815,9 +800,6 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" delete buffer content in variable b:csv_list,
|
||||
" this was only necessary for calculating the max width
|
||||
unlet! b:csv_list s:columnize_count s:decimal_column
|
||||
if vts_save
|
||||
let &l:vts=vts_save
|
||||
endif
|
||||
endfu
|
||||
fu! csv#Columnize(field) "{{{3
|
||||
" Internal function, not called from external,
|
||||
@@ -885,7 +867,7 @@ fu! csv#Columnize(field) "{{{3
|
||||
if get(s:decimal_column, colnr, 0) == 0
|
||||
call csv#CheckHeaderLine()
|
||||
call csv#NumberFormat()
|
||||
let data = csv#CopyCol('', colnr+1, '', 0)[s:csv_fold_headerline : -1]
|
||||
let data = csv#CopyCol('', colnr+1, '')[s:csv_fold_headerline : -1]
|
||||
let pat1 = escape(s:nr_format[1], '.').'\zs[^'.s:nr_format[1].']*\ze'.
|
||||
\ (has_delimiter ? b:delimiter : '').'$'
|
||||
let pat2 = '\d\+\ze\%(\%('.escape(s:nr_format[1], '.'). '\d\+\)\|'.
|
||||
@@ -1019,9 +1001,9 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3
|
||||
setl scrollopt=ver scrollbind cursorbind
|
||||
noa 0
|
||||
if a:lines[-1:] is? '!'
|
||||
let a=csv#CopyCol('',a:lines,'', 0)
|
||||
let a=csv#CopyCol('',a:lines,'')
|
||||
else
|
||||
let a=csv#CopyCol('',1, a:lines-1, 0)
|
||||
let a=csv#CopyCol('',1, a:lines-1)
|
||||
endif
|
||||
" Does it make sense to use the preview window?
|
||||
"vert sil! pedit |wincmd w | enew!
|
||||
@@ -1258,7 +1240,7 @@ fu! csv#Sort(bang, line1, line2, colnr) range "{{{3
|
||||
\' r'. flag. ' /' . pat . '/'
|
||||
call winrestview(wsv)
|
||||
endfun
|
||||
fu! csv#CopyCol(reg, col, cnt, bang) "{{{3
|
||||
fu! csv#CopyCol(reg, col, cnt) "{{{3
|
||||
" Return Specified Column into register reg
|
||||
let col = a:col == "0" ? csv#WColumn() : a:col+0
|
||||
let mcol = csv#MaxColumns()
|
||||
@@ -1272,18 +1254,11 @@ fu! csv#CopyCol(reg, col, cnt, bang) "{{{3
|
||||
let cnt_cols = col + a:cnt - 1
|
||||
endif
|
||||
let a = []
|
||||
let first = 1
|
||||
call csv#CheckHeaderLine()
|
||||
if a:bang && first <= s:csv_fold_headerline
|
||||
" don't take the header line into consideration
|
||||
let first = s:csv_fold_headerline + 1
|
||||
endif
|
||||
|
||||
" Don't get lines, that are currently filtered away
|
||||
if !exists("b:csv_filter") || empty(b:csv_filter)
|
||||
let a=getline(first, '$')
|
||||
let a=getline(1, '$')
|
||||
else
|
||||
for line in range(first, line('$'))
|
||||
for line in range(1, line('$'))
|
||||
if foldlevel(line)
|
||||
continue
|
||||
else
|
||||
@@ -1711,7 +1686,7 @@ fu! csv#DoForEachColumn(start, stop, bang) range "{{{3
|
||||
endif
|
||||
|
||||
for item in range(a:start, a:stop, 1)
|
||||
if foldlevel(item)
|
||||
if foldlevel(line)
|
||||
" Filter out folded lines (from dynamic filter)
|
||||
continue
|
||||
endif
|
||||
@@ -1744,7 +1719,7 @@ fu! csv#DoForEachColumn(start, stop, bang) range "{{{3
|
||||
endfor
|
||||
endif
|
||||
for j in range(1, columns, 1)
|
||||
let t=substitute(t, '%s', get(fields, j-1, ''), '')
|
||||
let t=substitute(t, '%s', fields[j-1], '')
|
||||
endfor
|
||||
call add(result, t)
|
||||
endfor
|
||||
@@ -1763,7 +1738,7 @@ fu! csv#PrepareDoForEachColumn(start, stop, bang) range"{{{3
|
||||
let post = exists("g:csv_post_convert") ? g:csv_post_convert : ''
|
||||
let g:csv_post_convert=input('Post convert text: ', post)
|
||||
let convert = exists("g:csv_convert") ? g:csv_convert : ''
|
||||
let g:csv_convert=input("How to convert data (use %s for column input):\n", convert)
|
||||
let g:csv_convert=input("Converted text, use %s for column input:\n", convert)
|
||||
call csv#DoForEachColumn(a:start, a:stop, a:bang)
|
||||
endfun
|
||||
fu! csv#EscapeValue(val) "{{{3
|
||||
@@ -2011,7 +1986,7 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
||||
|
||||
" Initialize csv#fold_headerline
|
||||
call csv#CheckHeaderLine()
|
||||
let data = csv#CopyCol('', colnr, '', 0)[s:csv_fold_headerline : -1]
|
||||
let data = csv#CopyCol('', colnr, '')[s:csv_fold_headerline : -1]
|
||||
let qty = len(data)
|
||||
let res = {}
|
||||
for item in data
|
||||
@@ -2284,45 +2259,100 @@ fu! csv#CSVMappings() "{{{3
|
||||
endif
|
||||
endfu
|
||||
fu! csv#CommandDefinitions() "{{{3
|
||||
call csv#LocalCmd("AddColumn", ':call csv#AddColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)', '-nargs=*' )
|
||||
call csv#LocalCmd("ArrangeColumn", ':call csv#ArrangeCol(<line1>, <line2>, <bang>0, -1, <q-args>)', '-range -bang -bar -nargs=?')
|
||||
call csv#LocalCmd("AvgCol", ':echo csv#EvalColumn(<q-args>, "csv#AvgColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
||||
call csv#LocalCmd("CSVInit", ':call csv#Init(<line1>,<line2>,<bang>0)', '-bang -range=%')
|
||||
call csv#LocalCmd("Column", ':call csv#CopyCol(empty(<q-reg>)?''"'':<q-reg>,<q-count>,<q-args>, <bang>0)', '-bang -count -register -nargs=?')
|
||||
call csv#LocalCmd("ConvertData", ':call csv#PrepareDoForEachColumn(<line1>,<line2>,<bang>0)', '-bang -nargs=0 -range=%')
|
||||
call csv#LocalCmd("CountCol", ':echo csv#EvalColumn(<q-args>, "csv#CountColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DeleteColumn", ':call csv#DeleteColumn(<q-args>)', '-nargs=? -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DupColumn", ':call csv#DupColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates(<q-args>)', '-nargs=? -complete=custom,csv#CompleteColumnNr')
|
||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)', '-nargs=0 -bang')
|
||||
call csv#LocalCmd("HeaderToggle", ':call csv#SplitHeaderToggle(1)', '')
|
||||
call csv#LocalCmd("HiColumn", ':call csv#HiCol(<q-args>,<bang>0)', '-bang -nargs=?')
|
||||
call csv#LocalCmd("MaxCol", ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 1)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MinCol", ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 0)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MoveColumn", ':call csv#MoveColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("NewDelimiter", ':call csv#NewDelimiter(<q-args>, 1, line(''$''))', '-nargs=1')
|
||||
call csv#LocalCmd("NewRecord", ':call csv#NewRecord(<line1>, <line2>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd("WhatColumn", ':echo csv#WColumn(<bang>0)',
|
||||
\ '-bang')
|
||||
call csv#LocalCmd("NrColumns", ':call csv#NrColumns(<q-bang>)', '-bang')
|
||||
call csv#LocalCmd("PopStdCol", ':echo csv#EvalColumn(<q-args>, "csv#PopStdDevColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopVarCol", ':echo csv#EvalColumn(<q-args>, "csv#PopVarianceColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SearchInColumn", ':call csv#SearchColumn(<q-args>)', '-nargs=*')
|
||||
call csv#LocalCmd("SmplStdCol", ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SmplVarCol", ':echo csv#EvalColumn(<q-args>, "csv#SmplVarianceColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Sort", ':call csv#Sort(<bang>0, <line1>,<line2>,<q-args>)', '-nargs=* -bang -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SumCol", ':echo csv#EvalColumn(<q-args>, "csv#SumColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("UnArrangeColumn", ':call csv#PrepUnArrangeCol(<line1>, <line2>)', '-bar -range')
|
||||
call csv#LocalCmd("VHeaderToggle", ':call csv#SplitHeaderToggle(0)', '')
|
||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)', '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("WhatColumn", ':echo csv#WColumn(<bang>0)', '-bang')
|
||||
call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(<bang>0,<line1>,<line2>)', '-bang -range=%')
|
||||
call csv#LocalCmd("HiColumn", ':call csv#HiCol(<q-args>,<bang>0)',
|
||||
\ '-bang -nargs=?')
|
||||
call csv#LocalCmd("SearchInColumn",
|
||||
\ ':call csv#SearchColumn(<q-args>)', '-nargs=*')
|
||||
call csv#LocalCmd("DeleteColumn", ':call csv#DeleteColumn(<q-args>)',
|
||||
\ '-nargs=? -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("ArrangeColumn",
|
||||
\ ':call csv#ArrangeCol(<line1>, <line2>, <bang>0, -1, <q-args>)',
|
||||
\ '-range -bang -bar -nargs=?')
|
||||
call csv#LocalCmd("SmplVarCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplVarianceColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopVarCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#PopVarianceColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SmplStdCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopStdCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#PopStdDevColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("UnArrangeColumn",
|
||||
\':call csv#PrepUnArrangeCol(<line1>, <line2>)',
|
||||
\ '-bar -range')
|
||||
call csv#LocalCmd("CSVInit", ':call csv#Init(<line1>,<line2>,<bang>0)',
|
||||
\ '-bang -range=%')
|
||||
call csv#LocalCmd('Header',
|
||||
\ ':call csv#SplitHeaderLine(<q-args>,<bang>0,1)',
|
||||
\ '-nargs=? -bang')
|
||||
call csv#LocalCmd('VHeader',
|
||||
\ ':call csv#SplitHeaderLine(<q-args>,<bang>0,0)',
|
||||
\ '-nargs=? -bang')
|
||||
call csv#LocalCmd("HeaderToggle",
|
||||
\ ':call csv#SplitHeaderToggle(1)', '')
|
||||
call csv#LocalCmd("VHeaderToggle",
|
||||
\ ':call csv#SplitHeaderToggle(0)', '')
|
||||
call csv#LocalCmd("Sort",
|
||||
\ ':call csv#Sort(<bang>0, <line1>,<line2>,<q-args>)',
|
||||
\ '-nargs=* -bang -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Column",
|
||||
\ ':call csv#CopyCol(empty(<q-reg>)?''"'':<q-reg>,<q-count>,<q-args>)',
|
||||
\ '-count -register -nargs=?')
|
||||
call csv#LocalCmd("MoveColumn",
|
||||
\ ':call csv#MoveColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SumCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SumColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MaxCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 1)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MinCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 0)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CountCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#CountColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("AvgCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#AvgColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd('SumRow', ':call csv#SumCSVRow(<q-count>, <q-args>)',
|
||||
\ '-nargs=? -range')
|
||||
call csv#LocalCmd("ConvertData",
|
||||
\ ':call csv#PrepareDoForEachColumn(<line1>,<line2>,<bang>0)',
|
||||
\ '-bang -nargs=? -range=%')
|
||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)',
|
||||
\ '-nargs=0 -bang')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)',
|
||||
\ '-nargs=*' )
|
||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)',
|
||||
\ '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
||||
call csv#LocalCmd("NewRecord", ':call csv#NewRecord(<line1>,
|
||||
\ <line2>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd("NewDelimiter", ':call csv#NewDelimiter(<q-args>, 1, line(''$''))',
|
||||
\ '-nargs=1')
|
||||
call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates(<q-args>)',
|
||||
\ '-nargs=? -complete=custom,csv#CompleteColumnNr')
|
||||
call csv#LocalCmd('Transpose', ':call csv#Transpose(<line1>, <line2>)',
|
||||
\ '-range=%')
|
||||
call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(<bang>0,<line1>,<line2>)',
|
||||
\ '-bang -range=%')
|
||||
call csv#LocalCmd("AddColumn",
|
||||
\ ':call csv#AddColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DupColumn",
|
||||
\ ':call csv#DupColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd('Substitute', ':call csv#SubstituteInColumn(<q-args>,<line1>,<line2>)',
|
||||
\ '-nargs=1 -range=%')
|
||||
call csv#LocalCmd('ColumnWidth', ':call csv#ColumnWidth()', '')
|
||||
call csv#LocalCmd('Header', ':call csv#SplitHeaderLine(<q-args>,<bang>0,1)', '-nargs=? -bang')
|
||||
call csv#LocalCmd('Substitute', ':call csv#SubstituteInColumn(<q-args>,<line1>,<line2>)', '-nargs=1 -range=%')
|
||||
call csv#LocalCmd('SumRow', ':call csv#SumCSVRow(<q-count>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd('Transpose', ':call csv#Transpose(<line1>, <line2>)', '-range=%')
|
||||
call csv#LocalCmd('VHeader', ':call csv#SplitHeaderLine(<q-args>,<bang>0,0)', '-nargs=? -bang')
|
||||
endfu
|
||||
fu! csv#ColumnWidth()
|
||||
let w=CSVWidth()
|
||||
@@ -2606,21 +2636,21 @@ fu! csv#Tabularize(bang, first, last) "{{{3
|
||||
endif
|
||||
let _c = winsaveview()
|
||||
" Table delimiter definition "{{{4
|
||||
let use_unicode = &enc =~# 'utf-8' && get(g:, 'csv_table_use_ascii', 0) == 0
|
||||
let s:td = {
|
||||
\ 'hbar': (use_unicode ? '─' : '-'),
|
||||
\ 'vbar': (use_unicode ? '│' : '|'),
|
||||
\ 'scol': (use_unicode ? '├' : '|'),
|
||||
\ 'ecol': (use_unicode ? '┤' : '|'),
|
||||
\ 'ltop': (use_unicode ? '┌' : '+'),
|
||||
\ 'rtop': (use_unicode ? '┐' : '+'),
|
||||
\ 'lbot': (use_unicode ? '└' : '+'),
|
||||
\ 'rbot': (use_unicode ? '┘' : '+'),
|
||||
\ 'cros': (use_unicode ? '┼' : '+'),
|
||||
\ 'dhor': (use_unicode ? '┬' : '-'),
|
||||
\ 'uhor': (use_unicode ? '┴' : '-')
|
||||
if !exists("s:td")
|
||||
let s:td = {
|
||||
\ 'hbar': (&enc =~# 'utf-8' ? '─' : '-'),
|
||||
\ 'vbar': (&enc =~# 'utf-8' ? '│' : '|'),
|
||||
\ 'scol': (&enc =~# 'utf-8' ? '├' : '|'),
|
||||
\ 'ecol': (&enc =~# 'utf-8' ? '┤' : '|'),
|
||||
\ 'ltop': (&enc =~# 'utf-8' ? '┌' : '+'),
|
||||
\ 'rtop': (&enc =~# 'utf-8' ? '┐' : '+'),
|
||||
\ 'lbot': (&enc =~# 'utf-8' ? '└' : '+'),
|
||||
\ 'rbot': (&enc =~# 'utf-8' ? '┘' : '+'),
|
||||
\ 'cros': (&enc =~# 'utf-8' ? '┼' : '+'),
|
||||
\ 'dhor': (&enc =~# 'utf-8' ? '┬' : '-'),
|
||||
\ 'uhor': (&enc =~# 'utf-8' ? '┴' : '-')
|
||||
\ }
|
||||
"}}}4
|
||||
endif "}}}4
|
||||
if match(getline(a:first), '^'.s:td.ltop) > -1
|
||||
" Already tabularized, done
|
||||
call csv#Warn("Looks already Tabularized, aborting!")
|
||||
@@ -2964,7 +2994,7 @@ fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3
|
||||
let stop += s:csv_fold_headerline
|
||||
endif
|
||||
|
||||
let column = csv#CopyCol('', col, '', 0)[start : stop]
|
||||
let column = csv#CopyCol('', col, '')[start : stop]
|
||||
let column = csv#GetCells(column)
|
||||
" Delete empty values
|
||||
" Leave this up to the function that does something
|
||||
@@ -3083,7 +3113,7 @@ fu! CSVField(x, y, ...) "{{{3
|
||||
let orig = !empty(a:0)
|
||||
let y = (y < 0 ? 0 : y)
|
||||
let x = (x > (csv#MaxColumns()) ? (csv#MaxColumns()) : x)
|
||||
let col = csv#CopyCol('',x,'',0)
|
||||
let col = csv#CopyCol('',x,'')
|
||||
if !orig
|
||||
" remove leading and trainling whitespace and the delimiter
|
||||
return matchstr(col[y], '^\s*\zs.\{-}\ze\s*'.b:delimiter.'\?$')
|
||||
|
||||
@@ -72,7 +72,7 @@ endfunction
|
||||
|
||||
function! s:in_embedded_view()
|
||||
let groups = map(synstack(line('.'), col('.')), "synIDattr(v:val, 'name')")
|
||||
for group in ['elixirPhoenixESigil', 'elixirLiveViewSigil', 'elixirSurfaceSigil', 'elixirHeexSigil']
|
||||
for group in ['elixirPhoenixESigil', 'elixirLiveViewSigil', 'elixirSurfaceSigil']
|
||||
if index(groups, group) >= 0
|
||||
return 1
|
||||
endif
|
||||
@@ -383,7 +383,7 @@ endfunction
|
||||
" function, etc... so we need to first figure out what the innermost structure
|
||||
" is then forward execution to the proper handler
|
||||
function! elixir#indent#handle_inside_block(context)
|
||||
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|\<quote\>\|{\|\[\|(\)'
|
||||
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|{\|\[\|(\)'
|
||||
let end_pattern = '\C\%(\<end\>\|\]\|}\|)\)'
|
||||
" hack - handle do: better
|
||||
let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind]))
|
||||
@@ -398,7 +398,6 @@ function! elixir#indent#handle_inside_block(context)
|
||||
let never_match = ''
|
||||
let config = {
|
||||
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'q': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')},
|
||||
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},
|
||||
|
||||
@@ -153,5 +153,5 @@ function! fish#Complete(findstart, base)
|
||||
endfunction
|
||||
|
||||
function! fish#errorformat()
|
||||
return '%E%f (line %l):%m,%C%p^%.%#,%-C%.%#'
|
||||
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
||||
endfunction
|
||||
|
||||
@@ -167,10 +167,7 @@ let s:config_keys_camel =
|
||||
\ {'key': 'ExcludeProjectDirectories', 'default': []},
|
||||
\ {'key': 'keywordsAutocomplete', 'default': 1},
|
||||
\ {'key': 'ExternalAutocomplete', 'default': 0},
|
||||
\ {'key': 'FullNameExternalAutocomplete', 'default': 0},
|
||||
\ {'key': 'Linter', 'default': 1},
|
||||
\ {'key': 'LinterConfig'},
|
||||
\ {'key': 'IndentationSize', 'default': 4},
|
||||
\ {'key': 'UnionCaseStubGeneration', 'default': 1},
|
||||
\ {'key': 'UnionCaseStubGenerationBody'},
|
||||
\ {'key': 'RecordStubGeneration', 'default': 1},
|
||||
@@ -178,39 +175,18 @@ let s:config_keys_camel =
|
||||
\ {'key': 'InterfaceStubGeneration', 'default': 1},
|
||||
\ {'key': 'InterfaceStubGenerationObjectIdentifier', 'default': 'this'},
|
||||
\ {'key': 'InterfaceStubGenerationMethodBody'},
|
||||
\ {'key': 'AddPrivateAccessModifier', 'default': 0},
|
||||
\ {'key': 'UnusedOpensAnalyzer', 'default': 1},
|
||||
\ {'key': 'UnusedOpensAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'UnusedDeclarationsAnalyzer', 'default': 1},
|
||||
\ {'key': 'UnusedDeclarationsAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'SimplifyNameAnalyzer', 'default': 0},
|
||||
\ {'key': 'SimplifyNameAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'UnnecessaryParenthesesAnalyzer', 'default': 0},
|
||||
\ {'key': 'ResolveNamespaces', 'default': 1},
|
||||
\ {'key': 'EnableReferenceCodeLens', 'default': 1},
|
||||
\ {'key': 'EnableAnalyzers', 'default': 0},
|
||||
\ {'key': 'AnalyzersPath'},
|
||||
\ {'key': 'ExcludeAnalyzers'},
|
||||
\ {'key': 'IncludeAnalyzers'},
|
||||
\ {'key': 'DisableInMemoryProjectReferences', 'default': 0},
|
||||
\ {'key': 'LineLens', 'default': {'enabled': 'never', 'prefix': ''}},
|
||||
\ {'key': 'UseSdkScripts', 'default': 1},
|
||||
\ {'key': 'dotNetRoot'},
|
||||
\ {'key': 'fsiExtraParameters'},
|
||||
\ {'key': 'fsiExtraInteractiveParameters', 'default': ['--readline-']},
|
||||
\ {'key': 'fsiExtraSharedParameters', 'default': []},
|
||||
\ {'key': 'fsiCompilerToolLocations', 'default': []},
|
||||
\ {'key': 'TooltipMode', 'default': 'full'},
|
||||
\ {'key': 'GenerateBinlog', 'default': 0},
|
||||
\ {'key': 'AbstractClassStubGeneration', 'default': 1},
|
||||
\ {'key': 'AbstractClassStubGenerationObjectIdentifier', 'default': 'this'},
|
||||
\ {'key': 'AbstractClassStubGenerationMethodBody', 'default': 'failwith "Not Implemented"'},
|
||||
"\ {'key': 'CodeLenses', TODO},
|
||||
"\ {'key': 'PipelineHints', TODO}
|
||||
"\ {'key': 'InlayHints', TODO}
|
||||
"\ {'key': 'Fsac', TODO}
|
||||
"\ {'key': 'Notifications', TODO}
|
||||
"\ {'key': 'Debug', TODO}
|
||||
\ {'key': 'fsiExtraParameters', 'default': []},
|
||||
\ ]
|
||||
let s:config_keys = []
|
||||
|
||||
@@ -262,7 +238,7 @@ function! fsharp#loadConfig()
|
||||
endif
|
||||
|
||||
if !exists('g:fsharp#fsautocomplete_command')
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete']
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete', '--background-service-enabled']
|
||||
endif
|
||||
if !exists('g:fsharp#use_recommended_server_config')
|
||||
let g:fsharp#use_recommended_server_config = 1
|
||||
@@ -435,10 +411,6 @@ endfunction
|
||||
|
||||
let s:workspace = []
|
||||
|
||||
function! fsharp#getLoadedProjects()
|
||||
return copy(s:workspace)
|
||||
endfunction
|
||||
|
||||
function! fsharp#handle_notifyWorkspace(payload) abort
|
||||
let content = json_decode(a:payload.content)
|
||||
if content.Kind == 'projectLoading'
|
||||
@@ -560,16 +532,7 @@ endfunction
|
||||
|
||||
function! s:get_fsi_command()
|
||||
let cmd = g:fsharp#fsi_command
|
||||
if exists("g:fsharp#fsi_extra_parameters")
|
||||
echom "[Ionide-vim]: `g:fsharp#fsi_extra_parameters` is being deprecated. Migrate to `g:fsharp#fsi_extra_interactive_parameters` and `g:fsharp_extra_shared_parameters`."
|
||||
for prm in g:fsharp#fsi_extra_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
endif
|
||||
for prm in g:fsharp#fsi_extra_interactive_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
for prm in g:fsharp#fsi_extra_shared_parameters
|
||||
for prm in g:fsharp#fsi_extra_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
return cmd
|
||||
@@ -621,7 +584,7 @@ function! fsharp#openFsi(returnFocus)
|
||||
if a:returnFocus | call s:win_gotoid_safe(current_win) | endif
|
||||
return s:fsi_buffer
|
||||
else
|
||||
echom "[FSAC] Your (neo)vim does not support terminal."
|
||||
echom "[FSAC] Your (neo)vim does not support terminal".
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -141,6 +141,32 @@ function! go#config#ListAutoclose() abort
|
||||
return get(g:, 'go_list_autoclose', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#InfoMode() abort
|
||||
return get(g:, 'go_info_mode', 'gopls')
|
||||
endfunction
|
||||
|
||||
function! go#config#GuruScope() abort
|
||||
let scope = get(g:, 'go_guru_scope', [])
|
||||
|
||||
if !empty(scope)
|
||||
" strip trailing slashes for each path in scope. bug:
|
||||
" https://github.com/golang/go/issues/14584
|
||||
let scopes = go#util#StripTrailingSlash(scope)
|
||||
endif
|
||||
|
||||
return scope
|
||||
endfunction
|
||||
|
||||
function! go#config#SetGuruScope(scope) abort
|
||||
if empty(a:scope)
|
||||
if exists('g:go_guru_scope')
|
||||
unlet g:go_guru_scope
|
||||
endif
|
||||
else
|
||||
let g:go_guru_scope = a:scope
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! go#config#EchoCommandInfo() abort
|
||||
return get(g:, 'go_echo_command_info', 1)
|
||||
endfunction
|
||||
@@ -178,10 +204,6 @@ function! go#config#Debug() abort
|
||||
return get(g:, 'go_debug', [])
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugLogDelay() abort
|
||||
return get(g:, 'go_debug_log_delay', 10)
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugWindows() abort
|
||||
return get(g:, 'go_debug_windows', {
|
||||
\ 'vars': 'leftabove 30vnew',
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'autoload/graphql.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
@@ -25,12 +25,6 @@ endif
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
|
||||
" Look up the named variable in buffer scope and then in global scope.
|
||||
" Returns default if the named variable can't be found in either.
|
||||
function! graphql#var(name, default) abort
|
||||
return get(b:, a:name, get(g:, a:name, a:default))
|
||||
endfunction
|
||||
|
||||
function! graphql#has_syntax_group(group) abort
|
||||
try
|
||||
silent execute 'silent highlight ' . a:group
|
||||
@@ -41,5 +35,5 @@ function! graphql#has_syntax_group(group) abort
|
||||
endfunction
|
||||
|
||||
function! graphql#javascript_tags() abort
|
||||
return graphql#var('graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||
return get(g:, 'graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||
endfunction
|
||||
|
||||
@@ -109,11 +109,9 @@ function! jsonnet#Format()
|
||||
call setfperm(expand('%'), l:originalFPerm)
|
||||
endif
|
||||
" the file has been changed outside of vim, enable reedit
|
||||
mkview
|
||||
silent edit!
|
||||
let &fileformat = l:originalFileFormat
|
||||
let &syntax = &syntax
|
||||
silent loadview
|
||||
elseif g:jsonnet_fmt_fail_silently == 0
|
||||
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and
|
||||
" give immediate feedback to the user at every save time.
|
||||
@@ -128,63 +126,4 @@ function! jsonnet#Format()
|
||||
call winrestview(l:curw)
|
||||
endfunction
|
||||
|
||||
function! jsonnet#GetVisualSelection()
|
||||
" Source: https://stackoverflow.com/a/6271254
|
||||
" Why is this not a built-in Vim script function?!
|
||||
let [line_start, column_start] = getpos("'<")[1:2]
|
||||
let [line_end, column_end] = getpos("'>")[1:2]
|
||||
let lines = getline(line_start, line_end)
|
||||
if len(lines) == 0
|
||||
return ''
|
||||
endif
|
||||
let lines[-1] = lines[-1][: column_end - (&selection == 'inclusive' ? 1 : 2)]
|
||||
let lines[0] = lines[0][column_start - 1:]
|
||||
return join(lines, "\n")
|
||||
endfun
|
||||
|
||||
" Format calls `jsonnetfmt ... ` on a Visual selection
|
||||
function! jsonnet#FormatVisual()
|
||||
" Get current visual selection
|
||||
let l:selection = jsonnet#GetVisualSelection()
|
||||
|
||||
" Get the command first so we can test it
|
||||
let l:binName = g:jsonnet_fmt_command
|
||||
|
||||
" Check if the user has installed command binary.
|
||||
let l:binPath = jsonnet#CheckBinPath(l:binName)
|
||||
if empty(l:binPath)
|
||||
return
|
||||
endif
|
||||
|
||||
" Populate the final command.
|
||||
let l:command = l:binPath
|
||||
let l:command = l:command . ' -e '
|
||||
let l:command = l:command . g:jsonnet_fmt_options
|
||||
|
||||
" Execute the compiled jsonnetfmt command and save the return value
|
||||
let l:out = jsonnet#System(l:command . " \"" . l:selection . "\"")
|
||||
let l:errorCode = v:shell_error
|
||||
|
||||
" Save register contents
|
||||
let reg = '"'
|
||||
let save_cb = &cb
|
||||
let regInfo = getreginfo(reg)
|
||||
try
|
||||
" Set register to formatted output
|
||||
call setreg(reg,l:out)
|
||||
" Paste formatted output
|
||||
silent exe 'norm! gv'.(reg == '"' ? '' : '"' . reg).'p`['
|
||||
finally
|
||||
" Restore register contents
|
||||
let &cb = save_cb
|
||||
call setreg(reg, regInfo)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Evaluate jsonnet into vsplit
|
||||
function! jsonnet#Eval()
|
||||
let output = system(g:jsonnet_command . ' ' . shellescape(expand('%')))
|
||||
vnew
|
||||
setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile ft=jsonnet
|
||||
put! = output
|
||||
endfunction
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'julia', 'autoload/julia_latex
|
||||
endif
|
||||
|
||||
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
||||
" The symbols are based on Julia version 1.12.0-DEV.387
|
||||
" The symbols are based on Julia version 1.9.0-DEV.16
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -17,7 +17,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\copyright': '©',
|
||||
\ '\:copyright:': '©',
|
||||
\ '\ordfeminine': 'ª',
|
||||
\ '\guillemotleft': '«',
|
||||
\ '\neg': '¬',
|
||||
\ '\circledR': '®',
|
||||
\ '\:registered:': '®',
|
||||
@@ -30,7 +29,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\cdotp': '·',
|
||||
\ '\^1': '¹',
|
||||
\ '\ordmasculine': 'º',
|
||||
\ '\guillemotright': '»',
|
||||
\ '\1/4': '¼',
|
||||
\ '\1/2': '½',
|
||||
\ '\3/4': '¾',
|
||||
@@ -162,10 +160,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\Iota': 'Ι',
|
||||
\ '\Kappa': 'Κ',
|
||||
\ '\Lambda': 'Λ',
|
||||
\ '\Mu': 'Μ',
|
||||
\ '\Nu': 'Ν',
|
||||
\ '\upMu': 'Μ',
|
||||
\ '\upNu': 'Ν',
|
||||
\ '\Xi': 'Ξ',
|
||||
\ '\Omicron': 'Ο',
|
||||
\ '\upOmicron': 'Ο',
|
||||
\ '\Pi': 'Π',
|
||||
\ '\Rho': 'Ρ',
|
||||
\ '\Sigma': 'Σ',
|
||||
@@ -179,6 +177,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\beta': 'β',
|
||||
\ '\gamma': 'γ',
|
||||
\ '\delta': 'δ',
|
||||
\ '\upepsilon': 'ε',
|
||||
\ '\varepsilon': 'ε',
|
||||
\ '\zeta': 'ζ',
|
||||
\ '\eta': 'η',
|
||||
@@ -189,7 +188,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\mu': 'μ',
|
||||
\ '\nu': 'ν',
|
||||
\ '\xi': 'ξ',
|
||||
\ '\omicron': 'ο',
|
||||
\ '\upomicron': 'ο',
|
||||
\ '\pi': 'π',
|
||||
\ '\rho': 'ρ',
|
||||
\ '\varsigma': 'ς',
|
||||
@@ -200,20 +199,20 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\chi': 'χ',
|
||||
\ '\psi': 'ψ',
|
||||
\ '\omega': 'ω',
|
||||
\ '\varbeta': 'ϐ',
|
||||
\ '\upvarbeta': 'ϐ',
|
||||
\ '\vartheta': 'ϑ',
|
||||
\ '\phi': 'ϕ',
|
||||
\ '\varpi': 'ϖ',
|
||||
\ '\oldKoppa': 'Ϙ',
|
||||
\ '\oldkoppa': 'ϙ',
|
||||
\ '\upoldKoppa': 'Ϙ',
|
||||
\ '\upoldkoppa': 'ϙ',
|
||||
\ '\Stigma': 'Ϛ',
|
||||
\ '\stigma': 'ϛ',
|
||||
\ '\upstigma': 'ϛ',
|
||||
\ '\Digamma': 'Ϝ',
|
||||
\ '\digamma': 'ϝ',
|
||||
\ '\Koppa': 'Ϟ',
|
||||
\ '\koppa': 'ϟ',
|
||||
\ '\upkoppa': 'ϟ',
|
||||
\ '\Sampi': 'Ϡ',
|
||||
\ '\sampi': 'ϡ',
|
||||
\ '\upsampi': 'ϡ',
|
||||
\ '\varkappa': 'ϰ',
|
||||
\ '\varrho': 'ϱ',
|
||||
\ '\varTheta': 'ϴ',
|
||||
@@ -660,7 +659,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\measeq': '≞',
|
||||
\ '\questeq': '≟',
|
||||
\ '\ne': '≠',
|
||||
\ '\neq': '≠',
|
||||
\ '\equiv': '≡',
|
||||
\ '\nequiv': '≢',
|
||||
\ '\Equiv': '≣',
|
||||
@@ -806,7 +804,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\nsqsubseteq': '⋢',
|
||||
\ '\nsqsupseteq': '⋣',
|
||||
\ '\sqsubsetneq': '⋤',
|
||||
\ '\sqsupsetneq': '⋥',
|
||||
\ '\sqspne': '⋥',
|
||||
\ '\lnsim': '⋦',
|
||||
\ '\gnsim': '⋧',
|
||||
\ '\precnsim': '⋨',
|
||||
@@ -1153,7 +1151,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\threedangle': '⟀',
|
||||
\ '\whiteinwhitetriangle': '⟁',
|
||||
\ '\perp': '⟂',
|
||||
\ '\veedot': '⟇',
|
||||
\ '\bsolhsub': '⟈',
|
||||
\ '\suphsol': '⟉',
|
||||
\ '\wedgedot': '⟑',
|
||||
@@ -1276,8 +1273,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\UpEquilibrium': '⥮',
|
||||
\ '\ReverseUpEquilibrium': '⥯',
|
||||
\ '\RoundImplies': '⥰',
|
||||
\ '\leftarrowless': '⥷',
|
||||
\ '\leftarrowsubset': '⥺',
|
||||
\ '\Vvert': '⦀',
|
||||
\ '\Elroang': '⦆',
|
||||
\ '\ddfnc': '⦙',
|
||||
@@ -3391,10 +3386,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:hindu_temple:': '🛕',
|
||||
\ '\:hut:': '🛖',
|
||||
\ '\:elevator:': '🛗',
|
||||
\ '\:wireless:': '🛜',
|
||||
\ '\:playground_slide:': '🛝',
|
||||
\ '\:wheel:': '🛞',
|
||||
\ '\:ring_buoy:': '🛟',
|
||||
\ '\:airplane_departure:': '🛫',
|
||||
\ '\:airplane_arriving:': '🛬',
|
||||
\ '\:scooter:': '🛴',
|
||||
@@ -3418,7 +3409,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:large_green_square:': '🟩',
|
||||
\ '\:large_purple_square:': '🟪',
|
||||
\ '\:large_brown_square:': '🟫',
|
||||
\ '\:heavy_equals_sign:': '🟰',
|
||||
\ '\:pinched_fingers:': '🤌',
|
||||
\ '\:white_heart:': '🤍',
|
||||
\ '\:brown_heart:': '🤎',
|
||||
@@ -3526,7 +3516,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:cold_face:': '🥶',
|
||||
\ '\:ninja:': '🥷',
|
||||
\ '\:disguised_face:': '🥸',
|
||||
\ '\:face_holding_back_tears:': '🥹',
|
||||
\ '\:pleading_face:': '🥺',
|
||||
\ '\:sari:': '🥻',
|
||||
\ '\:lab_coat:': '🥼',
|
||||
@@ -3605,7 +3594,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:mate_drink:': '🧉',
|
||||
\ '\:ice_cube:': '🧊',
|
||||
\ '\:bubble_tea:': '🧋',
|
||||
\ '\:troll:': '🧌',
|
||||
\ '\:standing_person:': '🧍',
|
||||
\ '\:kneeling_person:': '🧎',
|
||||
\ '\:deaf_person:': '🧏',
|
||||
@@ -3662,14 +3650,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:briefs:': '🩲',
|
||||
\ '\:shorts:': '🩳',
|
||||
\ '\:thong_sandal:': '🩴',
|
||||
\ '\:light_blue_heart:': '🩵',
|
||||
\ '\:grey_heart:': '🩶',
|
||||
\ '\:pink_heart:': '🩷',
|
||||
\ '\:drop_of_blood:': '🩸',
|
||||
\ '\:adhesive_bandage:': '🩹',
|
||||
\ '\:stethoscope:': '🩺',
|
||||
\ '\:x-ray:': '🩻',
|
||||
\ '\:crutch:': '🩼',
|
||||
\ '\:yo-yo:': '🪀',
|
||||
\ '\:kite:': '🪁',
|
||||
\ '\:parachute:': '🪂',
|
||||
@@ -3677,8 +3660,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:magic_wand:': '🪄',
|
||||
\ '\:pinata:': '🪅',
|
||||
\ '\:nesting_dolls:': '🪆',
|
||||
\ '\:maracas:': '🪇',
|
||||
\ '\:flute:': '🪈',
|
||||
\ '\:ringed_planet:': '🪐',
|
||||
\ '\:chair:': '🪑',
|
||||
\ '\:razor:': '🪒',
|
||||
@@ -3704,13 +3685,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:headstone:': '🪦',
|
||||
\ '\:placard:': '🪧',
|
||||
\ '\:rock:': '🪨',
|
||||
\ '\:mirror_ball:': '🪩',
|
||||
\ '\:identification_card:': '🪪',
|
||||
\ '\:low_battery:': '🪫',
|
||||
\ '\:hamsa:': '🪬',
|
||||
\ '\:folding_hand_fan:': '🪭',
|
||||
\ '\:hair_pick:': '🪮',
|
||||
\ '\:khanda:': '🪯',
|
||||
\ '\:fly:': '🪰',
|
||||
\ '\:worm:': '🪱',
|
||||
\ '\:beetle:': '🪲',
|
||||
@@ -3718,50 +3692,14 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:potted_plant:': '🪴',
|
||||
\ '\:wood:': '🪵',
|
||||
\ '\:feather:': '🪶',
|
||||
\ '\:lotus:': '🪷',
|
||||
\ '\:coral:': '🪸',
|
||||
\ '\:empty_nest:': '🪹',
|
||||
\ '\:nest_with_eggs:': '🪺',
|
||||
\ '\:hyacinth:': '🪻',
|
||||
\ '\:jellyfish:': '🪼',
|
||||
\ '\:wing:': '🪽',
|
||||
\ '\:goose:': '🪿',
|
||||
\ '\:anatomical_heart:': '🫀',
|
||||
\ '\:lungs:': '🫁',
|
||||
\ '\:people_hugging:': '🫂',
|
||||
\ '\:pregnant_man:': '🫃',
|
||||
\ '\:pregnant_person:': '🫄',
|
||||
\ '\:person_with_crown:': '🫅',
|
||||
\ '\:moose:': '🫎',
|
||||
\ '\:donkey:': '🫏',
|
||||
\ '\:blueberries:': '🫐',
|
||||
\ '\:bell_pepper:': '🫑',
|
||||
\ '\:olive:': '🫒',
|
||||
\ '\:flatbread:': '🫓',
|
||||
\ '\:tamale:': '🫔',
|
||||
\ '\:fondue:': '🫕',
|
||||
\ '\:teapot:': '🫖',
|
||||
\ '\:pouring_liquid:': '🫗',
|
||||
\ '\:beans:': '🫘',
|
||||
\ '\:jar:': '🫙',
|
||||
\ '\:ginger_root:': '🫚',
|
||||
\ '\:pea_pod:': '🫛',
|
||||
\ '\:melting_face:': '🫠',
|
||||
\ '\:saluting_face:': '🫡',
|
||||
\ '\:face_with_open_eyes_and_hand_over_mouth:': '🫢',
|
||||
\ '\:face_with_peeking_eye:': '🫣',
|
||||
\ '\:face_with_diagonal_mouth:': '🫤',
|
||||
\ '\:dotted_line_face:': '🫥',
|
||||
\ '\:biting_lip:': '🫦',
|
||||
\ '\:bubbles:': '🫧',
|
||||
\ '\:shaking_face:': '🫨',
|
||||
\ '\:hand_with_index_finger_and_thumb_crossed:': '🫰',
|
||||
\ '\:rightwards_hand:': '🫱',
|
||||
\ '\:leftwards_hand:': '🫲',
|
||||
\ '\:palm_down_hand:': '🫳',
|
||||
\ '\:palm_up_hand:': '🫴',
|
||||
\ '\:index_pointing_at_the_viewer:': '🫵',
|
||||
\ '\:heart_hands:': '🫶',
|
||||
\ '\:leftwards_pushing_hand:': '🫷',
|
||||
\ '\:rightwards_pushing_hand:': '🫸'}
|
||||
\ '\:teapot:': '🫖'}
|
||||
endfunction
|
||||
|
||||
@@ -3,11 +3,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ledger', 'autoload/ledger.vim
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
" vim:ts=2:sw=2:sts=2:foldmethod=marker
|
||||
function! ledger#transaction_state_toggle(lnum, ...) abort
|
||||
if a:0 == 1
|
||||
@@ -514,10 +509,7 @@ function! ledger#align_commodity() abort
|
||||
endif
|
||||
if pos < 0
|
||||
" Find the position after the first digits
|
||||
let pos = matchend(rhs, '\m\d[^[:space:]]*') - 1
|
||||
if pos >= 0
|
||||
let pos = strchars(rhs[:pos])
|
||||
endif
|
||||
let pos = matchend(rhs, '\m\d[^[:space:]]*')
|
||||
endif
|
||||
" Go to the column that allows us to align the decimal separator at g:ledger_align_at:
|
||||
if pos >= 0
|
||||
@@ -651,7 +643,7 @@ endf
|
||||
" Build a ledger command to process the given file.
|
||||
function! s:ledger_cmd(file, args) abort
|
||||
let l:options = g:ledger_extra_options
|
||||
if len(g:ledger_date_format) > 0 && !b:is_hledger
|
||||
if len(g:ledger_date_format) > 0 && !g:ledger_is_hledger
|
||||
let l:options = join([l:options, '--date-format', g:ledger_date_format,
|
||||
\ '--input-date-format', g:ledger_date_format])
|
||||
endif
|
||||
@@ -678,7 +670,7 @@ endf
|
||||
" Use current line as input to ledger entry and replace with output. If there
|
||||
" are errors, they are echoed instead.
|
||||
function! ledger#entry() abort
|
||||
let l:output = split(system(s:ledger_cmd(g:ledger_main, join(['entry', getline('.')]))), '\n')
|
||||
let l:output = systemlist(s:ledger_cmd(g:ledger_main, join(['entry', getline('.')])))
|
||||
" Filter out warnings
|
||||
let l:output = filter(l:output, "v:val !~? '^Warning: '")
|
||||
" Errors may occur
|
||||
@@ -702,7 +694,7 @@ endfunc
|
||||
" Returns:
|
||||
" Ledger's output as a String.
|
||||
function! ledger#report(file, args) abort
|
||||
let l:output = split(system(s:ledger_cmd(a:file, a:args)), '\n')
|
||||
let l:output = systemlist(s:ledger_cmd(a:file, a:args))
|
||||
if v:shell_error " If there are errors, show them in a quickfix/location list.
|
||||
call s:quickfix_populate(l:output)
|
||||
call s:quickfix_toggle('Errors', 'Unable to parse errors')
|
||||
@@ -749,7 +741,7 @@ function! ledger#register(file, args) abort
|
||||
\ "--prepend-format='%(filename):%(beg_line) '",
|
||||
\ a:args
|
||||
\ ]))
|
||||
call s:quickfix_populate(split(system(l:cmd), '\n'))
|
||||
call s:quickfix_populate(systemlist(l:cmd))
|
||||
call s:quickfix_toggle('Register report')
|
||||
endf
|
||||
|
||||
@@ -768,7 +760,7 @@ function! ledger#reconcile(file, account, target_amount) abort
|
||||
\ shellescape(a:account)
|
||||
\ ]))
|
||||
let l:file = expand(a:file) " Needed for #show_balance() later
|
||||
call s:quickfix_populate(split(system(l:cmd), '\n'))
|
||||
call s:quickfix_populate(systemlist(l:cmd))
|
||||
if s:quickfix_toggle('Reconcile ' . a:account, 'Nothing to reconcile')
|
||||
let g:ledger_target_amount = a:target_amount
|
||||
" Show updated account balance upon saving, as long as the quickfix window is open
|
||||
@@ -812,7 +804,7 @@ function! ledger#show_balance(file, ...) abort
|
||||
\ "--format='%(scrub(get_at(display_total, 0)))|%(scrub(get_at(display_total, 1)))|%(quantity(scrub(get_at(display_total, 1))))'",
|
||||
\ (empty(g:ledger_default_commodity) ? '' : '-X ' . shellescape(g:ledger_default_commodity))
|
||||
\ ]))
|
||||
let l:output = split(system(l:cmd), '\n')
|
||||
let l:output = systemlist(l:cmd)
|
||||
" Errors may occur, for example, when the account has multiple commodities
|
||||
" and g:ledger_default_commodity is empty.
|
||||
if v:shell_error
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'autoload/neomake/makers/ft/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! neomake#makers#ft#pony#EnabledMakers()
|
||||
return ['ponyc']
|
||||
endfunction
|
||||
|
||||
function! neomake#makers#ft#pony#ponyc()
|
||||
" This is currently a hack. Ponyc itself uses the project directory as
|
||||
" the target to build. Using %:p:h like this fetches the parent
|
||||
" directory of the current file which might cause supurious errors on
|
||||
" package imports if the current file is nested under a sub-directory.
|
||||
return {
|
||||
\ 'args': ['--pass=expr', '%:p:h'],
|
||||
\ 'errorformat': '%f:%l:%c: %m'
|
||||
\ }
|
||||
endfunction
|
||||
@@ -1,27 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'nix', 'autoload/nix.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! nix#find_drv_position()
|
||||
let line = search("description")
|
||||
if line == 0
|
||||
let line = search("name")
|
||||
endif
|
||||
if line == 0
|
||||
echo "error: could not find derivation"
|
||||
return
|
||||
endif
|
||||
|
||||
return expand("%") . ":" . line
|
||||
endfunction
|
||||
|
||||
function! nix#edit(attr)
|
||||
let output = system("nix-instantiate --eval ./. -A " . a:attr . ".meta.position")
|
||||
if match(output, "^error:") == -1
|
||||
let position = split(split(output, '"')[0], ":")
|
||||
execute "edit " . position[0]
|
||||
execute position[1]
|
||||
" Update default command to nix-build.
|
||||
let b:dispatch = 'nix-build --no-out-link -A ' . a:attr
|
||||
endif
|
||||
endfunction
|
||||
@@ -1771,11 +1771,11 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prolog')
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.pdb,*.plt,*.pro,*.prolog,*.yap setf prolog
|
||||
au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap setf prolog
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'bzl')
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel setf bzl
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
@@ -1783,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'dosini')
|
||||
au BufNewFile,BufRead *.cnf,*.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc setf dosini
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,buildozer.spec,pylintrc setf dosini
|
||||
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||
endif
|
||||
@@ -1794,7 +1794,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'visual-basic')
|
||||
au! BufNewFile,BufRead,BufWritePost *.bas call polyglot#detect#Bas()
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.sba,*.vba,*.vbs setf vb
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.frx,*.sba,*.vba,*.vbs setf vb
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'basic')
|
||||
@@ -1807,7 +1807,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
au BufNewFile,BufRead *.zir setf zir
|
||||
au BufNewFile,BufRead *.zig,*.zig.zon,*.zir setf zig
|
||||
au BufNewFile,BufRead *.zig,*.zir setf zig
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'zephir')
|
||||
@@ -1891,7 +1891,7 @@ if !has_key(g:polyglot_is_disabled, 'tptp')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'toml')
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,pdm.lock,poetry.lock setf toml
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock setf toml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'tmux')
|
||||
@@ -1957,7 +1957,7 @@ if !has_key(g:polyglot_is_disabled, 'slim')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'sh')
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_functions,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}envrc,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,{.,}tmux.conf,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile,tmux.conf setf sh
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh
|
||||
au BufNewFile,BufRead *.zsh,*/etc/zprofile,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh
|
||||
au BufNewFile,BufRead .zsh* call s:StarSetf('zsh')
|
||||
au BufNewFile,BufRead .zlog* call s:StarSetf('zsh')
|
||||
@@ -2033,7 +2033,7 @@ if !has_key(g:polyglot_is_disabled, 'requirements')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'python')
|
||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,wscript setf python
|
||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,Snakefile,wscript setf python
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'purescript')
|
||||
@@ -2053,10 +2053,6 @@ if !has_key(g:polyglot_is_disabled, 'protobuf')
|
||||
au BufNewFile,BufRead *.proto setf proto
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prisma')
|
||||
au BufNewFile,BufRead *.prisma setf prisma
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'powershell')
|
||||
au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc setf ps1
|
||||
au BufNewFile,BufRead *.ps1xml setf ps1xml
|
||||
@@ -2220,7 +2216,7 @@ if !has_key(g:polyglot_is_disabled, 'perl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T()
|
||||
au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm()
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,{.,}latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,latexmkrc setf perl
|
||||
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl
|
||||
au BufNewFile,BufRead *.pod setf pod
|
||||
au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason
|
||||
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
|
||||
@@ -2237,7 +2233,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json')
|
||||
au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.sarif,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}all-contributorsrc,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,MODULE.bazel.lock,Pipfile.lock,composer.lock,deno.lock,flake.lock,mcmod.info setf json
|
||||
au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json5')
|
||||
@@ -2351,7 +2347,7 @@ endif
|
||||
if !has_key(g:polyglot_is_disabled, 'glsl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag()
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader setf glsl
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'git')
|
||||
@@ -2542,7 +2538,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'c/c++')
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cppm,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp,*.txx setf cpp
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp setf cpp
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c
|
||||
endif
|
||||
@@ -2583,7 +2579,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mojo,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.sw,*.targets,*.tml,*.tpm,*.typ,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||
|
||||
@@ -499,9 +499,6 @@ let s:interpreters = {
|
||||
\ 'python': 'python',
|
||||
\ 'python2': 'python',
|
||||
\ 'python3': 'python',
|
||||
\ 'py': 'python',
|
||||
\ 'pypy': 'python',
|
||||
\ 'pypy3': 'python',
|
||||
\ 'qmake': 'qmake',
|
||||
\ 'Rscript': 'r',
|
||||
\ 'racket': 'racket',
|
||||
@@ -513,7 +510,6 @@ let s:interpreters = {
|
||||
\ 'rake': 'ruby',
|
||||
\ 'jruby': 'ruby',
|
||||
\ 'rbx': 'ruby',
|
||||
\ 'rust-script': 'rust',
|
||||
\ 'scala': 'scala',
|
||||
\ 'ash': 'sh',
|
||||
\ 'bash': 'sh',
|
||||
@@ -535,7 +531,6 @@ let s:interpreters = {
|
||||
\ 'z3': 'smt2',
|
||||
\ 'deno': 'typescript',
|
||||
\ 'ts-node': 'typescript',
|
||||
\ 'tsx': 'typescript',
|
||||
\ 'zsh': 'zsh',
|
||||
\ }
|
||||
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
@@ -55,7 +55,7 @@ let s:globs = {
|
||||
\ 'brewfile': 'Brewfile',
|
||||
\ 'bsdl': '*.bsdl,*bsd',
|
||||
\ 'bst': '*.bst',
|
||||
\ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel',
|
||||
\ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE',
|
||||
\ 'bzr': 'bzr_log.*',
|
||||
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
||||
\ 'cabal': '*.cabal',
|
||||
@@ -86,7 +86,7 @@ let s:globs = {
|
||||
\ 'conf': '*.conf,auto.master,config',
|
||||
\ 'config': 'configure.in,configure.ac,Pipfile',
|
||||
\ 'context': '*.mkii,*.mkiv,*.mkvi',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cppm,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.txx,*.moc,*.tlh',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.moc,*.tlh',
|
||||
\ 'cql': '*.cql',
|
||||
\ 'crm': '*.crm',
|
||||
\ 'crontab': 'crontab,crontab.*',
|
||||
@@ -130,7 +130,7 @@ let s:globs = {
|
||||
\ 'dnsmasq': '',
|
||||
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||
\ 'dosbatch': '*.bat,*.sys',
|
||||
\ 'dosini': '*.wrap,*.ini,*.cnf,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,buildozer.spec,pylintrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dot': '*.dot,*.gv',
|
||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
@@ -153,7 +153,7 @@ let s:globs = {
|
||||
\ 'embeddedpuppet': '*.epp',
|
||||
\ 'ember-script': '*.em,*.emberscript',
|
||||
\ 'emblem': '*.emblem,*.em',
|
||||
\ 'erlang': '*.erl,*.app,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'erlang': '*.erl,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.app,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'eruby': '*.erb,*.erb.deface,*.rhtml',
|
||||
\ 'esmtprc': '*esmtprc',
|
||||
\ 'esqlc': '*.ec,*.EC',
|
||||
@@ -190,7 +190,7 @@ let s:globs = {
|
||||
\ 'gitsendemail': '.gitsendemail.*',
|
||||
\ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?',
|
||||
\ 'gleam': '*.gleam',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader,*.comp',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
|
||||
\ 'gmpl': '*.mod',
|
||||
\ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc',
|
||||
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
|
||||
@@ -262,7 +262,7 @@ let s:globs = {
|
||||
\ 'jovial': '*.jov,*.j73,*.jovial',
|
||||
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
||||
\ 'jq': '*.jq,.jqrc,.jqrc*',
|
||||
\ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.sarif,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.all-contributorsrc,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,MODULE.bazel.lock,Pipfile.lock,composer.lock,deno.lock,flake.lock,mcmod.info',
|
||||
\ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info',
|
||||
\ 'json5': '*.json5',
|
||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
@@ -393,7 +393,7 @@ let s:globs = {
|
||||
\ 'passwd': '',
|
||||
\ 'pccts': '*.g',
|
||||
\ 'pdf': '*.pdf',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,.latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,latexmkrc,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'pest': '*.pest',
|
||||
\ 'pf': 'pf.conf',
|
||||
\ 'pfmain': 'main.cf',
|
||||
@@ -415,10 +415,9 @@ let s:globs = {
|
||||
\ 'povini': '.povrayrc',
|
||||
\ 'ppd': '*.ppd',
|
||||
\ 'ppwiz': '*.it,*.ih',
|
||||
\ 'prisma': '*.prisma',
|
||||
\ 'privoxy': '*.action',
|
||||
\ 'procmail': '.procmail,.procmailrc',
|
||||
\ 'prolog': '*.pl,*.plt,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'promela': '*.pml',
|
||||
\ 'proto': '*.proto',
|
||||
\ 'protocols': '',
|
||||
@@ -429,7 +428,7 @@ let s:globs = {
|
||||
\ 'puppet': '*.pp,Modulefile',
|
||||
\ 'purescript': '*.purs',
|
||||
\ 'pyrex': '*.pyx,*.pxd',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,wscript,.pythonrc,.pythonstartup',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,Snakefile,wscript,.pythonrc,.pythonstartup',
|
||||
\ 'qmake': '*.pro,*.pri',
|
||||
\ 'qml': '*.qml,*.qbs',
|
||||
\ 'quake': '',
|
||||
@@ -483,7 +482,7 @@ let s:globs = {
|
||||
\ 'services': '',
|
||||
\ 'setserial': '',
|
||||
\ 'sexplib': '*.sexp',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,.bash_aliases,.bash_functions,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.envrc,.flaskenv,.kshrc,.login,.profile,.tmux.conf,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile,tmux.conf',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.zsh-theme,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile',
|
||||
\ 'sieve': '*.siv,*.sieve',
|
||||
\ 'sil': '*.sil',
|
||||
\ 'simula': '*.sim',
|
||||
@@ -555,7 +554,7 @@ let s:globs = {
|
||||
\ 'tilde': '*.t.html',
|
||||
\ 'tli': '*.tli',
|
||||
\ 'tmux': '.tmux*.conf',
|
||||
\ 'toml': '*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,pdm.lock,poetry.lock',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock',
|
||||
\ 'tpp': '*.tpp',
|
||||
\ 'tptp': '*.p,*.tptp,*.ax',
|
||||
\ 'trasys': '*.inp',
|
||||
@@ -583,7 +582,7 @@ let s:globs = {
|
||||
\ 'usserverlog': '*.usserver.log\c,usserver.log\c,usserver.*.log\c',
|
||||
\ 'usw2kagtlog': '*.usw2kagt.log\c,usw2kagt.log\c,usw2kagt.*.log\c',
|
||||
\ 'vala': '*.vala,*.vapi,*.valadoc',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vbnet': '*.vb,*.vbhtml',
|
||||
\ 'vcl': '*.vcl',
|
||||
\ 'velocity': '*.vm',
|
||||
@@ -614,7 +613,7 @@ let s:globs = {
|
||||
\ 'xhtml': '*.xhtml,*.xht',
|
||||
\ 'xinetd': '',
|
||||
\ 'xmath': '*.msc,*.msf',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mojo,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.sw,*.targets,*.tml,*.typ,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml.twig': '*.xml.twig',
|
||||
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
||||
\ 'xpm': '*.xpm,*.pm',
|
||||
@@ -630,7 +629,7 @@ let s:globs = {
|
||||
\ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml',
|
||||
\ 'z8a': '*.z8a',
|
||||
\ 'zephir': '*.zep',
|
||||
\ 'zig': '*.zig,*.zig.zon,*.zir',
|
||||
\ 'zig': '*.zig,*.zir',
|
||||
\ 'zimbu': '*.zu',
|
||||
\ 'zir': '*.zir',
|
||||
\ 'zsh': '*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*',
|
||||
|
||||
536
autoload/pony.vim
Normal file
536
autoload/pony.vim
Normal file
@@ -0,0 +1,536 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'autoload/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim plugin file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
|
||||
" TODO: Make sure echomsg is off for release.
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
"let s:skip = '<SID>InCommentOrLiteral(line("."), col("."))'
|
||||
let s:skip2 = '<SID>InLiteral(line("."), col(".")) || <SID>InComment(line("."), col(".")) == 1'
|
||||
let s:skip3 = '!<SID>InKeyword(line("."), col("."))'
|
||||
let s:skip4 = '!<SID>InBracket(line("."), col("."))'
|
||||
let s:cfstart = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>'
|
||||
let s:cfmiddle = '\v<%(then|elseif|else|until|do|in|elseiftype)>|\|'
|
||||
let s:cfend = '\v<end>'
|
||||
let s:bstartp = '\v<%(ifdef|if|then|elseif|else|(match)|while|for|in|do|try|with|recover|repeat|until|(object)|lambda|iftype|elseiftype)>'
|
||||
|
||||
function! pony#Indent()
|
||||
if v:lnum <= 1
|
||||
return 0
|
||||
endif
|
||||
|
||||
call cursor(v:lnum, 1)
|
||||
let l:pnzpos = searchpos('.', 'cbnW')
|
||||
if l:pnzpos == [0, 0]
|
||||
return 0
|
||||
endif
|
||||
|
||||
if s:InComment2(l:pnzpos) > 1
|
||||
"echomsg 'Comment' (l:pnzpos[0] . '-' . v:lnum) -1
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
if s:InLiteral2(l:pnzpos)
|
||||
"echomsg 'String' (l:pnzpos[0] . '-' . v:lnum) -1
|
||||
return -1
|
||||
endif
|
||||
|
||||
unlet! l:pnzpos
|
||||
|
||||
" NOTE: Lines started in comments and strings are checked already.
|
||||
|
||||
let l:pnblnum = s:PrevNonblank(v:lnum - 1)
|
||||
if l:pnblnum < 1
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:pnbline = getline(l:pnblnum)
|
||||
let l:pnbindent = indent(l:pnblnum)
|
||||
|
||||
let l:line = getline(v:lnum)
|
||||
let l:indent = l:pnbindent
|
||||
let l:shiftwidth = shiftwidth()
|
||||
|
||||
" FIXME?
|
||||
let l:continuing = 0
|
||||
" If the previous line ends with a unary or binary operator,
|
||||
if s:IsContinued(l:pnblnum)
|
||||
let l:contlnum = l:pnblnum
|
||||
let l:ppcontinued = 0
|
||||
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
|
||||
while s:IsContinued(l:ppnblnum)
|
||||
let l:ppcontinued += 1
|
||||
let l:contlnum = l:ppnblnum
|
||||
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
|
||||
endwhile
|
||||
"echomsg 'Continued1' l:pnblnum l:contlnum
|
||||
" If the previous line is also continuing another line,
|
||||
if l:ppcontinued
|
||||
let l:continuing = 1
|
||||
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing0' (l:contlnum . '-' . v:lnum) (l:shiftwidth * 2)
|
||||
let l:indent = l:shiftwidth * 2
|
||||
else
|
||||
" keep using the previous indent.
|
||||
"echomsg 'Continuing1' (l:pnblnum . '-' . v:lnum) l:pnbindent
|
||||
let l:indent = l:pnbindent
|
||||
endif
|
||||
" if the previous line is part of the definition of a class,
|
||||
elseif l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing2' (l:pnblnum . '-' . v:lnum) (l:shiftwidth * 2)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:shiftwidth * 2
|
||||
" if the previous line is part of the definition of a method,
|
||||
elseif l:pnbline =~# '\v^\s*%(fun|new|be)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing3' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth
|
||||
" if the previous line is the start of a definition body,
|
||||
elseif l:pnbline =~# '=>\s*$'
|
||||
" indent this line.
|
||||
"echomsg 'Continuing4' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth
|
||||
else
|
||||
" indent this line twice as far.
|
||||
"echomsg 'Continuing5' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth * 2)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth * 2
|
||||
endif
|
||||
|
||||
unlet! l:contlnum l:ppnblnum l:ppcontinued
|
||||
endif
|
||||
|
||||
" If this line starts a document string,
|
||||
if !l:continuing && l:line =~# '^\s*"""'
|
||||
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
|
||||
if s:IsContinued(l:ppnblnum)
|
||||
let l:contlnum = l:ppnblnum
|
||||
while s:IsContinued(l:ppnblnum)
|
||||
let l:contlnum = l:ppnblnum
|
||||
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
|
||||
endwhile
|
||||
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'DocString' (l:contlnum . '-' . v:lnum) l:shiftwidth
|
||||
return l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:contlnum l:ppnblnum
|
||||
endif
|
||||
|
||||
" If the previous line contains an unmatched opening bracket
|
||||
if !l:continuing && l:pnbline =~# '[{[(]'
|
||||
" if the line ends with an opening bracket,
|
||||
if l:pnbline =~# '[{[(]\s*$' && !s:InCommentOrLiteral(l:pnblnum, col([l:pnblnum, '$']) - 1)
|
||||
" indent this line.
|
||||
let l:indent += l:shiftwidth
|
||||
else
|
||||
" find the unmatched opening bracket,
|
||||
let l:start = [0, 0]
|
||||
let l:end = col([l:pnblnum, '$']) - 1
|
||||
call cursor(l:pnblnum, l:end)
|
||||
while l:end > 0
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('(', '', ')', 'bnW', s:skip4, l:pnblnum))
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('\[', '', '\]', 'bnW', s:skip4, l:pnblnum))
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('{', '', '}', 'bnW', s:skip4, l:pnblnum))
|
||||
if l:start == [0, 0]
|
||||
break
|
||||
endif
|
||||
" find the matched closing bracket on the same line,
|
||||
call cursor(l:start[0], l:start[1])
|
||||
let l:c = s:CharAtCursor(l:start[0], l:start[1])
|
||||
if searchpair(escape(l:c, '['), '', escape(tr(l:c, '([{', ')]}'), ']'),
|
||||
\ 'znW', s:skip4, l:pnblnum) < 1
|
||||
" the unmatched opening bracket is found,
|
||||
break
|
||||
endif
|
||||
let l:end = l:start[1]
|
||||
let l:start = [0, 0]
|
||||
endwhile
|
||||
if l:start != [0, 0]
|
||||
" indent this line.
|
||||
"echomsg 'Open bracket' (l:pnblnum . '-' . v:lnum) (l:indent + l:shiftwidth)
|
||||
let l:indent += l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If there is a matched closing bracket on the previous line,
|
||||
" NOTE:
|
||||
" >|[
|
||||
" | (1 -
|
||||
" | 1) * 2]
|
||||
" | command
|
||||
" ^
|
||||
if !l:continuing
|
||||
call cursor(l:pnblnum, 1)
|
||||
" find the last closing bracket,
|
||||
let l:end = [0, 0]
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('(', '', ')', 'zncr', s:skip4, l:pnblnum))
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('\[', '', '\]', 'zncr', s:skip4, l:pnblnum))
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('{', '', '}', 'zncr', s:skip4, l:pnblnum))
|
||||
if l:end != [0, 0]
|
||||
" find the matched opening bracket on another line,
|
||||
let l:c = s:CharAtCursor(l:end[0], l:end[1])
|
||||
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
|
||||
if l:start[0] != l:end[0]
|
||||
" and then this line has the same indent as the line the matched bracket stays.
|
||||
"echomsg 'Matched bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
let l:indent = indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If there is a matched closing bracket on this line,
|
||||
" NOTE:
|
||||
" |[
|
||||
" >| (1 -
|
||||
" | 1) * 2
|
||||
" |]
|
||||
" ^ ^
|
||||
if l:line =~# '^\s*[)\]}]'
|
||||
" find the first closing bracket,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:end = [0, 0]
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('(', '', ')', 'zncW', s:skip4, v:lnum))
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('\[', '', '\]', 'zncW', s:skip4, v:lnum))
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('{', '', '}', 'zncW', s:skip4, v:lnum))
|
||||
if l:end != [0, 0]
|
||||
" find the matched opening bracket on another line,
|
||||
let l:c = s:CharAtCursor(l:end[0], l:end[1])
|
||||
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
|
||||
if l:start[0] != l:end[0]
|
||||
" and then this line has the same indent as the line the matched bracket stays.
|
||||
"echomsg 'Closing Bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
let l:indent = indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If this line starts the definition of a method, closure or match case,
|
||||
if l:line =~# '^\s*=>'
|
||||
" find the start of the definition,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos('\v<%(new|be|fun|lambda)>|\|', '', '=>\zs', 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Method body' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If this line starts a class definition or starts an alias,
|
||||
if l:line =~# '\v^\s*%(actor|class|struct|primitive|trait|interface|use|type)>'
|
||||
" reset the indent level.
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If this line starts a method definition,
|
||||
if l:line =~# '\v^\s*%(new|be|fun)>'
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
let l:start = searchpos(s:bstartp, 'zcnpW', l:start[0])
|
||||
" see if it is in an object block,
|
||||
if l:start[2] == 3
|
||||
"echomsg 'Method in object' (l:start[0] . '-' . v:lnum) (l:shiftwidth + indent(l:start[0]))
|
||||
return l:shiftwidth + indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
return l:shiftwidth
|
||||
endif
|
||||
|
||||
" If this line starts a match case,
|
||||
call cursor(v:lnum, 1)
|
||||
if l:line =~# '^\s*|' && s:InKeyword(searchpos('|', 'znW', v:lnum))
|
||||
" find the start or the previous case of the match block,
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Match case' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If this line ends (part of) a control flow,
|
||||
if l:line =~# '\v^\s*%(end|elseif|else|then|in|do|until|elseiftype)>'
|
||||
" find the start or middle of the control block,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Block end' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If the previous line starts a class definition,
|
||||
if l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
if s:IsContinued(l:pnblnum)
|
||||
return l:shiftwidth * 2
|
||||
else
|
||||
return l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the previous line starts a method definition,
|
||||
if l:pnbline =~# '\v^\s*%(new|be|fun)>'
|
||||
return l:pnbindent + l:shiftwidth
|
||||
endif
|
||||
|
||||
" If the previous line starts (part of) a control flow,
|
||||
call cursor(l:pnblnum, 1)
|
||||
while 1
|
||||
" find the start of the control block,
|
||||
let l:start = searchpos(s:bstartp, 'zcepW', l:pnblnum)
|
||||
if l:start[2] == 0
|
||||
break
|
||||
endif
|
||||
if !s:InKeyword(l:start[0:1])
|
||||
call cursor(l:pnblnum, l:start[1] + 3)
|
||||
continue
|
||||
endif
|
||||
let l:index = l:start[2]
|
||||
" find the end of the control block on the same line,
|
||||
let l:end = searchpair(s:cfstart, '', s:cfend, 'znW', s:skip3, l:pnblnum)
|
||||
" if the control block is not ended,
|
||||
if l:end < 1
|
||||
" if this line is a case for a match,
|
||||
if l:index == 2 && l:line =~# '^\s*|'
|
||||
" then this line has the same indent as the start of the match block.
|
||||
return l:pnbindent
|
||||
else
|
||||
" then indent this line.
|
||||
"echomsg 'Block start' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
return l:pnbindent + l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
|
||||
unlet! l:start l:end l:index
|
||||
|
||||
return l:indent
|
||||
endfunction
|
||||
|
||||
function! s:PrevNonblank(lnum)
|
||||
let l:lnum = prevnonblank(a:lnum)
|
||||
while l:lnum > 0 && (s:InComment2(l:lnum, 1) || s:InLiteral2(l:lnum, 1))
|
||||
let l:lnum = prevnonblank(l:lnum - 1)
|
||||
endwhile
|
||||
return l:lnum
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" v
|
||||
" |1 /* comment */
|
||||
" |2
|
||||
function! s:IsContinued(lnum)
|
||||
let l:lnum = s:PrevNonblank(a:lnum)
|
||||
if l:lnum < 1
|
||||
return 0
|
||||
endif
|
||||
let l:line = getline(l:lnum)
|
||||
let l:width = strwidth(substitute(l:line, '\s*$', '', ''))
|
||||
" FIXME?
|
||||
" | 1 + //
|
||||
" | //
|
||||
" | 2
|
||||
return !s:InCommentOrLiteral(a:lnum, l:width)
|
||||
\ && (l:line =~# '\v<%(and|or|xor|is|isnt|as|not|consume|addressof|digestof)\s*$'
|
||||
\ || l:line =~# '\v%([=\-.]\>|[<!=>]\=\~?|\<\<\~?|\>\>\~?|\<:|[+\-*/%<>]\~?|[.,|:@~])\s*$'
|
||||
\ )
|
||||
endfunction
|
||||
|
||||
function! s:InCommentOrLiteral(...)
|
||||
return call('s:InComment', a:000) || call('s:InLiteral', a:000)
|
||||
endfunction
|
||||
|
||||
function! s:InKeyword(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
for id in s:Or(synstack(l:lnum, l:col), [])
|
||||
if synIDattr(id, 'name') =~# '^ponyKw'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InBracket(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
for id in s:Or(synstack(l:lnum, l:col), [])
|
||||
if synIDattr(id, 'name') ==# 'ponyBracket'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InComment(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname =~# '^ponyNestedCommentX\?$'
|
||||
return 1 + l:i - (l:sname =~# 'X$')
|
||||
elseif l:sname =~# '^ponyCommentX\?$'
|
||||
return 1
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InLiteral(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname =~# '^ponyDocumentStringX\?$'
|
||||
return 3
|
||||
elseif l:sname =~# '^ponyStringX\?$'
|
||||
return 2
|
||||
elseif l:sname =~# '^ponyCharacterX\?$'
|
||||
return 1
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" |// //inside
|
||||
" ^^^^^^^^^^
|
||||
" |/* /*inside*/ */
|
||||
" ^^^^^^^^^^^^^^
|
||||
function! s:InComment2(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname ==# 'ponyNestedComment'
|
||||
return 1 + l:i
|
||||
elseif l:sname ==# 'ponyComment'
|
||||
return 1
|
||||
elseif l:sname =~# '\v^pony%(Nested)?CommentX$'
|
||||
return 0
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" |"inside"
|
||||
" ^^^^^^
|
||||
" |"""inside"""""
|
||||
" ^^^^^^^^^^^^
|
||||
function! s:InLiteral2(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname ==# 'ponyDocumentString'
|
||||
return 3
|
||||
elseif l:sname ==# 'ponyString'
|
||||
return 2
|
||||
elseif l:sname ==# 'ponyCharacter'
|
||||
return 1
|
||||
elseif l:sname =~# '\v^pony%(DocumentString|String|Character)X$'
|
||||
return 0
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:CharAtCursor(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
return matchstr(getline(l:lnum), '\%' . l:col . 'c.')
|
||||
endfunction
|
||||
|
||||
function! s:Or(x, y)
|
||||
return !empty(a:x) ? a:x : a:y
|
||||
endfunction
|
||||
|
||||
function! s:InnerPos(x, y)
|
||||
if a:x == [0, 0]
|
||||
return a:y
|
||||
elseif a:y == [0, 0]
|
||||
return a:x
|
||||
else
|
||||
return a:x[1] < a:y[1] ? a:x : a:y
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! s:OuterPos(x, y)
|
||||
if a:x == [0, 0]
|
||||
return a:y
|
||||
elseif a:y == [0, 0]
|
||||
return a:x
|
||||
else
|
||||
return a:x[1] > a:y[1] ? a:x : a:y
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! pony#ClearTrailingSpace(all, alt, ...)
|
||||
let l:force = (a:0 > 0 ? a:1 : 0)
|
||||
if !l:force && (&readonly || !&modifiable || !&modified)
|
||||
return
|
||||
endif
|
||||
if a:all
|
||||
for lnum in range(1, line('$'))
|
||||
let l:line = getline(lnum)
|
||||
let l:end = col([lnum, '$']) - 1
|
||||
if l:end > 0 && l:line =~# '\s$' && !s:InLiteral(lnum, l:end)
|
||||
if a:alt
|
||||
call setline(lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
|
||||
else
|
||||
call setline(lnum, substitute(l:line, '\s\+$', '', ''))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let l:lnum = line('.')
|
||||
let l:end = col('$') - 1
|
||||
let l:line = getline(l:lnum)
|
||||
if l:line =~# '\s$' && !s:InLiteral(l:lnum, l:end)
|
||||
if a:alt
|
||||
call setline(l:lnum, substitute(l:line, '\s\+$', '', ''))
|
||||
else
|
||||
call setline(l:lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -3,31 +3,46 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requ
|
||||
endif
|
||||
|
||||
""
|
||||
" Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
|
||||
"
|
||||
" When a file's shebang is "pip install -r" or "pip-compile",
|
||||
" set its filetype to |requirements|.
|
||||
function! requirements#shebang() abort
|
||||
let s:line1 = getline(1)
|
||||
" @section Introduction, intro
|
||||
" @library
|
||||
" <doc/@plugin(name).txt> is generated by <https://github.com/google/vimdoc>.
|
||||
" See <README.md> for more information about installation and screenshots.
|
||||
|
||||
if s:line1 =~# "^#!"
|
||||
if s:line1 =~# '^#!\s*\S*\<env\s'
|
||||
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
|
||||
let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
if s:line1 =~# '^#!\s*\a:[/\\]'
|
||||
let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!.*\<env\>'
|
||||
let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
|
||||
let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
|
||||
else
|
||||
let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
|
||||
endif
|
||||
if s:name =~# '^pip'
|
||||
set ft=requirements
|
||||
endif
|
||||
endif
|
||||
""
|
||||
" Update cache.
|
||||
function! requirements#update_cache() abort
|
||||
let s:items = []
|
||||
let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip'))
|
||||
let l:pypi_items = split(system('pip-cache pkgnames'))
|
||||
for l:item in l:pip_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pip'}]
|
||||
endfor
|
||||
for l:item in l:pypi_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pypi'}]
|
||||
endfor
|
||||
call writefile([json_encode(s:items)], s:cache)
|
||||
endfunction
|
||||
|
||||
if exists('*stdpath')
|
||||
let s:cache_dir_home = stdpath('cache')
|
||||
else
|
||||
let s:cache_dir_home = $HOME . '/.cache/nvim'
|
||||
endif
|
||||
let s:cache_dir = s:cache_dir_home . '/requirements.vim'
|
||||
call mkdir(s:cache_dir, 'p')
|
||||
""
|
||||
" Completion cache path.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#cache',
|
||||
\ s:cache_dir . '/requirements.json'
|
||||
\ )
|
||||
let s:cache = g:requirements#cache
|
||||
try
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
catch /\v^Vim%(\(\a+\))?:E(684|484|491):/
|
||||
call requirements#update_cache()
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
endtry
|
||||
""
|
||||
" Completion cache contents. For program.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#items', s:items)
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
|
||||
15
autoload/requirements/utils.vim
Normal file
15
autoload/requirements/utils.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requirements/utils.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
""
|
||||
" @section Configuration, config
|
||||
|
||||
function! s:Flag(name, default) abort
|
||||
let l:scope = get(split(a:name, ':'), 0, 'g:')
|
||||
let l:name = get(split(a:name, ':'), -1)
|
||||
let {l:scope}:{l:name} = get({l:scope}:, l:name, a:default)
|
||||
endfunction
|
||||
|
||||
let g:requirements#utils#plugin = {'Flag': funcref('s:Flag')}
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: Ruby
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@@ -492,7 +493,7 @@ class VimRubyCompletion
|
||||
trail = "%s%s" % [ dir, sub ]
|
||||
tcfg = "%sconfig" % trail
|
||||
|
||||
if File.exist?( tcfg )
|
||||
if File.exists?( tcfg )
|
||||
rails_base = trail
|
||||
break
|
||||
end
|
||||
@@ -505,7 +506,7 @@ class VimRubyCompletion
|
||||
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
if File.exist?( bootfile ) && File.exist?( envfile )
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
require envfile
|
||||
|
||||
@@ -3,17 +3,14 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'smt2', 'autoload/smt2/formatt
|
||||
endif
|
||||
|
||||
" Formatting requires a rather recent Vim version
|
||||
if (v:version < 802) || (v:version == 802 && !has("patch2725"))
|
||||
if !((v:version > 802) || (v:version == 802 && has("patch2725")))
|
||||
const s:errmsg_oldvim = "Vim >= 8.2.2725 required for auto-formatting"
|
||||
|
||||
"Dummies
|
||||
function! smt2#formatter#FormatCurrentParagraph()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatOutermostSExpr()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatFile()
|
||||
function! smt2#formatter#FormatAllParagraphs()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
|
||||
@@ -91,75 +88,55 @@ def Format(ast: dict<any>, indent = 0): string
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n")
|
||||
elseif ast.kind ==# 'File'
|
||||
var formatted = []
|
||||
for child in ast.value
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n\n")
|
||||
endif
|
||||
throw 'Cannot format AST node: ' .. string(ast)
|
||||
return '' # Unreachable
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
def FormatInCurrentBuffer(ast: dict<any>)
|
||||
def smt2#formatter#FormatCurrentParagraph()
|
||||
const cursor = getpos('.')
|
||||
const ast = smt2#parser#ParseCurrentParagraph()
|
||||
|
||||
# Format lines and potential surrounding text on them
|
||||
const formatted_lines = split(Format(ast), '\n')
|
||||
const ast_coords = ast.CalcCoords()
|
||||
const ws_mask = " \n\r\t"
|
||||
const first_line_part_to_keep = getline(ast_coords[0].line)
|
||||
->strcharpart(0, ast_coords[0].col - 2)
|
||||
->trim(ws_mask, 2)
|
||||
const last_line_part_to_keep = getline(ast_coords[1].line)
|
||||
->strcharpart(ast_coords[1].col - 1)
|
||||
->trim(ws_mask, 1)
|
||||
# Identify on which end of the buffer we are (to fix newlines later)
|
||||
silent! normal! {
|
||||
const is_first_paragraph = line('.') == 1
|
||||
silent! normal! }
|
||||
const is_last_paragraph = line('.') == line('$')
|
||||
|
||||
# If section of AST has trailing whitespace until the file end, remove it
|
||||
cursor(ast_coords[1].line, ast_coords[1].col)
|
||||
if search('\m\C\S', 'W') == 0
|
||||
deletebufline('%', ast_coords[1].line + 1, line('$'))
|
||||
# Replace paragraph by formatted lines
|
||||
const lines = split(Format(ast), '\n')
|
||||
silent! normal! {d}
|
||||
if is_last_paragraph && !is_first_paragraph
|
||||
call append('.', [''] + lines)
|
||||
else
|
||||
call append('.', lines + [''])
|
||||
endif
|
||||
|
||||
# Replace section of AST by formatted lines (w/o killing surrounding text)
|
||||
deletebufline('%', ast_coords[0].line, ast_coords[1].line)
|
||||
if !empty(last_line_part_to_keep)
|
||||
last_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
formatted_lines->append(ast_coords[0].line - 1)
|
||||
if !empty(first_line_part_to_keep)
|
||||
first_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
|
||||
# If section of AST has leading whitespace until the file start, remove it
|
||||
cursor(ast_coords[0].line, ast_coords[0].col)
|
||||
if search('\m\C\S', 'bW') == 0
|
||||
deletebufline('%', 1, ast_coords[0].line - 1)
|
||||
endif
|
||||
# Remove potentially introduced first empty line
|
||||
if is_first_paragraph | silent! :1delete | endif
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#formatter#FormatCurrentParagraph()
|
||||
const ast = smt2#parser#ParseCurrentParagraph()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
def smt2#formatter#FormatAllParagraphs()
|
||||
const cursor = getpos('.')
|
||||
const asts = smt2#parser#ParseAllParagraphs()
|
||||
|
||||
def smt2#formatter#FormatOutermostSExpr()
|
||||
const ast = smt2#parser#ParseOutermostSExpr()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
# Clear buffer & insert formatted paragraphs
|
||||
silent! :1,$delete
|
||||
for ast in asts
|
||||
const lines = split(Format(ast), '\n') + ['']
|
||||
call append('$', lines)
|
||||
endfor
|
||||
|
||||
def smt2#formatter#FormatFile()
|
||||
const ast = smt2#parser#ParseFile()
|
||||
FormatInCurrentBuffer(ast)
|
||||
# Remove first & trailing empty lines
|
||||
silent! :1delete
|
||||
silent! :$delete
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
enddef
|
||||
|
||||
@@ -11,37 +11,17 @@ set maxfuncdepth=100000000 # SMT files tend to be highly nested
|
||||
# TODO: Change Ast.kind type from string to enum/number?
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# AST nodes
|
||||
# AST nodes -- essentially named token wrappers
|
||||
#
|
||||
# Note: pos_from, pos_to and contains_comment allow for a fast FitsOneLine(ast)
|
||||
# function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens.
|
||||
# Note: pos_from, pos_to and contains_comment were only introduced to allow for
|
||||
# a fast FitsOneLine(ast) function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens
|
||||
# ------------------------------------------------------------------------------
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool, scanner: dict<any>): dict<any>
|
||||
# User-facing functionality wants start/end line and column -- not positions
|
||||
def CalcCoords(): list<dict<number>>
|
||||
const from = scanner.calcCoord(pos_from)
|
||||
# If expression ends at end of line, pos_to will be in next line.
|
||||
# That's undesired. Stay in the actual last line.
|
||||
var to = scanner.calcCoord(pos_to - 1)
|
||||
to.col += 1
|
||||
return [from, to]
|
||||
enddef
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment, CalcCoords: CalcCoords}
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool): dict<any>
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment}
|
||||
enddef
|
||||
|
||||
def FileAst(paragraphs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for paragraph in paragraphs
|
||||
if paragraph.contains_comment
|
||||
contains_comment = true
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('File', paragraphs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -49,10 +29,10 @@ def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scann
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment)
|
||||
enddef
|
||||
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -60,22 +40,15 @@ def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner:
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment)
|
||||
enddef
|
||||
|
||||
def AtomAst(token: dict<any>, scanner: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8, scanner)
|
||||
def AtomAst(token: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8)
|
||||
enddef
|
||||
|
||||
def PrintAst(ast: dict<any>, indent = 0)
|
||||
const coords = ast.CalcCoords()
|
||||
|
||||
echo printf("[%5d-%-5d) [%4d:%-3d-%4d:%-3d) %s[%s] ",
|
||||
ast.pos_from, ast.pos_to,
|
||||
coords[0].line, coords[0].col,
|
||||
coords[1].line, coords[1].col,
|
||||
repeat(' ', indent * 2),
|
||||
ast.kind)
|
||||
echo repeat(' ', indent * 2) .. '[' .. ast.kind .. '] '
|
||||
|
||||
if ast.kind ==# 'Atom'
|
||||
echon ast.value.lexeme
|
||||
@@ -87,18 +60,13 @@ def PrintAst(ast: dict<any>, indent = 0)
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
elseif ast.kind ==# 'File'
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Grammar
|
||||
# ------------------------------------------------------------------------------
|
||||
# File ::= Paragraph+
|
||||
# Paragraph ::= Expr+ EndOfParagraph
|
||||
# Paragraph ::= Expr+
|
||||
# Expr ::= SExpr | Atom
|
||||
# SExpr ::= '(' Expr* ')'
|
||||
|
||||
@@ -109,16 +77,14 @@ def AtStartOfLParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 0 # token_lparen
|
||||
enddef
|
||||
|
||||
def ParseLParen(scanner: dict<any>): dict<any>
|
||||
def ParseLParen(scanner: dict<any>) # consumes token; no return
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfLParen(),
|
||||
"ParseLParen called but not at start of LParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -128,16 +94,14 @@ def AtStartOfRParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 1 # token_rparen
|
||||
enddef
|
||||
|
||||
def ParseRParen(scanner: dict<any>): dict<any>
|
||||
def ParseRParen(scanner: dict<any>) # consumes token; no return
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
"ParseRParen called but not at start of RParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -154,7 +118,7 @@ def ParseAtom(scanner: dict<any>): dict<any>
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const ast = AtomAst(scanner.cur_token, scanner)
|
||||
const ast = AtomAst(scanner.cur_token)
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return ast
|
||||
enddef
|
||||
@@ -165,7 +129,6 @@ enddef
|
||||
def AtStartOfExpr(scanner: dict<any>): bool
|
||||
return scanner->AtStartOfSExpr() || scanner->AtStartOfAtom()
|
||||
enddef
|
||||
|
||||
def ParseExpr(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfExpr(),
|
||||
@@ -183,7 +146,6 @@ enddef
|
||||
# SExpr
|
||||
# ------------------------------------------------------------------------------
|
||||
const AtStartOfSExpr = funcref(AtStartOfLParen)
|
||||
|
||||
def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
@@ -203,10 +165,10 @@ def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
printf("Expected RParen but got %s", scanner.cur_token.kind->smt2#scanner#TokenKind2Str()),
|
||||
scanner.cur_token.pos)
|
||||
const end_token = scanner->ParseRParen()
|
||||
scanner->ParseRParen()
|
||||
|
||||
const pos_to = end_token.pos + 1
|
||||
return SExprAst(exprs, pos_from, pos_to, scanner)
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return SExprAst(exprs, pos_from, pos_to)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -225,132 +187,41 @@ def ParseParagraph(scanner: dict<any>): dict<any>
|
||||
exprs->add(scanner->ParseExpr())
|
||||
endwhile
|
||||
|
||||
const pos_to = exprs[-1].pos_to
|
||||
return ParagraphAst(exprs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# File
|
||||
# ------------------------------------------------------------------------------
|
||||
def ParseFile(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
var paragraphs = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
paragraphs->add(ast)
|
||||
endwhile
|
||||
|
||||
const pos_to = empty(paragraphs) ? pos_from : paragraphs[-1].pos_to
|
||||
return FileAst(paragraphs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
#
|
||||
# TODO: MoveTo* functions rely on local search instead of proper (but slow)
|
||||
# scanning of the whole file and may be incorrect in corner cases.
|
||||
# Consider tweaking.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Returns true if successful, i.e. on move to '(' of outermost SExpr
|
||||
def MoveToOutermostSExpr(): bool
|
||||
var cur_pos = getpos('.')
|
||||
while true
|
||||
silent! normal! [(
|
||||
const new_pos = getpos('.')
|
||||
if cur_pos == new_pos
|
||||
break
|
||||
else
|
||||
cur_pos = new_pos
|
||||
endif
|
||||
endwhile
|
||||
|
||||
const cur_char = getline('.')[charcol('.') - 1]
|
||||
return cur_char == '('
|
||||
enddef
|
||||
|
||||
def CursorInSExpr(): bool
|
||||
const cursor = getpos('.')
|
||||
silent! normal! [(
|
||||
const res = cursor != getpos('.')
|
||||
call setpos('.', cursor)
|
||||
return res
|
||||
enddef
|
||||
|
||||
def MoveToStartOfCurrentParagraph()
|
||||
# Empty (or whitespace) lines outside of S-expressions separate paragraphs.
|
||||
# Nothing to do if cursor is already at such a line.
|
||||
if !(getline('.')->trim()->empty() && !CursorInSExpr())
|
||||
# Move backwards until an empty line that is not in an SExpr is found,
|
||||
# or -- if there is none -- to the first line of the file
|
||||
while true
|
||||
const empty_line = search('\m\C^\s*$', 'b', 1)
|
||||
if !CursorInSExpr()
|
||||
break
|
||||
elseif empty_line == 0
|
||||
cursor(1, 1)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return ParagraphAst(exprs, pos_from, pos_to)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#parser#ParseCurrentParagraph(): dict<any>
|
||||
# source = [start of current paragraph, EOF]
|
||||
# Note: This is needed since `silent! normal! {y}` may not yank full paragraphs
|
||||
# in the context of multiline expressions
|
||||
const cursor = getpos('.')
|
||||
MoveToStartOfCurrentParagraph()
|
||||
const from = getpos('.')
|
||||
silent! normal! {
|
||||
const line_offset = line('.')
|
||||
const source = join(getline('.', '$'), "\n")
|
||||
call setpos('.', cursor)
|
||||
|
||||
# source = [paragraph of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! {` is not guaranteed to jump
|
||||
# to the start of the paragraph, e.g. if newlines occur in between.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
var scanner = smt2#scanner#Scanner(source, line_offset)
|
||||
const ast = scanner->ParseParagraph()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseOutermostSExpr(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
if ! MoveToOutermostSExpr()
|
||||
throw "Cursor is not in an S-expression!"
|
||||
endif
|
||||
const from = getpos('.')
|
||||
call setpos('.', cursor)
|
||||
def smt2#parser#ParseAllParagraphs(): list<dict<any>>
|
||||
# source = current buffer
|
||||
const source = join(getline(1, '$'), "\n")
|
||||
|
||||
# source = [start of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! %` is not guaranteed to jump
|
||||
# to the matching ')', e.g. if an unmatched '(' occurs in a comment.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
var scanner = smt2#scanner#Scanner(source)
|
||||
var asts = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
asts->add(ast)
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
const ast = scanner->ParseSExpr()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseFile(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
cursor(1, 1)
|
||||
const first_non_empty_line = search('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
# source = [first non-empty line, EOF]
|
||||
const source = join(getline(first_non_empty_line, '$'), "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, first_non_empty_line)
|
||||
const ast = scanner->ParseFile()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
if debug | ast->PrintAst() | endif
|
||||
endwhile
|
||||
return asts
|
||||
enddef
|
||||
|
||||
@@ -56,7 +56,7 @@ enddef
|
||||
|
||||
def PrettyPrint(scanner: dict<any>, token: dict<any>)
|
||||
const coord = scanner->Pos2Coord(token.pos)
|
||||
echo printf("%5d %4d:%-3d %8s %s", token.pos, coord.line, coord.col, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
echo printf("%4d:%-3d (%5d) %8s %s", coord.line, coord.col, token.pos, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -72,14 +72,12 @@ enddef
|
||||
# TODO: Enforce restriction to ASCII? We should if we use the lookup table below
|
||||
# TODO: Do not take a string but a character stream (or just buffer and pos)?
|
||||
|
||||
def smt2#scanner#Scanner(source: string, start_line = 1, start_col = 1): dict<any>
|
||||
def smt2#scanner#Scanner(source: string, line_offset = 1): dict<any>
|
||||
var scanner = {
|
||||
chars: source->trim(" \n\r\t", 2)->split('\zs'),
|
||||
line_offset: start_line, # start line of source string in buffer
|
||||
pos: start_col - 1, # pos in source string -- not column in line
|
||||
at_new_paragraph: false,
|
||||
}
|
||||
scanner.calcCoord = (pos: number): dict<number> => Pos2Coord(scanner, pos)
|
||||
chars: source->trim(" \t\n\r", 2)->split('\zs'),
|
||||
line_offset: line_offset, # start line of source string in buffer
|
||||
pos: 0, # pos in source string -- not column in line
|
||||
at_new_paragraph: false}
|
||||
|
||||
if scanner.chars->empty()
|
||||
scanner.at_eof = true
|
||||
|
||||
@@ -9,11 +9,6 @@ set cpoptions&vim
|
||||
let $TF_CLI_ARGS_fmt=''
|
||||
|
||||
function! terraform#fmt() abort
|
||||
silent execute 'w !'.g:terraform_binary_path.' fmt -check -'
|
||||
if v:shell_error == 0
|
||||
return
|
||||
endif
|
||||
|
||||
" Save the view.
|
||||
let curw = winsaveview()
|
||||
|
||||
|
||||
118
autoload/unison.vim
Normal file
118
autoload/unison.vim
Normal file
@@ -0,0 +1,118 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'unison', 'autoload/unison.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Unison functionality for Vim, including type/term omnicompletion.
|
||||
"
|
||||
" Maintainer: Unison Computing
|
||||
" Original Author: Cody Allen (ceedubs)
|
||||
|
||||
if exists('g:autoloaded_unison')
|
||||
finish
|
||||
endif
|
||||
let g:autoloaded_unison = 1
|
||||
|
||||
let s:required_config_value = "!REQUIRED!"
|
||||
|
||||
" adapted from https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/autoload/rust.vim#L9-L18
|
||||
function! s:config(name, default) abort
|
||||
let name = 'unison_' . a:name
|
||||
" Local buffer variable with same name takes predeence over global
|
||||
if has_key(b:, name)
|
||||
return get(b:, name)
|
||||
elseif has_key(g:, name)
|
||||
return get(g:, name)
|
||||
elseif a:default == s:required_config_value
|
||||
throw 'Missing required configuration value: ' . name
|
||||
else
|
||||
return a:default
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:curl_path() abort
|
||||
return s:config('curl_path', "curl")
|
||||
endfunction
|
||||
|
||||
function! s:jq_path() abort
|
||||
return s:config('jq_path', "jq")
|
||||
endfunction
|
||||
|
||||
function! unison#SetBufferDefaults() abort
|
||||
if s:config('set_buffer_defaults', 1)
|
||||
" Since Unison completion is fuzzy and not prefix-based, 'longest' doesn't
|
||||
" work well, and 'noinsert' behaves a little better.
|
||||
setlocal completeopt=menuone,noinsert,preview
|
||||
|
||||
setlocal omnifunc=unison#Complete
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Unison completion satisfying the standard vim completion signature, such
|
||||
" that it can be assigned to omnifunc.
|
||||
" vim will first call this to find the base input that should be completed,
|
||||
" and then will call it again with the base input.
|
||||
function! unison#Complete(findstart, base) abort
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
" Examples of where we want to count the start of a word:
|
||||
"
|
||||
" foo List.fold<cursor>
|
||||
" ^
|
||||
"
|
||||
" {Abor<cursor>
|
||||
" ^
|
||||
"
|
||||
" (List.fol<cursor>
|
||||
" ^
|
||||
while start > 0 && line[start - 1] !~ '\v\s|[!(){}\[\]]'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
return unison#CompleteForBase(a:base)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Return an array of completion items for the provided base input. For example
|
||||
" base could be 'List.foldL', in which case the top result would probably be
|
||||
" 'List.foldLeft'.
|
||||
function! unison#CompleteForBase(base) abort
|
||||
let resultLimit = s:config('complete_result_limit', 20)
|
||||
let apiHost = s:config('api_host', 'localhost')
|
||||
let apiPort = s:config('api_port', s:required_config_value)
|
||||
let apiToken = s:config('api_token', s:required_config_value)
|
||||
let apiUri = 'http://' . apiHost . ':' . apiPort . '/' . apiToken . '/api/find'
|
||||
|
||||
let curlCommand = s:curl_path() . " -Gfs
|
||||
\ --data-urlencode 'limit=" . resultLimit . "'
|
||||
\ --data-urlencode 'query=" . a:base . "' "
|
||||
\ . apiUri
|
||||
|
||||
let jqFilter = '
|
||||
\ def prettyTermType: .termType|[(.[] | .segment)]|add;
|
||||
\ def prettyTypeDef: if .tag == "BuiltinObject" then "builtin type " else "" end + (.contents|[(.[] | .segment)]|add);
|
||||
\ def termToMatch: {
|
||||
\ word: .bestFoundTermName,
|
||||
\ info: (.namedTerm.termName + " : " + (.namedTerm|prettyTermType)),
|
||||
\ menu: .namedTerm|prettyTermType
|
||||
\ };
|
||||
\ def typeToMatch: {
|
||||
\ word: .bestFoundTypeName,
|
||||
\ info: (.namedType.typeName + " : " + (.typeDef|prettyTypeDef)),
|
||||
\ menu: .typeDef|prettyTypeDef
|
||||
\ };
|
||||
\ .[][1]|(
|
||||
\ (select(.tag == "FoundTermResult")|.contents|termToMatch),
|
||||
\ (select(.tag == "FoundTypeResult")|.contents|typeToMatch)
|
||||
\ )'
|
||||
|
||||
let command = curlCommand . " | " . s:jq_path() . " -c '" . jqFilter . "'"
|
||||
let lines = system(command)
|
||||
let resultObjects = split(lines, "\n")
|
||||
call map(resultObjects, {_, val -> json_decode(val)})
|
||||
return resultObjects
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=2 sts=2 ts=2:
|
||||
@@ -128,7 +128,6 @@ let attributes_value = {
|
||||
\ 'http-equiv': ['Text', ''],
|
||||
\ 'icon': ['URL', ''],
|
||||
\ 'id': ['Text', ''],
|
||||
\ 'inert': ['Bool', ''],
|
||||
\ 'ismap': ['Bool', ''],
|
||||
\ 'keytype': ['Text', ''],
|
||||
\ 'label': ['Text', ''],
|
||||
@@ -195,7 +194,7 @@ let attributes_value = {
|
||||
\ }
|
||||
|
||||
if g:html5_event_handler_attributes_complete == 1
|
||||
let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncancel': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': [], 'onselectstart': [], 'onselectchange': []}
|
||||
let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': [], 'onselectstart': [], 'onselectchange': []}
|
||||
let global_attributes = extend(global_attributes, event_handler_attributes)
|
||||
|
||||
let body_attributes = {'onafterprint': [], 'onbeforeprint': [], 'onbeforeunload': [], 'onblur': [], 'onerror': [], 'onfocus': [], 'onhashchange': [], 'onload': [], 'onmessage': [], 'onoffline': [], 'ononline': [], 'onpopstate': [], 'onredo': [], 'onresize': [], 'onstorage': [], 'onundo': [], 'onunload': []}
|
||||
@@ -206,7 +205,6 @@ if g:html5_event_handler_attributes_complete == 1
|
||||
\ 'onbeforeprint': ['Script', ''],
|
||||
\ 'onbeforeunload': ['Script', ''],
|
||||
\ 'onblur': ['Script', ''],
|
||||
\ 'oncancel': ['Script', ''],
|
||||
\ 'oncanplay': ['Script', ''],
|
||||
\ 'oncanplaythrough': ['Script', ''],
|
||||
\ 'onchange': ['Script', ''],
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'compiler/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: jq
|
||||
" Maintainer: Vito <vito.blog@gmail.com>
|
||||
" Last Change: 2024 Apr 17
|
||||
" Upstream: https://github.com/vito-c/jq.vim
|
||||
|
||||
if exists('b:current_compiler')
|
||||
finish
|
||||
endif
|
||||
let b:current_compiler = 'jq'
|
||||
|
||||
let s:save_cpoptions = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
if has('unix')
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ /dev/null
|
||||
else
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ nul
|
||||
endif
|
||||
CompilerSet errorformat=%E%m\ at\ \\<%o\\>\\,\ line\ %l:,
|
||||
\%Z,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpoptions = s:save_cpoptions
|
||||
unlet s:save_cpoptions
|
||||
@@ -23,11 +23,7 @@ if !exists('g:ledger_main')
|
||||
let g:ledger_main = '%'
|
||||
endif
|
||||
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
if !b:is_hledger
|
||||
if !g:ledger_is_hledger
|
||||
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
||||
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
||||
" Capture Ledger warnings:
|
||||
@@ -36,8 +32,5 @@ if !b:is_hledger
|
||||
CompilerSet errorformat+=%-G%.%#
|
||||
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
|
||||
else
|
||||
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ check\ '. substitute(g:ledger_extra_options, ' ', '\\ ', 'g')
|
||||
CompilerSet errorformat=hledger:\ %trror:\ %f:%l:%c:
|
||||
CompilerSet errorformat+=hledger:\ %trror:\ %f:%l:
|
||||
CompilerSet errorformat+=hledger:\ %trror:\ %f:%l-%.%#:
|
||||
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
|
||||
endif
|
||||
|
||||
@@ -7,7 +7,7 @@ endif
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" License: This file is part of LilyPond, the GNU music typesetter.
|
||||
"
|
||||
" Copyright (C) 2004--2022 Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Copyright (C) 2004, 2007 Heikki Junes <hjunes@cc.hut.fi>
|
||||
"
|
||||
" LilyPond is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -7,7 +7,6 @@ endif
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: https://github.com/ocaml/vim-ocaml
|
||||
" Last Change:
|
||||
" 2023 Nov 24 - Improved error format (Samuel Hym)
|
||||
" 2021 Nov 03 - Improved error format (Jules Aguillon)
|
||||
" 2020 Mar 28 - Improved error format (Thomas Leonard)
|
||||
" 2017 Nov 26 - Improved error format (Markus Mottl)
|
||||
@@ -16,6 +15,17 @@ endif
|
||||
" Marc Weber's comments:
|
||||
" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
|
||||
" ocamake and whatnot. So which one to use?
|
||||
"
|
||||
" This error format was moved from ftplugin/ocaml.vim to this file,
|
||||
" because ftplugin is the wrong file to set an error format
|
||||
" and the error format itself is annoying because it joins many lines in this
|
||||
" error case:
|
||||
"
|
||||
" Error: The implementation foo.ml does not match the interface foo.cmi:
|
||||
" Modules do not match case.
|
||||
"
|
||||
" So having it here makes people opt-in
|
||||
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -25,37 +35,19 @@ let current_compiler = "ocaml"
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Patch 8.2.4329 introduces %e and %k as end line and end column positions
|
||||
|
||||
if has('patch-8.2.4329')
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %l-%e\\,\ characters\ %c-%k:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%k:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%k\ %.%#,
|
||||
else
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %l-%*\\d\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
|
||||
endif
|
||||
|
||||
CompilerSet errorformat +=
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l:,
|
||||
\%+EReference\ to\ unbound\ regexp\ name\ %m,
|
||||
\%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
|
||||
\%Wocamlyacc:\ w\ -\ %m,
|
||||
\%-Zmake%.%#
|
||||
|
||||
if get(g:, "ocaml_compiler_compact_messages", v:true)
|
||||
CompilerSet errorformat +=
|
||||
\%C%*\\d\ \|%.%#,
|
||||
\%C%p^%#,
|
||||
\%C%m
|
||||
endif
|
||||
|
||||
CompilerSet errorformat +=
|
||||
\%Z,
|
||||
\%-Zmake%.%#,
|
||||
\%C%*\\d\ \|%.%#,
|
||||
\%C%p^%#,
|
||||
\%C%m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a:\ Entering\ directory\ `%f',
|
||||
@@ -66,12 +58,8 @@ CompilerSet errorformat +=
|
||||
\%X%*\\a:\ Leaving\ directory\ '%f',
|
||||
\%DEntering\ directory\ '%f',
|
||||
\%XLeaving\ directory\ '%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
if get(g:, "ocaml_compiler_compact_messages", v:true)
|
||||
CompilerSet errorformat +=
|
||||
\%+G%m
|
||||
endif
|
||||
\%DMaking\ %*\\a\ in\ %f,
|
||||
\%+G%m
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'compiler/pip_
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.8.0
|
||||
" Version: 1.7.1
|
||||
" Author: raimon <raimon49@hotmail.com>
|
||||
" License: MIT LICENSE
|
||||
" The MIT License (MIT)
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: Rake
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: RSpec
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -7,6 +7,7 @@ endif
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -22,4 +22,4 @@ endif
|
||||
|
||||
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||
|
||||
CompilerSet errorformat+=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
|
||||
@@ -62,7 +62,7 @@ if exists('g:loaded_matchit') && !exists('b:match_words')
|
||||
let b:match_ignorecase = 0
|
||||
|
||||
let b:match_words =
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|\%(abstract\s\+\)\@<!def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ ':' .
|
||||
\ '\<\%(else\|elsif\|ensure\|when\|in\|rescue\|break\|next\)\>' .
|
||||
\ ':' .
|
||||
|
||||
@@ -11,4 +11,37 @@ setlocal commentstring=--\ %s
|
||||
|
||||
set smarttab
|
||||
|
||||
if exists('g:dhall_use_ctags')
|
||||
if g:dhall_use_ctags == 1
|
||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||
endif
|
||||
endif
|
||||
|
||||
function! StripTrailingWhitespace()
|
||||
let myline=line('.')
|
||||
let mycolumn = col('.')
|
||||
exec 'silent %s/ *$//'
|
||||
call cursor(myline, mycolumn)
|
||||
endfunction
|
||||
|
||||
if exists('g:dhall_strip_whitespace')
|
||||
if g:dhall_strip_whitespace == 1
|
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||
endif
|
||||
endif
|
||||
|
||||
function! DhallFormat()
|
||||
let cursor = getpos('.')
|
||||
exec 'normal! gg'
|
||||
exec 'silent !dhall format ' . expand('%')
|
||||
exec 'e'
|
||||
call setpos('.', cursor)
|
||||
endfunction
|
||||
|
||||
if exists('g:dhall_format')
|
||||
if g:dhall_format == 1
|
||||
au BufWritePost *.dhall call DhallFormat()
|
||||
endif
|
||||
endif
|
||||
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'git', 'ftplugin/git.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2023 Mar 26
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal nomodeline
|
||||
|
||||
let b:undo_ftplugin = "setl modeline<"
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'ftplugin/graphql.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -31,7 +31,7 @@ if get(g:, 'hcl_fold_sections', 0)
|
||||
endif
|
||||
|
||||
" Set the commentstring
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal commentstring=#%s
|
||||
let b:undo_ftplugin .= ' commentstring<'
|
||||
|
||||
if get(g:, 'hcl_align', 0) && exists(':Tabularize')
|
||||
|
||||
@@ -25,5 +25,77 @@ endif
|
||||
" Prefer Vim help instead of manpages.
|
||||
setlocal keywordprg=:help
|
||||
|
||||
if !exists('g:no_plugin_maps')
|
||||
function! s:show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
let last_added = 0
|
||||
let has_section = 0
|
||||
let has_sub_section = 0
|
||||
|
||||
while lnum && lnum <= last_line
|
||||
let level = 0
|
||||
let add_text = ''
|
||||
let text = getline(lnum)
|
||||
|
||||
if text =~# '^=\+$' && lnum + 1 < last_line
|
||||
" A de-facto section heading. Other headings are inferred.
|
||||
let has_section = 1
|
||||
let has_sub_section = 0
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let text = getline(lnum)
|
||||
let add_text = text
|
||||
while add_text =~# '\*[^*]\+\*\s*$'
|
||||
let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$')
|
||||
endwhile
|
||||
elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$'
|
||||
" Any line that's yelling is important.
|
||||
let has_sub_section = 1
|
||||
let level = has_section
|
||||
let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$')
|
||||
elseif text =~# '\~$'
|
||||
\ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}'
|
||||
\ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$'
|
||||
\ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$'
|
||||
" These lines could be headers or code examples. We only want the
|
||||
" ones that have subsequent lines at the same indent or more.
|
||||
let l = nextnonblank(lnum + 1)
|
||||
if getline(l) =~# '\*[^*]\+\*$'
|
||||
" Ignore tag lines
|
||||
let l = nextnonblank(l + 1)
|
||||
endif
|
||||
|
||||
if indent(lnum) <= indent(l)
|
||||
let level = has_section + has_sub_section
|
||||
let add_text = matchstr(text, '\S.*')
|
||||
endif
|
||||
endif
|
||||
|
||||
let add_text = substitute(add_text, '\s\+$', '', 'g')
|
||||
if !empty(add_text) && last_added != lnum
|
||||
let last_added = lnum
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
|
||||
\ 'text': repeat(' ', level) . add_text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Help TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
nnoremap <silent><buffer> gO :call <sid>show_toc()<cr>
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -2,19 +2,4 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'ftplugin/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Language: jq
|
||||
" Maintainer: Vito <vito.blog@gmail.com>
|
||||
" Last Change: 2024 Apr 17
|
||||
" Upstream: https://github.com/vito-c/jq.vim
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = 'setl inc< commentstring<'
|
||||
|
||||
setlocal include=^\\s*\\%(import\\\|include\\)
|
||||
setlocal commentstring=#%s
|
||||
compiler jq
|
||||
|
||||
@@ -8,9 +8,6 @@ endif
|
||||
" -- fmt
|
||||
command! -nargs=0 JsonnetFmt call jsonnet#Format()
|
||||
|
||||
" -- eval
|
||||
command! -nargs=0 JsonnetEval call jsonnet#Eval()
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ setlocal fo-=t fo+=croql
|
||||
let b:julia_vim_loaded = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||
\ . " define< fo< cinoptions< completefunc<"
|
||||
\ . " expandtab< shiftwidth<"
|
||||
\ . " define< fo< indentexpr< indentkeys< cinoptions< completefunc<"
|
||||
\ . " | unlet! b:commentary_format"
|
||||
\ . " | unlet! b:smartcomment_force_linemode"
|
||||
\ . " | unlet! b:julia_vim_loaded"
|
||||
|
||||
|
||||
if !exists("g:julia_set_indentation") || g:julia_set_indentation != 0
|
||||
" As suggested by Style Guide.
|
||||
setlocal expandtab shiftwidth=4
|
||||
let b:undo_ftplugin .= " | setlocal expandtab< shiftwidth<"
|
||||
endif
|
||||
|
||||
" MatchIt plugin support
|
||||
@@ -109,7 +109,7 @@ let b:smartcomment_force_linemode = 1 " for carlobaldassi/vim-smartcomment
|
||||
|
||||
if has("gui_win32")
|
||||
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
||||
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
" Lookup documents
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'ftplugin/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2023 Jul 08
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal iskeyword+=-
|
||||
setlocal comments=n:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let b:undo_ftplugin = "setlocal iskeyword< comments< commentstring<"
|
||||
@@ -7,7 +7,8 @@ endif
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" License: This file is part of LilyPond, the GNU music typesetter.
|
||||
"
|
||||
" Copyright (C) 1998--2022 Han-Wen Nienhuys <hanwen@xs4all.nl>
|
||||
" Copyright (C) 1998, 2002, 2004, 2010, 2016
|
||||
" Han-Wen Nienhuys <hanwen@xs4all.nl>
|
||||
"
|
||||
" LilyPond is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
@@ -35,9 +36,6 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal autoindent
|
||||
setlocal shiftwidth=2
|
||||
"
|
||||
@@ -79,17 +77,3 @@ setlocal dictionary-=$VIM/syntax/lilypond-words dictionary+=$VIM/syntax/lilypond
|
||||
setlocal complete-=k complete+=k
|
||||
"
|
||||
setlocal showmatch
|
||||
|
||||
let b:undo_ftplugin = "setlocal autoindent< cpoptions< complete< dictionary< showmatch< shiftwidth< wildcharm< wildmenu<" .
|
||||
\ " | silent! execute 'unmap <buffer> <F4>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F5>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F6>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F7>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F8>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F9>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F10>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F12>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <S-F12>'"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -4,7 +4,7 @@ endif
|
||||
|
||||
"TODO print messages when on visual mode. I only see VISUAL, not the messages.
|
||||
|
||||
" Function interface philosophy:
|
||||
" Function interface phylosophy:
|
||||
"
|
||||
" - functions take arbitrary line numbers as parameters.
|
||||
" Current cursor line is only a suitable default parameter.
|
||||
@@ -60,7 +60,7 @@ let s:levelRegexpDict = {
|
||||
\ 6: '\v^######[^#]@='
|
||||
\ }
|
||||
|
||||
" Matches any header level of any type.
|
||||
" Maches any header level of any type.
|
||||
"
|
||||
" This could be deduced from `s:levelRegexpDict`, but it is more
|
||||
" efficient to have a single regexp for this.
|
||||
@@ -498,9 +498,7 @@ endfunction
|
||||
function! s:SetexToAtx(line1, line2)
|
||||
let l:originalNumLines = line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n\=+$/# \1/'
|
||||
|
||||
let l:changed = l:originalNumLines - line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . (a:line2 - l:changed) . 'substitute/\v(.*\S.*)\n-+$/## \1'
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n-+$/## \1/'
|
||||
return l:originalNumLines - line('$')
|
||||
endfunction
|
||||
|
||||
@@ -542,19 +540,6 @@ endfunction
|
||||
"
|
||||
function! s:TableFormat()
|
||||
let l:pos = getpos('.')
|
||||
|
||||
if get(g:, 'vim_markdown_borderless_table', 0)
|
||||
" add `|` to the beginning of the line if it isn't present
|
||||
normal! {
|
||||
call search('|')
|
||||
execute 'silent .,''}s/\v^(\s{0,})\|?([^\|])/\1|\2/e'
|
||||
|
||||
" add `|` to the end of the line if it isn't present
|
||||
normal! {
|
||||
call search('|')
|
||||
execute 'silent .,''}s/\v([^\|])\|?(\s{0,})$/\1|\2/e'
|
||||
endif
|
||||
|
||||
normal! {
|
||||
" Search instead of `normal! j` because of the table at beginning of file edge case.
|
||||
call search('|')
|
||||
@@ -565,7 +550,7 @@ function! s:TableFormat()
|
||||
let l:flags = (&gdefault ? '' : 'g')
|
||||
execute 's/\(:\@<!-:\@!\|[^|:-]\)//e' . l:flags
|
||||
execute 's/--/-/e' . l:flags
|
||||
Tabularize /\(\\\)\@<!|
|
||||
Tabularize /|
|
||||
" Move colons for alignment to left or right side of the cell.
|
||||
execute 's/:\( \+\)|/\1:|/e' . l:flags
|
||||
execute 's/|\( \+\):/|:\1/e' . l:flags
|
||||
@@ -673,12 +658,7 @@ endfunction
|
||||
function! s:OpenUrlUnderCursor()
|
||||
let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.'))
|
||||
if l:url !=# ''
|
||||
if l:url =~? 'http[s]\?:\/\/[[:alnum:]%\/_#.-]*'
|
||||
"Do nothing
|
||||
else
|
||||
let l:url = expand(expand('%:h').'/'.l:url)
|
||||
endif
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
else
|
||||
echomsg 'The cursor is not on a link.'
|
||||
endif
|
||||
@@ -736,7 +716,7 @@ if !exists('*s:EditUrlUnderCursor')
|
||||
execute l:editmethod l:url
|
||||
endif
|
||||
if l:anchor !=# ''
|
||||
call search(l:anchor, 's')
|
||||
silent! execute '/'.l:anchor
|
||||
endif
|
||||
else
|
||||
execute l:editmethod . ' <cfile>'
|
||||
@@ -782,7 +762,7 @@ endif
|
||||
command! -buffer -range=% HeaderDecrease call s:HeaderDecrease(<line1>, <line2>)
|
||||
command! -buffer -range=% HeaderIncrease call s:HeaderDecrease(<line1>, <line2>, 1)
|
||||
command! -buffer -range=% SetexToAtx call s:SetexToAtx(<line1>, <line2>)
|
||||
command! -buffer -range TableFormat call s:TableFormat()
|
||||
command! -buffer TableFormat call s:TableFormat()
|
||||
command! -buffer Toc call s:Toc()
|
||||
command! -buffer Toch call s:Toc('horizontal')
|
||||
command! -buffer Tocv call s:Toc('vertical')
|
||||
@@ -878,23 +858,19 @@ function! s:SyntaxInclude(filetype)
|
||||
return grouplistname
|
||||
endfunction
|
||||
|
||||
function! s:IsHighlightSourcesEnabledForBuffer()
|
||||
" Enable for markdown buffers, and for liquid buffers with markdown format
|
||||
return &filetype =~# 'markdown' || get(b:, 'liquid_subtype', '') =~# 'markdown'
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownRefreshSyntax(force)
|
||||
" Use != to compare &syntax's value to use the same logic run on
|
||||
" $VIMRUNTIME/syntax/synload.vim.
|
||||
"
|
||||
" vint: next-line -ProhibitEqualTildeOperator
|
||||
if s:IsHighlightSourcesEnabledForBuffer() && line('$') > 1 && &syntax != 'OFF'
|
||||
if &filetype =~# 'markdown' && line('$') > 1 && &syntax != 'OFF'
|
||||
call s:MarkdownHighlightSources(a:force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownClearSyntaxVariables()
|
||||
if s:IsHighlightSourcesEnabledForBuffer()
|
||||
if &filetype =~# 'markdown'
|
||||
unlet! b:mkd_included_filetypes
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -23,4 +23,3 @@ if get(g:, 'nix_recommended_style', 1)
|
||||
\ softtabstop=2
|
||||
\ expandtab
|
||||
endif
|
||||
let b:match_words = '\<if\>:\<then\>:\<else\>,\<let\>:\<in\>'
|
||||
|
||||
@@ -125,13 +125,21 @@ if !exists("g:did_ocaml_switch")
|
||||
nnoremap <Plug>OCamlSwitchEdit :<C-u>call OCaml_switch(0)<CR>
|
||||
nnoremap <Plug>OCamlSwitchNewWin :<C-u>call OCaml_switch(1)<CR>
|
||||
fun OCaml_switch(newwin)
|
||||
let open_command = a:newwin == 1 ? "new" : "arge"
|
||||
if (match(bufname(""), "\\.mli$") >= 0)
|
||||
let fname = s:Fnameescape(substitute(bufname(""), "\\.mli$", ".ml", ""))
|
||||
if (a:newwin == 1)
|
||||
exec "new " . fname
|
||||
else
|
||||
exec "arge " . fname
|
||||
endif
|
||||
elseif (match(bufname(""), "\\.ml$") >= 0)
|
||||
let fname = s:Fnameescape(bufname("")) . "i"
|
||||
if (a:newwin == 1)
|
||||
exec "new " . fname
|
||||
else
|
||||
exec "arge " . fname
|
||||
endif
|
||||
endif
|
||||
exec open_command " " . fname
|
||||
endfun
|
||||
endif
|
||||
|
||||
@@ -645,11 +653,6 @@ endfunction
|
||||
nnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("normal")<CR>
|
||||
xnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("visual")<CR>`<
|
||||
|
||||
" Make sure the environment is consistent
|
||||
if !exists('g:opam_current_compiler') && exists('g:opam_init_env') && g:opam_init_env != 0
|
||||
call opam#eval_env()
|
||||
endif
|
||||
|
||||
let &cpoptions=s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
|
||||
@@ -2,66 +2,4 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'octave', 'ftplugin/octave.vim
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: GNU Octave
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Sep 02
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" TODO: update Matlab ftplugin and source it as the base file?
|
||||
|
||||
setlocal comments=s:%{,m:\ ,e:%},s:#{,m:\ ,e:#},:%,:#
|
||||
setlocal commentstring=%\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal keywordprg=info\ octave\ --vi-keys\ --index-search
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_words = '\<unwind_protect\>:\<unwind_protect_cleanup\>:\<end_unwind_protect\>'
|
||||
if exists("octave_use_matlab_end")
|
||||
let b:match_words .= ',' ..
|
||||
\ '\<\%(classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\|try\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<\%(elseif\|else\|case\|otherwise\|break\|continue\|catch\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<end\>'
|
||||
else
|
||||
let b:match_words .= ',' ..
|
||||
\ '\<classdef\>:\<endclassdef\>,' ..
|
||||
\ '\<enumeration\>:\<endenumeration\>,' ..
|
||||
\ '\<events\>:\<endevents\>,' ..
|
||||
\ '\<do\>:\<\%(break\|continue\)\>:\<until\>' ..
|
||||
\ '\<for\>:\<\%(break\|continue\)\>:\<endfor\>,' ..
|
||||
\ '\<function\>:\<return\>:\<endfunction\>,' ..
|
||||
\ '\<if\>:\<\%(elseif\|else\)\>:\<endif\>,' ..
|
||||
\ '\<methods\>:\<endmethods\>,' ..
|
||||
\ '\<parfor\>:\<endparfor\>,' ..
|
||||
\ '\<properties\>:\<endproperties\>,' ..
|
||||
\ '\<switch\>:\<\%(case\|otherwise\)\>:\<endswitch\>,' ..
|
||||
\ '\<while\>:\<\%(break\|continue\)\>:\<endwhile\>,' ..
|
||||
\ '\<try\>:\<catch\>:\<end_try_catch\>'
|
||||
endif
|
||||
" only match in statement position
|
||||
let s:statement_start = escape('\%(\%(^\|;\)\s*\)\@<=', '\')
|
||||
let b:match_words = substitute(b:match_words, '\\<', s:statement_start, 'g')
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "GNU Octave Source Files (*.m)\t*.m\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< kp< " ..
|
||||
\ "| unlet! b:browsefilter b:match_words"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
|
||||
@@ -33,7 +33,6 @@ endif
|
||||
|
||||
if get(g:, 'plantuml_set_makeprg', 1)
|
||||
let &l:makeprg=g:plantuml_executable_script . ' %'
|
||||
let &l:errorformat='Error\ line %l in file: %f,%Z%m'
|
||||
endif
|
||||
|
||||
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
|
||||
|
||||
44
ftplugin/pony.vim
Normal file
44
ftplugin/pony.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'ftplugin/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
setlocal comments=://,nsr:/*,mb:*,ex:*/
|
||||
setlocal commentstring=/*%s*/
|
||||
setlocal formatoptions-=t fo+=c fo+=r fo+=o fo+=q fo+=l fo+=j
|
||||
|
||||
"setlocal path=
|
||||
"setlocal includeexpr=
|
||||
setlocal include=\\v^\\s*use\\_s+%(\\i+\\_s*\\=\\_s*)?"\\zs[^"]*\\ze"
|
||||
setlocal define=\\v^\\s*%(actor\|class\|struct\|primitive\|trait\|interface\|type\|new\|be\|fun\|let\|var\|embed\|use\|for\\_s+%(\\i+\\_s*,\\_s*)*\|with\\_s+%(\\i+\\_s*,\\_s*)*)\|(<\\i+\\_s*:\\_s*\\i+)@=
|
||||
setlocal isident=@,48-57,_,39
|
||||
setlocal iskeyword=@,48-57,_,39
|
||||
setlocal suffixesadd=.pony
|
||||
setlocal matchpairs=(:),{:},[:]
|
||||
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_skip = 's:Comment\|String\|Character\|CaseGuard'
|
||||
let b:match_words = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>\m:\v<%(then|elseif|else|until|do|in|elseiftype)>|\|\m:\<end\>,(:),\[:\],{:}'
|
||||
" TODO: for more concise behavior
|
||||
"let b:match_words = 'pony#GetMatchWords()'
|
||||
source $VIMRUNTIME/macros/matchit.vim
|
||||
|
||||
let b:undo_ftplugin = 'set comments< commentstring< formatoptions< path< include< includeexpr< define< isident< iskeyword< suffixesadd< matchpairs<'
|
||||
\ . ' | unlet! b:match_ignorecase b:match_skip b:match_words'
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
@@ -1,11 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'prisma', 'ftplugin/prisma.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if (exists('b:did_ftplugin'))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
setlocal iskeyword+=@-@
|
||||
setlocal comments=://
|
||||
setlocal commentstring=//\ %s
|
||||
@@ -21,9 +21,6 @@ setlocal formatoptions+=tcqroj
|
||||
" Enable autocompletion of hyphenated PowerShell commands,
|
||||
" e.g. Get-Content or Get-ADUser
|
||||
setlocal iskeyword+=-
|
||||
" Make string literal related text objects work properly when string
|
||||
" contains escaped quote characters
|
||||
setlocal quoteescape=`
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
@@ -48,16 +45,16 @@ if exists('s:pwsh_cmd')
|
||||
if !has('gui_running') && executable('less') &&
|
||||
\ !(exists('$ConEmuBuild') && &term =~? '^xterm')
|
||||
" For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
else
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
endif
|
||||
setlocal keywordprg=:Ps1KeywordPrg
|
||||
endif
|
||||
setlocal keywordprg=:GetHelp
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg< quoteescape<" .
|
||||
\ " | sil! delc -buffer Ps1KeywordPrg" .
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
|
||||
@@ -71,11 +71,6 @@ endif
|
||||
"setl commentstring=;;%s
|
||||
setl commentstring=#\|\ %s\ \|#
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Racket Source Files (*.rkt *.rktl)\t*.rkt;*.rktl\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo our settings when the filetype changes away from Racket
|
||||
" (this should be amended if settings/mappings are added above!)
|
||||
let b:undo_ftplugin =
|
||||
@@ -83,4 +78,3 @@ let b:undo_ftplugin =
|
||||
\. "| setl makeprg< commentstring<"
|
||||
\. "| nunmap <buffer> K"
|
||||
\. "| vunmap <buffer> K"
|
||||
\. "| unlet! b:browsefilter"
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'ftplugin/requ
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.8.0
|
||||
" Version: 1.7.1
|
||||
" Author: raimon <raimon49@hotmail.com>
|
||||
" License: MIT LICENSE
|
||||
" The MIT License (MIT)
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: Ruby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
@@ -62,38 +63,24 @@ if !exists('g:ruby_version_paths')
|
||||
let g:ruby_version_paths = {}
|
||||
endif
|
||||
|
||||
let s:path_split = has('win32') ? ';' : ':'
|
||||
|
||||
function! s:query_path(root) abort
|
||||
" Disabled by default for security reasons.
|
||||
if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) || empty(a:root)
|
||||
return map(split($RUBYLIB, s:path_split), 'v:val ==# "." ? "" : v:val')
|
||||
endif
|
||||
let code = "print $:.join %q{,}"
|
||||
if &shellxquote == "'"
|
||||
let args = ' --disable-gems -e "' . code . '"'
|
||||
if &shell =~# 'sh' && empty(&shellxquote)
|
||||
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||
else
|
||||
let args = " --disable-gems -e '" . code . "'"
|
||||
let prefix = ''
|
||||
endif
|
||||
if &shellxquote == "'"
|
||||
let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
|
||||
else
|
||||
let path_check = prefix."ruby --disable-gems -e '" . code . "'"
|
||||
endif
|
||||
|
||||
let cd = haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd'
|
||||
let cd = haslocaldir() ? 'lcd' : 'cd'
|
||||
let cwd = fnameescape(getcwd())
|
||||
try
|
||||
exe cd fnameescape(a:root)
|
||||
for dir in split($PATH, s:path_split)
|
||||
if dir !=# '.' && executable(dir . '/ruby') == 1
|
||||
let exepath = dir . '/ruby'
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if exists('l:exepath')
|
||||
let path = split(system(exepath . args),',')
|
||||
if v:shell_error
|
||||
let path = []
|
||||
endif
|
||||
else
|
||||
let path = []
|
||||
endif
|
||||
let path = split(system(path_check),',')
|
||||
exe cd cwd
|
||||
return path
|
||||
finally
|
||||
@@ -134,8 +121,10 @@ else
|
||||
if !exists('g:ruby_default_path')
|
||||
if has("ruby") && has("win32")
|
||||
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
|
||||
else
|
||||
elseif executable('ruby') && !empty($HOME)
|
||||
let g:ruby_default_path = s:query_path($HOME)
|
||||
else
|
||||
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')
|
||||
endif
|
||||
endif
|
||||
let s:ruby_paths = g:ruby_default_path
|
||||
|
||||
@@ -5,36 +5,11 @@ endif
|
||||
setlocal iskeyword+=-,:,#,',$
|
||||
setlocal commentstring=;%s
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Mappings for solver functionality
|
||||
" ------------------------------------------------------------------------------
|
||||
nnoremap <silent> <buffer> <Plug>Smt2Run :call smt2#solver#Run()<cr>
|
||||
if !hasmapto('<Plug>Smt2Run', 'n')
|
||||
nmap <silent> <localleader>r <Plug>Smt2Run
|
||||
endif
|
||||
nnoremap <silent> <buffer> <localleader>r :call smt2#solver#Run()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>R :call smt2#solver#RunAndShowResult()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>v :call smt2#solver#PrintVersion()<cr>
|
||||
|
||||
nnoremap <silent> <buffer> <Plug>Smt2RunAndShowResult :call smt2#solver#RunAndShowResult()<cr>
|
||||
if !hasmapto('<Plug>Smt2RunAndShowResult', 'n')
|
||||
nmap <silent> <localleader>R <Plug>Smt2RunAndShowResult
|
||||
endif
|
||||
|
||||
nnoremap <silent> <Plug>Smt2PrintVersion :call smt2#solver#PrintVersion()<CR>
|
||||
if !hasmapto('<Plug>Smt2PrintVersion', 'n')
|
||||
nmap <silent> <localleader>v <Plug>Smt2PrintVersion
|
||||
endif
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Mappings for formatting functionality
|
||||
" ------------------------------------------------------------------------------
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormatCurrentParagraph :call smt2#formatter#FormatCurrentParagraph()<cr>
|
||||
if !hasmapto('<Plug>Smt2FormatCurrentParagraph', 'n') && (mapcheck('<localleader>f', 'n') == '')
|
||||
nmap <silent> <localleader>f <Plug>Smt2FormatCurrentParagraph
|
||||
endif
|
||||
|
||||
" Alternative function to put on <localleader>f
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormatOutermostSExpr :call smt2#formatter#FormatOutermostSExpr()<cr>
|
||||
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormalFile :call smt2#formatter#FormatFile()<cr>
|
||||
if !hasmapto('<Plug>Smt2FormalFile', 'n')
|
||||
nmap <silent> <localleader>F <Plug>Smt2FormalFile
|
||||
endif
|
||||
nnoremap <silent> <buffer> <localleader>f :call smt2#formatter#FormatCurrentParagraph()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>F :call smt2#formatter#FormatAllParagraphs()<cr>
|
||||
|
||||
@@ -52,7 +52,6 @@ if get(g:, 'terraform_fmt_on_save', 0)
|
||||
autocmd!
|
||||
autocmd BufWritePre *.tf call terraform#fmt()
|
||||
autocmd BufWritePre *.tfvars call terraform#fmt()
|
||||
autocmd BufWritePre *.tftest.hcl call terraform#fmt()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
|
||||
@@ -19,11 +19,8 @@ setlocal commentstring=//\ %s
|
||||
" " and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let b:undo_ftplugin = 'setl fo< cms<'
|
||||
|
||||
if !&l:formatexpr && !&l:formatprg
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
let b:undo_ftplugin .= ' fex<'
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
endif
|
||||
|
||||
" setlocal foldmethod=syntax
|
||||
@@ -32,64 +29,64 @@ let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
function! Fixedgq(lnum, count)
|
||||
let l:tw = &tw ? &tw : 80
|
||||
let l:tw = &tw ? &tw : 80
|
||||
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if yats#IsLineComment(a:lnum, l:first_char) || yats#IsInMultilineComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if yats#IsLineComment(a:lnum, l:first_char) || yats#IsInMultilineComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Put all the lines on one line and do normal splitting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal! J
|
||||
endwhile
|
||||
endif
|
||||
" Put all the lines on one line and do normal splitting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal! J
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let l:winview = winsaveview()
|
||||
let l:winview = winsaveview()
|
||||
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
|
||||
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
|
||||
return 0
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! TsIncludeExpr(file)
|
||||
@@ -101,12 +98,10 @@ function! TsIncludeExpr(file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
setlocal path+=./node_modules/**,node_modules/**
|
||||
setlocal include=import\_s.\\zs[^'\"]*\\ze
|
||||
setlocal includeexpr=TsIncludeExpr(v:fname)
|
||||
setlocal suffixesadd+=.ts
|
||||
|
||||
let b:undo_ftplugin .= ' pa< inc< inex< fex<'
|
||||
set path+=./node_modules/**,node_modules/**
|
||||
set include=import\_s.\\zs[^'\"]*\\ze
|
||||
set includeexpr=TsIncludeExpr(v:fname)
|
||||
set suffixesadd+=.ts
|
||||
|
||||
"
|
||||
" TagBar
|
||||
|
||||
@@ -2,14 +2,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'ftplugin/typesc
|
||||
finish
|
||||
endif
|
||||
|
||||
" Comment formatting
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal suffixesadd+=.tsx
|
||||
|
||||
let b:undo_ftplugin = 'setl fo< cms< sua<'
|
||||
|
||||
" modified from mxw/vim-jsx from html.vim
|
||||
if exists("loaded_matchit") && !exists('b:tsx_match_words')
|
||||
let b:match_ignorecase = 0
|
||||
@@ -18,6 +10,10 @@ if exists("loaded_matchit") && !exists('b:tsx_match_words')
|
||||
let b:match_words = exists('b:match_words')
|
||||
\ ? b:match_words . ',' . b:tsx_match_words
|
||||
\ : b:tsx_match_words
|
||||
|
||||
let b:undo_ftplugin .= ' | unlet! b:match_words b:match_ignorecase b:tsx_match_words'
|
||||
endif
|
||||
|
||||
" Comment formatting
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
set suffixesadd+=.tsx
|
||||
|
||||
@@ -8,9 +8,4 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal commentstring=--\ %s
|
||||
setlocal iskeyword+=!,'
|
||||
" setlocal tabstop=2
|
||||
" setlocal softtabstop=2
|
||||
" setlocal shiftwidth=2
|
||||
" setlocal completefunc=syntaxcomplete#Complete
|
||||
call unison#SetBufferDefaults()
|
||||
|
||||
@@ -28,7 +28,7 @@ setlocal formatoptions-=t formatoptions+=croql
|
||||
setlocal suffixesadd=.zig,.zir
|
||||
|
||||
if has('comments')
|
||||
setlocal comments=:///,://!,://
|
||||
setlocal comments=:///,://!,://,:\\\\
|
||||
setlocal commentstring=//\ %s
|
||||
endif
|
||||
|
||||
|
||||
@@ -23,80 +23,57 @@ if exists("*GetCucumberIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:headings = {
|
||||
\ 'Feature': 'feature',
|
||||
\ 'Rule': 'rule',
|
||||
\ 'Background': 'bg_or_scenario',
|
||||
\ 'Scenario': 'bg_or_scenario',
|
||||
\ 'ScenarioOutline': 'bg_or_scenario',
|
||||
\ 'Examples': 'examples',
|
||||
\ 'Scenarios': 'examples'}
|
||||
|
||||
function! s:Line(lnum) abort
|
||||
if getline(a:lnum) =~# ':'
|
||||
let group = matchstr(synIDattr(synID(a:lnum,1+indent(a:lnum), 1), 'name'), '^cucumber\zs.*')
|
||||
if !has_key(s:headings, group)
|
||||
let group = substitute(matchstr(getline(a:lnum), '^\s*\zs\%([^:]\+\)\ze:\S\@!'), '\s\+', '', 'g')
|
||||
endif
|
||||
else
|
||||
let group = ''
|
||||
endif
|
||||
let char = matchstr(getline(a:lnum), '^\s*\zs[[:punct:]]')
|
||||
return {
|
||||
\ 'lnum': a:lnum,
|
||||
\ 'indent': indent(a:lnum),
|
||||
\ 'heading': get(s:headings, group, ''),
|
||||
\ 'tag': char ==# '@',
|
||||
\ 'table': char ==# '|',
|
||||
\ 'comment': char ==# '#',
|
||||
\ }
|
||||
function! s:syn(lnum)
|
||||
return synIDattr(synID(a:lnum,1+indent(a:lnum),1),'name')
|
||||
endfunction
|
||||
|
||||
function! GetCucumberIndent(...) abort
|
||||
let lnum = a:0 ? a:1 : v:lnum
|
||||
let sw = shiftwidth()
|
||||
let prev = s:Line(prevnonblank(lnum-1))
|
||||
let curr = s:Line(lnum)
|
||||
let next = s:Line(nextnonblank(lnum+1))
|
||||
if curr.heading ==# 'feature'
|
||||
function! GetCucumberIndent()
|
||||
let line = getline(prevnonblank(v:lnum-1))
|
||||
let cline = getline(v:lnum)
|
||||
let nline = getline(nextnonblank(v:lnum+1))
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : shiftwidth()
|
||||
let syn = s:syn(prevnonblank(v:lnum-1))
|
||||
let csyn = s:syn(v:lnum)
|
||||
let nsyn = s:syn(nextnonblank(v:lnum+1))
|
||||
if csyn ==# 'cucumberFeature' || cline =~# '^\s*Feature:'
|
||||
" feature heading
|
||||
return 0
|
||||
elseif curr.heading ==# 'examples'
|
||||
elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
|
||||
" examples heading
|
||||
return 2 * sw
|
||||
elseif curr.heading ==# 'bg_or_scenario'
|
||||
elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||
" background, scenario or outline heading
|
||||
return sw
|
||||
elseif prev.heading ==# 'feature'
|
||||
elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
|
||||
" line after feature heading
|
||||
return sw
|
||||
elseif prev.heading ==# 'examples'
|
||||
elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
|
||||
" line after examples heading
|
||||
return 3 * sw
|
||||
elseif prev.heading ==# 'bg_or_scenario'
|
||||
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||
" line after background, scenario or outline heading
|
||||
return 2 * sw
|
||||
elseif (curr.tag || curr.comment) && (next.heading ==# 'feature' || prev.indent <= 0)
|
||||
elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
|
||||
" tag or comment before a feature heading
|
||||
return 0
|
||||
elseif curr.tag
|
||||
elseif cline =~# '^\s*@'
|
||||
" other tags
|
||||
return sw
|
||||
elseif (curr.table || curr.comment) && prev.table
|
||||
elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
|
||||
" mid-table
|
||||
" preserve indent
|
||||
return prev.indent
|
||||
elseif curr.table && !prev.table
|
||||
return indent(prevnonblank(v:lnum-1))
|
||||
elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
|
||||
" first line of a table, relative indent
|
||||
return prev.indent + sw
|
||||
elseif !curr.table && prev.table
|
||||
return indent(prevnonblank(v:lnum-1)) + sw
|
||||
elseif cline =~# '^\s*[^|]' && line =~# '^\s*|'
|
||||
" line after a table, relative unindent
|
||||
return prev.indent - sw
|
||||
elseif curr.comment && getline(v:lnum-1) =~# '^\s*$' && next.heading ==# 'bg_or_scenario'
|
||||
return indent(prevnonblank(v:lnum-1)) - sw
|
||||
elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):')
|
||||
" comments on scenarios
|
||||
return sw
|
||||
endif
|
||||
return prev.indent < 0 ? 0 : prev.indent
|
||||
return indent(prevnonblank(v:lnum-1))
|
||||
endfunction
|
||||
|
||||
" vim:set sts=2 sw=2:
|
||||
|
||||
@@ -6,6 +6,7 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
||||
@@ -189,13 +189,6 @@ function! GetFsharpIndent()
|
||||
|
||||
endif
|
||||
|
||||
|
||||
" Don't change indent after lines begins with '//':
|
||||
if lline =~ '^\s*//'
|
||||
let i = indent(v:lnum)
|
||||
return i == 0 ? ind : i
|
||||
endif
|
||||
|
||||
" Add a 'shiftwidth' after lines ending with:
|
||||
if lline =~ '\(:\|=\|->\|<-\|(\|\[\|{\|{<\|\[|\|\[<\|\<\(begin\|do\|else\|fun\|function\|functor\|if\|initializer\|object\|private\|sig\|struct\|then\|try\)\|\<object\s*(.*)\)\s*$'
|
||||
let ind = ind + &sw
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'indent/graphql.vim
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
@@ -64,11 +64,11 @@ function GetGraphQLIndent()
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If the previous line isn't GraphQL, assume we're part of a template
|
||||
" string and indent this new line within it.
|
||||
" If the previous line isn't GraphQL, don't change this line's indentation.
|
||||
" Assume we've been manually indented as part of a template string.
|
||||
let l:stack = map(synstack(l:prevlnum, 1), "synIDattr(v:val, 'name')")
|
||||
if get(l:stack, -1) !~# '^graphql'
|
||||
return indent(l:prevlnum) + shiftwidth()
|
||||
return -1
|
||||
endif
|
||||
|
||||
let l:line = getline(v:lnum)
|
||||
|
||||
@@ -18,7 +18,7 @@ setlocal indentkeys-=0{
|
||||
setlocal indentkeys-=0}
|
||||
setlocal nosmartindent
|
||||
|
||||
let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys< smartindent<"
|
||||
let b:undo_indent = "setl ai< inde< indk< si<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetJuliaIndent")
|
||||
@@ -294,7 +294,7 @@ function IsInContinuationImportLine(lnum)
|
||||
if len(stack) == 0
|
||||
return 0
|
||||
endif
|
||||
return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\|public\)\>', indent(a:lnum)) == -1
|
||||
return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1
|
||||
endfunction
|
||||
|
||||
function IsFunctionArgPar(lnum, c)
|
||||
@@ -444,10 +444,10 @@ function GetJuliaIndent()
|
||||
" Decrease indentation for each closed block in the current line
|
||||
let ind -= shiftwidth() * num_closed_blocks
|
||||
|
||||
" Additional special case: multiline import/using/export/public statements
|
||||
" Additional special case: multiline import/using/export statements
|
||||
|
||||
let prevline = getline(lnum)
|
||||
" Are we in a multiline import/using/export/public statement, right below the
|
||||
" Are we in a multiline import/using/export statement, right below the
|
||||
" opening line?
|
||||
if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum)
|
||||
if get(g:, 'julia_indent_align_import', 1)
|
||||
@@ -461,9 +461,9 @@ function GetJuliaIndent()
|
||||
return cind + 2
|
||||
endif
|
||||
else
|
||||
" if the opening line is not a naked import/using/export/public statement, use
|
||||
" if the opening line is not a naked import/using/export statement, use
|
||||
" it as reference
|
||||
let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\|public\>', indent(lnum), lim)
|
||||
let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\>', indent(lnum), lim)
|
||||
if iind >= 0
|
||||
" assuming whitespace after using... so no `using(XYZ)` please!
|
||||
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6, -1, 'basic')
|
||||
@@ -475,7 +475,7 @@ function GetJuliaIndent()
|
||||
endif
|
||||
let ind += shiftwidth()
|
||||
|
||||
" Or did we just close a multiline import/using/export/public statement?
|
||||
" Or did we just close a multiline import/using/export statement?
|
||||
elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum)
|
||||
" find the starting line of the statement
|
||||
let ilnum = 0
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'indent/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim indent file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2024 Jan 25
|
||||
|
||||
" Only load this indent file when no other was loaded yet.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetJustfileIndent()
|
||||
setlocal indentkeys=0},0),!^F,o,O,0=''',0=\"\"\"
|
||||
|
||||
let b:undo_indent = "setlocal indentexpr< indentkeys<"
|
||||
|
||||
if exists("*GetJustfileIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetJustfileIndent()
|
||||
if v:lnum < 2
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prev_line = getline(v:lnum - 1)
|
||||
let last_indent = indent(v:lnum - 1)
|
||||
|
||||
if getline(v:lnum) =~ "\\v^\\s+%([})]|'''$|\"\"\"$)"
|
||||
return last_indent - shiftwidth()
|
||||
elseif prev_line =~ '\V#'
|
||||
return last_indent
|
||||
elseif prev_line =~ "\\v%([:{(]|^.*\\S.*%([^']'''|[^\"]\"\"\"))\\s*$"
|
||||
return last_indent + shiftwidth()
|
||||
elseif prev_line =~ '\\$'
|
||||
if v:lnum == 2 || getline(v:lnum - 2) !~ '\\$'
|
||||
if prev_line =~ '\v:\=@!'
|
||||
return last_indent + shiftwidth() + shiftwidth()
|
||||
else
|
||||
return last_indent + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
elseif v:lnum > 2 && getline(v:lnum - 2) =~ '\\$'
|
||||
return last_indent - shiftwidth()
|
||||
elseif prev_line =~ '\v:\s*%(\h|\()' && prev_line !~ '\V:='
|
||||
return last_indent + shiftwidth()
|
||||
endif
|
||||
|
||||
return last_indent
|
||||
endfunction
|
||||
@@ -31,7 +31,7 @@ function GetLedgerIndent(...)
|
||||
|
||||
if line =~# '^\s\+\S'
|
||||
" Lines that already are indented (→postings, sub-directives) keep their indentation.
|
||||
return shiftwidth()
|
||||
return &shiftwidth
|
||||
elseif line =~# '^\s*$'
|
||||
" Current line is empty, try to guess its type based on the previous line.
|
||||
if prev =~# '^\([[:digit:]~=]\|\s\+\S\)'
|
||||
@@ -40,7 +40,7 @@ function GetLedgerIndent(...)
|
||||
" indented you will have to indent the first line following a
|
||||
" pre-declaration manually. This makes it easier to type long lists of
|
||||
" 'account' pre-declarations without sub-directives, for example.
|
||||
return shiftwidth()
|
||||
return &shiftwidth
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
|
||||
@@ -35,8 +35,6 @@ let b:did_indent = 1
|
||||
setlocal indentexpr=GetLilyPondIndent()
|
||||
setlocal indentkeys=o,O,},>>,!^F
|
||||
|
||||
let b:undo_indent = "setlocal indentexpr< indentkeys<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetLilyPondIndent")
|
||||
finish
|
||||
|
||||
@@ -2,76 +2,16 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'nginx', 'indent/nginx.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetNginxIndent()
|
||||
setlocal indentexpr=
|
||||
|
||||
setlocal indentkeys=0{,0},0#,!^F,o,O
|
||||
" cindent actually works for nginx' simple file structure
|
||||
setlocal cindent
|
||||
" Just make sure that the comments are not reset as defs would be.
|
||||
setlocal cinkeys-=0#
|
||||
|
||||
let b:undo_indent = 'setl inde< indk<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetNginxIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetNginxIndent() abort
|
||||
let plnum = s:PrevNotAsBlank(v:lnum - 1)
|
||||
|
||||
" Hit the start of the file, use zero indent.
|
||||
if plnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(plnum)
|
||||
|
||||
" Add a 'shiftwidth' after '{'
|
||||
if s:AsEndWith(getline(plnum), '{')
|
||||
let ind = ind + shiftwidth()
|
||||
end
|
||||
|
||||
" Subtract a 'shiftwidth' on '}'
|
||||
" This is the part that requires 'indentkeys'.
|
||||
if getline(v:lnum) =~ '^\s*}'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
let pplnum = s:PrevNotAsBlank(plnum - 1)
|
||||
|
||||
if s:IsLineContinuation(plnum)
|
||||
if !s:IsLineContinuation(pplnum)
|
||||
let ind = ind + shiftwidth()
|
||||
end
|
||||
else
|
||||
if s:IsLineContinuation(pplnum)
|
||||
let ind = ind - shiftwidth()
|
||||
end
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" Find the first line at or above {lnum} that is non-blank and not a comment.
|
||||
function s:PrevNotAsBlank(lnum) abort
|
||||
let lnum = prevnonblank(a:lnum)
|
||||
while lnum > 0
|
||||
if getline(lnum) !~ '^\s*#'
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" Check whether {line} ends with {pat}, ignoring trailing comments.
|
||||
function s:AsEndWith(line, pat) abort
|
||||
return a:line =~ a:pat . '\m\s*\%(#.*\)\?$'
|
||||
endfunction
|
||||
|
||||
function s:IsLineContinuation(lnum) abort
|
||||
return a:lnum > 0 && !s:AsEndWith(getline(a:lnum), '[;{}]')
|
||||
endfunction
|
||||
let b:undo_indent = "setl cin< cink< inde<"
|
||||
|
||||
41
indent/pony.vim
Normal file
41
indent/pony.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'indent/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim indent file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
setlocal nolisp
|
||||
setlocal nocindent
|
||||
setlocal nosmartindent
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=pony#Indent()
|
||||
setlocal indentkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
|
||||
setlocal cinkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
|
||||
setlocal cinwords=ifdef,if,match,while,for,repeat,try,with,recover,object,lambda,then,elseif,else,until,do,actor,class,struct,primitive,trait,interface,new,be,fun,iftype,elseiftype
|
||||
|
||||
augroup pony
|
||||
autocmd! * <buffer>
|
||||
autocmd CursorHold <buffer> call pony#ClearTrailingSpace(1, 1)
|
||||
"autocmd InsertEnter <buffer> call pony#ClearTrailingSpace(0, 0)
|
||||
autocmd InsertLeave <buffer> call pony#ClearTrailingSpace(0, 1)
|
||||
autocmd BufWritePre <buffer> call pony#ClearTrailingSpace(1, 0, 1)
|
||||
augroup END
|
||||
|
||||
let b:undo_indent = 'set lisp< cindent< autoindent< smartindent< indentexpr< indentkeys< cinkeys< cinwords<'
|
||||
\ . ' | execute("autocmd! pony * <buffer>")'
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
let b:did_indent = 1
|
||||
@@ -7,6 +7,7 @@ endif
|
||||
" Maintainer: Andrew Radev <andrey.radev@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
" 0. Initialization {{{1
|
||||
" =================
|
||||
|
||||
@@ -119,14 +119,7 @@ function! GetSvelteIndent()
|
||||
let cursyns = s:SynsSOL(v:lnum)
|
||||
let cursyn = get(cursyns, 0, '')
|
||||
|
||||
if s:IsMultipleLineTemplateString(curline, cursyns)
|
||||
call s:Log('current line is multiline template string expression')
|
||||
if !s:IsMultipleLineTemplateString(prevline, prevsyns)
|
||||
let ind = indent(v:lnum - 1) + &sw
|
||||
else
|
||||
let ind = indent(v:lnum - 1)
|
||||
endif
|
||||
elseif s:SynHTML(cursyn) && !s:IsMultipleLineSvelteExpression(curline, cursyns)
|
||||
if s:SynHTML(cursyn) && !s:IsMultipleLineSvelteExpression(curline, cursyns)
|
||||
call s:Log('syntax: html')
|
||||
let ind = XmlIndentGet(v:lnum, 0)
|
||||
if prevline =~? s:empty_tag
|
||||
@@ -254,20 +247,6 @@ function! s:IsMultipleLineSvelteExpression(curline, syns)
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:IsMultipleLineTemplateString(curline, syns)
|
||||
if a:curline =~ '^\s*{.*}\s*$'
|
||||
return 0
|
||||
endif
|
||||
|
||||
for syn in a:syns
|
||||
if syn ==? 'javaScriptTemplateString'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:SynBlockBody(syn)
|
||||
return a:syn ==? 'svelteBlockBody'
|
||||
endfunction
|
||||
|
||||
@@ -1029,6 +1029,9 @@ ignored_dirs:
|
||||
filetypes:
|
||||
- name: markdown
|
||||
linguist: Markdown
|
||||
ignored_extensions:
|
||||
# Handled by mdx extension
|
||||
- mdx
|
||||
ignored_warnings:
|
||||
- '*.{md,mdx,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx}'
|
||||
---
|
||||
@@ -1234,7 +1237,7 @@ filetypes:
|
||||
- pu
|
||||
---
|
||||
name: pony
|
||||
remote: dleonard0/pony-vim-syntax
|
||||
remote: jakwings/vim-pony
|
||||
filetypes:
|
||||
- name: pony
|
||||
linguist: Pony
|
||||
@@ -1250,12 +1253,6 @@ filetypes:
|
||||
extensions:
|
||||
- ps1xml
|
||||
---
|
||||
name: prisma
|
||||
remote: prisma/vim-prisma
|
||||
filetypes:
|
||||
- name: prisma
|
||||
linguist: Prisma
|
||||
---
|
||||
name: protobuf
|
||||
remote: uarun/vim-protobuf
|
||||
filetypes:
|
||||
@@ -5478,7 +5475,7 @@ filetypes:
|
||||
description: 'JSON with comments (https://komkom.github.io/)'
|
||||
---
|
||||
name: gleam
|
||||
remote: gleam-lang/gleam.vim@main
|
||||
remote: gleam-lang/gleam.vim
|
||||
filetypes:
|
||||
- name: gleam
|
||||
extensions:
|
||||
@@ -5501,7 +5498,7 @@ filetypes:
|
||||
description: Sway Configuration
|
||||
---
|
||||
name: just
|
||||
remote: NoahTheDuke/vim-just@main
|
||||
remote: NoahTheDuke/vim-just
|
||||
filetypes:
|
||||
- name: just
|
||||
patterns:
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim syntax file
|
||||
" Language: Ansible YAML/Jinja templates
|
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com>
|
||||
" Last Change: 2023.10.29
|
||||
" Last Change: 2018.02.08
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'yaml'
|
||||
@@ -103,13 +103,6 @@ if exists("g:ansible_extra_keywords_highlight")
|
||||
endif
|
||||
endif
|
||||
|
||||
execute 'syn keyword ansible_fqcn_keywords ansible builtin ansible.builtin. containedin='.s:yamlKey.' contained'
|
||||
if exists("g:ansible_fqcn_highlight")
|
||||
execute 'highlight link ansible_fqcn_keywords '.g:ansible_fqcn_highlight
|
||||
else
|
||||
highlight default link ansible_fqcn_keywords Statement
|
||||
endif
|
||||
|
||||
execute 'syn keyword ansible_normal_keywords
|
||||
\ include include_role include_tasks include_vars import_role import_playbook import_tasks
|
||||
\ when changed_when failed_when block rescue always notify listen register
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/class.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/class.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/cluster.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/cluster.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
|
||||
syntax cluster typescriptStatement
|
||||
\ contains=typescriptBlock,typescriptVariable,typescriptUsing,
|
||||
\ contains=typescriptBlock,typescriptVariable,
|
||||
\ @typescriptTopExpression,typescriptAssign,
|
||||
\ typescriptConditional,typescriptRepeat,typescriptBranch,
|
||||
\ typescriptLabel,typescriptStatementKeyword,
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/decorator.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/decorator.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/doc.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/doc.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/function.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/function.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -7,7 +7,7 @@ syntax keyword typescriptAsyncFuncKeyword async
|
||||
\ skipwhite
|
||||
|
||||
syntax keyword typescriptAsyncFuncKeyword await
|
||||
\ nextgroup=@typescriptValue,typescriptUsing
|
||||
\ nextgroup=@typescriptValue
|
||||
\ skipwhite
|
||||
|
||||
exec 'syntax keyword typescriptFuncKeyword '.(exists('g:typescript_conceal_function') ? 'conceal cchar='.g:typescript_conceal_function : '').' function nextgroup=typescriptAsyncFunc,typescriptFuncName,@typescriptCallSignature skipwhite skipempty'
|
||||
@@ -46,7 +46,7 @@ syntax match typescriptArrowFuncArg contained /\K\k*/
|
||||
syntax region typescriptReturnAnnotation contained start=/:/ end=/{/me=e-1 contains=@typescriptType nextgroup=typescriptBlock
|
||||
|
||||
|
||||
syntax region typescriptFuncImpl contained start=/function\>/ end=/{\|;\|\n/me=e-1
|
||||
syntax region typescriptFuncImpl contained start=/function\>/ end=/{/me=e-1
|
||||
\ contains=typescriptFuncKeyword
|
||||
\ nextgroup=typescriptBlock
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/identifiers.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/identifiers.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/keyword.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/keyword.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -29,10 +29,6 @@ syntax keyword typescriptVariable const
|
||||
\ nextgroup=typescriptEnum,@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax keyword typescriptUsing using
|
||||
\ nextgroup=@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
|
||||
\ nextgroup=typescriptBlock
|
||||
\ skipwhite
|
||||
@@ -64,8 +60,7 @@ syntax keyword typescriptStatementKeyword with
|
||||
syntax keyword typescriptStatementKeyword yield skipwhite nextgroup=@typescriptValue containedin=typescriptBlock
|
||||
|
||||
syntax keyword typescriptTry try
|
||||
syntax keyword typescriptExceptions throw finally
|
||||
syntax keyword typescriptExceptions catch nextgroup=typescriptCall skipwhite skipempty oneline
|
||||
syntax keyword typescriptExceptions catch throw finally
|
||||
syntax keyword typescriptDebugger debugger
|
||||
|
||||
syntax keyword typescriptAsyncFor await nextgroup=typescriptLoopParen skipwhite skipempty contained
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/literal.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/literal.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/ts-common/members.vim')
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'syntax/basic/members.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -20,7 +20,6 @@ syntax cluster typescriptPropertyMemberDeclaration contains=
|
||||
\ typescriptClassStatic,
|
||||
\ typescriptAccessibilityModifier,
|
||||
\ typescriptReadonlyModifier,
|
||||
\ typescriptAutoAccessor,
|
||||
\ typescriptMethodAccessor,
|
||||
\ @typescriptMembers
|
||||
" \ typescriptMemberVariableDeclaration
|
||||
@@ -39,8 +38,6 @@ syntax keyword typescriptAccessibilityModifier public private protected containe
|
||||
|
||||
syntax keyword typescriptReadonlyModifier readonly override contained
|
||||
|
||||
syntax keyword typescriptAutoAccessor accessor contained
|
||||
|
||||
syntax region typescriptStringMember contained
|
||||
\ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1/
|
||||
\ nextgroup=@memberNextGroup
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user