aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin/ts_test.vim
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-10-29 19:11:41 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-09-28 14:31:03 +0200
commitcd100963866b2c33a286cbf6aac8e42cd16fd248 (patch)
treef9cf8260a16a749c5f8b995b59d1d96c481eeb06 /runtime/plugin/ts_test.vim
parent8ff2f193bb3ed94ee215c83c13431d45d382949b (diff)
downloadrneovim-cd100963866b2c33a286cbf6aac8e42cd16fd248.tar.gz
rneovim-cd100963866b2c33a286cbf6aac8e42cd16fd248.tar.bz2
rneovim-cd100963866b2c33a286cbf6aac8e42cd16fd248.zip
tree-sitter: initial tree-sitter support
Diffstat (limited to 'runtime/plugin/ts_test.vim')
-rw-r--r--runtime/plugin/ts_test.vim32
1 files changed, 32 insertions, 0 deletions
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("<sfile>: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 <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()