mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update
This commit is contained in:
@@ -71,13 +71,13 @@ if exists ('g:ada_with_gnat_project_files')
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add standart exception {{{2
|
||||
" Section: add standard exception {{{2
|
||||
"
|
||||
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'exception',
|
||||
\ 'info': 'Ada standart exception.',
|
||||
\ 'info': 'Ada standard exception.',
|
||||
\ 'kind': 'x',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
@@ -214,7 +214,7 @@ function ada#Word (...)
|
||||
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
|
||||
|
||||
" Cope with tag searching for items in comments; if we are, don't loop
|
||||
" backards looking for previous lines
|
||||
" backwards looking for previous lines
|
||||
if l:Column_Nr > strlen(l:Line)
|
||||
" We were in a comment
|
||||
let l:Line = getline(l:Line_Nr)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2724,7 +2724,7 @@ fu! csv#Tabularize(bang, first, last) "{{{3
|
||||
if getline(a:first)[-1:] isnot? b:delimiter
|
||||
let b:col_width[-1] += 1
|
||||
endif
|
||||
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol
|
||||
let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val-1)'), s:td.cros). s:td.ecol
|
||||
|
||||
call csv#NewDelimiter(s:td.vbar, 1, line('$'))
|
||||
"exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last),
|
||||
|
||||
@@ -3,7 +3,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'fsharp', 'autoload/fsharp.vim
|
||||
endif
|
||||
|
||||
" Vim autoload functions
|
||||
|
||||
if exists('g:loaded_autoload_fsharp')
|
||||
finish
|
||||
endif
|
||||
@@ -240,14 +239,6 @@ function! fsharp#loadConfig()
|
||||
|
||||
if !exists('g:fsharp#fsautocomplete_command')
|
||||
let s:fsac = fnamemodify(s:script_root_dir . "fsac/fsautocomplete.dll", ":p")
|
||||
|
||||
" check if FSAC exists
|
||||
if empty(glob(s:fsac))
|
||||
echoerr "FSAC not found. :FSharpUpdateFSAC to download."
|
||||
let &cpo = s:cpo_save
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:fsharp#fsautocomplete_command =
|
||||
\ ['dotnet', s:fsac,
|
||||
\ '--background-service-enabled'
|
||||
@@ -331,6 +322,29 @@ function! fsharp#loadConfig()
|
||||
endif
|
||||
endif
|
||||
|
||||
" FSI keymaps
|
||||
if g:fsharp#fsi_keymap == "vscode"
|
||||
if has('nvim')
|
||||
let g:fsharp#fsi_keymap_send = "<M-cr>"
|
||||
let g:fsharp#fsi_keymap_toggle = "<M-@>"
|
||||
else
|
||||
let g:fsharp#fsi_keymap_send = "<esc><cr>"
|
||||
let g:fsharp#fsi_keymap_toggle = "<esc>@"
|
||||
endif
|
||||
elseif g:fsharp#fsi_keymap == "vim-fsharp"
|
||||
let g:fsharp#fsi_keymap_send = "<leader>i"
|
||||
let g:fsharp#fsi_keymap_toggle = "<leader>e"
|
||||
elseif g:fsharp#fsi_keymap == "custom"
|
||||
let g:fsharp#fsi_keymap = "none"
|
||||
if !exists('g:fsharp#fsi_keymap_send')
|
||||
echoerr "g:fsharp#fsi_keymap_send is not set"
|
||||
elseif !exists('g:fsharp#fsi_keymap_toggle')
|
||||
echoerr "g:fsharp#fsi_keymap_toggle is not set"
|
||||
else
|
||||
let g:fsharp#fsi_keymap = "custom"
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:config_is_loaded = 1
|
||||
endfunction
|
||||
|
||||
@@ -398,39 +412,6 @@ endfunction
|
||||
|
||||
" .NET/F# specific operations
|
||||
|
||||
function! s:findWorkspace(dir, cont)
|
||||
let s:cont_findWorkspace = a:cont
|
||||
function! s:callback_findWorkspace(result)
|
||||
let result = a:result
|
||||
let content = json_decode(result.result.content)
|
||||
if len(content.Data.Found) < 1
|
||||
return []
|
||||
endif
|
||||
let workspace = { 'Type': 'none' }
|
||||
for found in content.Data.Found
|
||||
if workspace.Type == 'none'
|
||||
let workspace = found
|
||||
elseif found.Type == 'solution'
|
||||
if workspace.Type == 'project'
|
||||
let workspace = found
|
||||
else
|
||||
let curLen = len(workspace.Data.Items)
|
||||
let newLen = len(found.Data.Items)
|
||||
if newLen > curLen
|
||||
let workspace = found
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if workspace.Type == 'solution'
|
||||
call s:cont_findWorkspace([workspace.Data.Path])
|
||||
else
|
||||
call s:cont_findWorkspace(workspace.Data.Fsprojs)
|
||||
endif
|
||||
endfunction
|
||||
call s:workspacePeek(a:dir, g:fsharp#workspace_mode_peek_deep_level, g:fsharp#exclude_project_directories, function("s:callback_findWorkspace"))
|
||||
endfunction
|
||||
|
||||
let s:workspace = []
|
||||
|
||||
function! fsharp#handle_notifyWorkspace(payload) abort
|
||||
|
||||
@@ -215,6 +215,10 @@ function! go#config#DebugWindows() abort
|
||||
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugSubstitutePaths() abort
|
||||
return get(g:, 'go_debug_substitute_paths', [])
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugPreserveLayout() abort
|
||||
return get(g:, 'go_debug_preserve_layout', 0)
|
||||
endfunction
|
||||
|
||||
@@ -339,7 +339,7 @@ function! s:on_begin()
|
||||
let [l,c] = [line('.'), col('.')]
|
||||
normal! ^
|
||||
let patt = '\%<'.(c+1).'c\(' . b:julia_begin_keywordsm . '\)\%>'.(c-1).'c'
|
||||
let n = search(patt, 'Wnc', l)
|
||||
let n = search('\C' . patt, 'Wnc', l)
|
||||
call cursor(l, c)
|
||||
return n > 0
|
||||
endfunction
|
||||
@@ -350,7 +350,7 @@ function! s:matchit()
|
||||
endfunction
|
||||
|
||||
function! s:move_before_begin()
|
||||
call search(b:julia_begin_keywordsm, 'Wbc')
|
||||
call search('\C' . b:julia_begin_keywordsm, 'Wbc')
|
||||
normal! h
|
||||
endfunction
|
||||
|
||||
@@ -382,7 +382,7 @@ function! s:moveto_block_delim(toend, backwards, ...)
|
||||
normal! bh
|
||||
endif
|
||||
while 1
|
||||
let searchret = search(pattern, flags)
|
||||
let searchret = search('\C' . pattern, flags)
|
||||
if !searchret
|
||||
return ret
|
||||
endif
|
||||
@@ -473,7 +473,7 @@ function! s:moveto_currentblock_end()
|
||||
normal! b
|
||||
endif
|
||||
|
||||
let ret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
|
||||
let ret = searchpair('\C' . b:julia_begin_keywordsm, '', '\C' . b:julia_end_keywords, flags, b:match_skip)
|
||||
if ret <= 0
|
||||
return s:abort()
|
||||
endif
|
||||
@@ -679,7 +679,7 @@ function! s:find_block(current_mode)
|
||||
normal! l
|
||||
normal! b
|
||||
endif
|
||||
let searchret = searchpair(b:julia_begin_keywordsm, '', b:julia_end_keywords, flags, b:match_skip)
|
||||
let searchret = searchpair('\C' . b:julia_begin_keywordsm, '', '\C' . b:julia_end_keywords, flags, b:match_skip)
|
||||
if searchret <= 0
|
||||
if !b:jlblk_did_select
|
||||
return s:abort()
|
||||
|
||||
@@ -23,8 +23,8 @@ fun! nim#init() abort
|
||||
if !v:shell_error && expand('%:e') ==# 'nim'
|
||||
let false = 0 " Needed for eval of json
|
||||
let true = 1 " Needed for eval of json
|
||||
let dumpdata = eval(substitute(raw_dumpdata, "\n", '', 'g'))
|
||||
|
||||
let dumpdata = json_decode(raw_dumpdata)
|
||||
|
||||
let b:nim_project_root = dumpdata['project_path']
|
||||
let b:nim_defined_symbols = dumpdata['defined_symbols']
|
||||
let b:nim_caas_enabled = g:nim_caas_enabled || index(dumpdata['defined_symbols'], 'forcecaas') != -1
|
||||
@@ -211,7 +211,9 @@ fun! GotoDefinition_nim_ready(def_output) abort
|
||||
let defBits = split(rawDef, '\t')
|
||||
let file = defBits[4]
|
||||
let line = defBits[5]
|
||||
let column = defBits[6]
|
||||
exe printf('e +%d %s', line, file)
|
||||
call cursor(line, column + 1)
|
||||
return 1
|
||||
endf
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim functions for file type detection
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Aug 17
|
||||
" Last Change: 2021 Nov 27
|
||||
|
||||
" These functions are moved here from runtime/filetype.vim to make startup
|
||||
" faster.
|
||||
@@ -219,6 +219,23 @@ func polyglot#ft#FTe()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between Forth and F#.
|
||||
" Provided by Doug Kearns.
|
||||
func polyglot#ft#FTfs()
|
||||
if exists("g:filetype_fs")
|
||||
exe "setf " . g:filetype_fs
|
||||
else
|
||||
let line = getline(nextnonblank(1))
|
||||
" comments and colon definitions
|
||||
if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$'
|
||||
\ || line =~ '^\s*: \S'
|
||||
setf forth
|
||||
else
|
||||
setf fsharp
|
||||
endif
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between HTML, XHTML and Django
|
||||
func polyglot#ft#FThtml()
|
||||
let n = 1
|
||||
@@ -269,7 +286,10 @@ func polyglot#ft#FTm()
|
||||
return
|
||||
endif
|
||||
|
||||
let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\)\>'
|
||||
" excluding end(for|function|if|switch|while) common to Murphi
|
||||
let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
|
||||
|
||||
let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>'
|
||||
|
||||
let n = 1
|
||||
let saw_comment = 0 " Whether we've seen a multiline comment leader.
|
||||
@@ -281,12 +301,11 @@ func polyglot#ft#FTm()
|
||||
" anything more definitive.
|
||||
let saw_comment = 1
|
||||
endif
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
|
||||
if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
if line =~ '^\s*\%(#\|%!\|[#%]{\=\s*$\)' ||
|
||||
\ line =~ '^\s*unwind_protect\>' ||
|
||||
if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' ||
|
||||
\ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
|
||||
setf octave
|
||||
return
|
||||
@@ -792,6 +811,23 @@ func polyglot#ft#Redif()
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
" This function is called for all files under */debian/patches/*, make sure not
|
||||
" to non-dep3patch files, such as README and other text files.
|
||||
func polyglot#ft#Dep3patch()
|
||||
if expand('%:t') ==# 'series'
|
||||
return
|
||||
endif
|
||||
|
||||
for ln in getline(1, 100)
|
||||
if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
|
||||
setf dep3patch
|
||||
return
|
||||
elseif ln =~# '^---'
|
||||
" end of headers found. stop processing
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -1769,10 +1769,6 @@ if !has_key(g:polyglot_is_disabled, 'gitignore')
|
||||
au BufNewFile,BufRead *.git/info/exclude,*/.config/git/ignore,{.,}gitignore setf gitignore
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'tads')
|
||||
au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T()
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prolog')
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap setf prolog
|
||||
@@ -1787,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'dosini')
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}npmrc,buildozer.spec setf dosini
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini
|
||||
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||
endif
|
||||
@@ -1961,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,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile setf sh
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/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')
|
||||
@@ -2011,13 +2007,6 @@ if !has_key(g:polyglot_is_disabled, 'raml')
|
||||
au BufNewFile,BufRead *.raml setf raml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'raku')
|
||||
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 *.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl6,*.pm6,*.pod6,*.raku,*.rakudoc,*.rakumod,*.rakutest,*.t6 setf raku
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'ragel')
|
||||
au BufNewFile,BufRead *.rl setf ragel
|
||||
endif
|
||||
@@ -2097,22 +2086,6 @@ if !has_key(g:polyglot_is_disabled, 'pgsql')
|
||||
au BufNewFile,BufRead *.pgsql let b:sql_type_override='pgsql' | set ft=sql
|
||||
endif
|
||||
|
||||
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,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()
|
||||
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
|
||||
au BufNewFile,BufRead *.xs setf xs
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'rc')
|
||||
au BufNewFile,BufRead *.rc,*.rch setf rc
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'opencl')
|
||||
au BufNewFile,BufRead *.cl,*.opencl setf opencl
|
||||
endif
|
||||
@@ -2225,7 +2198,34 @@ if !has_key(g:polyglot_is_disabled, 'julia')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'jst')
|
||||
au BufNewFile,BufRead *.ect,*.ejs,*.jst setf jst
|
||||
au BufNewFile,BufRead *.ect,*.ejs,*.ejs.t,*.jst setf jst
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'tads')
|
||||
au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T()
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'raku')
|
||||
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 *.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl6,*.pm6,*.pod6,*.raku,*.rakudoc,*.rakumod,*.rakutest,*.t6 setf raku
|
||||
endif
|
||||
|
||||
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,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()
|
||||
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
|
||||
au BufNewFile,BufRead *.xs setf xs
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'rc')
|
||||
au BufNewFile,BufRead *.rc,*.rch setf rc
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
||||
@@ -2339,7 +2339,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'glsl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frag,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frag,*.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')
|
||||
@@ -2398,7 +2398,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'elixir')
|
||||
au BufNewFile,BufRead *.ex,*.exs,mix.lock setf elixir
|
||||
au BufNewFile,BufRead *.eex,*.html.leex,*.leex setf eelixir
|
||||
au BufNewFile,BufRead *.eex,*.html.heex,*.html.leex,*.leex setf eelixir
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'docker-compose')
|
||||
@@ -2406,7 +2406,7 @@ if !has_key(g:polyglot_is_disabled, 'docker-compose')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'yaml')
|
||||
au BufNewFile,BufRead *.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml,*.yml.mysql,{.,}clang-format,{.,}clang-tidy,{.,}gemrc,fish_history,fish_read_history,glide.lock,yarn.lock setf yaml
|
||||
au BufNewFile,BufRead *.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml,*.yml.mysql,{.,}clang-format,{.,}clang-tidy,{.,}gemrc,CITATION.cff,fish_history,fish_read_history,glide.lock,yarn.lock setf yaml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'mysql')
|
||||
@@ -2534,7 +2534,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,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.moc,*.tcc,*.tlh,*.tpp 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
|
||||
@@ -2575,7 +2575,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.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,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.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
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.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,*.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')
|
||||
|
||||
@@ -85,7 +85,7 @@ let s:globs = {
|
||||
\ 'conf': '*.conf,auto.master,config',
|
||||
\ 'config': 'configure.in,configure.ac,Pipfile',
|
||||
\ 'context': '*.mkii,*.mkiv,*.mkvi',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.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.*',
|
||||
@@ -129,7 +129,7 @@ let s:globs = {
|
||||
\ 'dnsmasq': '',
|
||||
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||
\ 'dosbatch': '*.bat,*.sys',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dot': '*.dot,*.gv',
|
||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
@@ -143,7 +143,7 @@ let s:globs = {
|
||||
\ 'ecd': '*.ecd',
|
||||
\ 'ecrystal': '*.ecr',
|
||||
\ 'edif': '*.ed\(f\|if\|o\)',
|
||||
\ 'eelixir': '*.eex,*.html.leex,*.leex',
|
||||
\ 'eelixir': '*.eex,*.html.heex,*.html.leex,*.leex',
|
||||
\ 'elf': '*.am',
|
||||
\ 'elinks': 'elinks.conf',
|
||||
\ 'elixir': '*.ex,*.exs,mix.lock',
|
||||
@@ -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,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.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',
|
||||
@@ -265,7 +265,7 @@ let s:globs = {
|
||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
\ 'jsp': '*.jsp',
|
||||
\ 'jst': '*.ejs,*.ect,*.jst',
|
||||
\ 'jst': '*.ejs,*.ect,*.ejs.t,*.jst',
|
||||
\ 'julia': '*.jl',
|
||||
\ 'just': '*.just,justfile',
|
||||
\ 'kconfig': 'Kconfig,Kconfig.debug,Kconfig.*',
|
||||
@@ -480,7 +480,7 @@ let s:globs = {
|
||||
\ 'services': '',
|
||||
\ 'setserial': '',
|
||||
\ 'sexplib': '*.sexp',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.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',
|
||||
@@ -611,7 +611,7 @@ let s:globs = {
|
||||
\ 'xhtml': '*.xhtml,*.xht',
|
||||
\ 'xinetd': '',
|
||||
\ 'xmath': '*.msc,*.msf',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.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,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.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': '*.xml,*.adml,*.admx,*.ant,*.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,*.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',
|
||||
@@ -622,7 +622,7 @@ let s:globs = {
|
||||
\ 'xsl': '*.xslt,*.xsl',
|
||||
\ 'xslt': '*.xsl,*.xslt',
|
||||
\ 'yacc': '*.yy,*.yxx,*.y++',
|
||||
\ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,glide.lock,yarn.lock,fish_history,fish_read_history',
|
||||
\ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,CITATION.cff,glide.lock,yarn.lock,fish_history,fish_read_history',
|
||||
\ 'yaml.ansible': 'playbook.y{a,}ml,site.y{a,}ml,main.y{a,}ml,local.y{a,}ml,requirements.y{a,}ml,tasks.*.y{a,}ml,roles.*.y{a,}ml,handlers.*.y{a,}ml',
|
||||
\ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml',
|
||||
\ 'z8a': '*.z8a',
|
||||
|
||||
@@ -157,7 +157,7 @@ def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
scanner->ParseLParen()
|
||||
|
||||
# Expr*
|
||||
var exprs: list<any>
|
||||
var exprs: list<dict<any>>
|
||||
while scanner->AtStartOfExpr()
|
||||
exprs->add(scanner->ParseExpr())
|
||||
endwhile
|
||||
|
||||
108
autoload/unison.vim
Normal file
108
autoload/unison.vim
Normal file
@@ -0,0 +1,108 @@
|
||||
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
|
||||
while start > 0 && line[start - 1] !~ '\s' && line[start - 1] != '(' && line[start - 1] != ')'
|
||||
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:
|
||||
Reference in New Issue
Block a user