Files
neovim/runtime/plugin/ts_test.vim
Björn Linse 4ea5e63aa8 tree-sitter: add basic testing on ci
build tree-sitter c parser on ci for testing purposes
2019-09-28 14:55:43 +02:00

33 lines
672 B
VimL

let g:ts_test_path = expand("<sfile>:p:h:h")
let g:has_ts = v:false
func! TSTest()
if g:has_ts
return
end
" TODO: module!
lua theparser = vim.tree_sitter.create_parser(0)
lua require'tree_sitter_demo'
let g:has_ts = v:true
endfunc
func! TSCursor()
" disable matchparen
NoMatchParen
call TSTest()
au CursorMoved <buffer> lua ts_cursor()
au CursorMovedI <buffer> lua ts_cursor()
map <buffer> <Plug>(ts-expand) <cmd>lua ts_expand_node()<cr>
endfunc
func! TSSyntax()
" disable matchparen
set syntax=
call TSTest()
lua ts_syntax()
endfunc
command! TSTest call TSTest()
command! TSCursor call TSCursor()
command! TSSyntax call TSSyntax()