From cd100963866b2c33a286cbf6aac8e42cd16fd248 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 29 Oct 2018 19:11:41 +0100 Subject: tree-sitter: initial tree-sitter support --- runtime/plugin/ts_test.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 runtime/plugin/ts_test.vim (limited to 'runtime/plugin') diff --git a/runtime/plugin/ts_test.vim b/runtime/plugin/ts_test.vim new file mode 100644 index 0000000000..e40e2792e1 --- /dev/null +++ b/runtime/plugin/ts_test.vim @@ -0,0 +1,32 @@ +let g:ts_test_path = expand(":p:h:h") +let g:has_ts = v:false + +func! TSTest() + if g:has_ts + return + end + " TODO: module! + lua require'treesitter_rt' + lua theparser = create_parser(vim.api.nvim_get_current_buf()) + let g:has_ts = v:true +endfunc + +func! TSCursor() + " disable matchparen + NoMatchParen + call TSTest() + au CursorMoved lua ts_cursor() + au CursorMovedI lua ts_cursor() + map (ts-expand) lua ts_expand_node() +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() -- cgit