summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ftplugin/tnsl.lua1
-rw-r--r--lazy-lock.json1
-rw-r--r--lua/cshift/filetype.lua7
-rw-r--r--lua/cshift/init.lua2
-rw-r--r--lua/cshift/opt.lua3
-rw-r--r--lua/cshift/plugins/lsp.lua1
-rw-r--r--lua/cshift/plugins/treesitter.lua7
-rw-r--r--lua/cshift/treesitter.lua13
8 files changed, 35 insertions, 0 deletions
diff --git a/ftplugin/tnsl.lua b/ftplugin/tnsl.lua
new file mode 100644
index 0000000..fe6caae
--- /dev/null
+++ b/ftplugin/tnsl.lua
@@ -0,0 +1 @@
+vim.treesitter.start()
diff --git a/lazy-lock.json b/lazy-lock.json
index 1e303e7..9095233 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -7,6 +7,7 @@
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "16878c7a018cba66a6e990286bdb6afc29ca13d3" },
+ "nvim-treesitter": { "branch": "main", "commit": "5cb05e1b0fa3c469958a2b26f36b3fe930af221c" },
"nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
diff --git a/lua/cshift/filetype.lua b/lua/cshift/filetype.lua
new file mode 100644
index 0000000..2b11acb
--- /dev/null
+++ b/lua/cshift/filetype.lua
@@ -0,0 +1,7 @@
+vim.filetype.add({
+ extension = {
+ tnsl = 'tnsl',
+ tnsh = 'tnsl-shell'
+ }
+})
+
diff --git a/lua/cshift/init.lua b/lua/cshift/init.lua
index 5bae8c0..85820a6 100644
--- a/lua/cshift/init.lua
+++ b/lua/cshift/init.lua
@@ -8,3 +8,5 @@ require("lazy").setup("cshift.plugins")
require("cshift.remaps")
require("cshift.opt")
+require("cshift.filetype")
+require("cshift.treesitter")
diff --git a/lua/cshift/opt.lua b/lua/cshift/opt.lua
index 1de61d9..4ac37af 100644
--- a/lua/cshift/opt.lua
+++ b/lua/cshift/opt.lua
@@ -1,6 +1,9 @@
vim.opt.number = true
vim.opt.relativenumber = true
+vim.opt.list = true
vim.opt.shiftwidth = 4
vim.opt.tabstop = 4
+vim.opt.filetype = "on"
+
diff --git a/lua/cshift/plugins/lsp.lua b/lua/cshift/plugins/lsp.lua
index 6163169..04e0a92 100644
--- a/lua/cshift/plugins/lsp.lua
+++ b/lua/cshift/plugins/lsp.lua
@@ -13,6 +13,7 @@ return {
"clangd",
"jedi_language_server",
"rust_analyzer",
+ "ts_ls",
},
handlers = {
diff --git a/lua/cshift/plugins/treesitter.lua b/lua/cshift/plugins/treesitter.lua
new file mode 100644
index 0000000..33f85a0
--- /dev/null
+++ b/lua/cshift/plugins/treesitter.lua
@@ -0,0 +1,7 @@
+return {
+ {
+ 'nvim-treesitter/nvim-treesitter',
+ lazy = false,
+ build = ':TSUpdate'
+ }
+}
diff --git a/lua/cshift/treesitter.lua b/lua/cshift/treesitter.lua
new file mode 100644
index 0000000..4e7ec6b
--- /dev/null
+++ b/lua/cshift/treesitter.lua
@@ -0,0 +1,13 @@
+vim.api.nvim_create_autocmd('User', { pattern = 'TSUpdate',
+ callback = function()
+ require('nvim-treesitter.parsers').tnsl = {
+ install_info = {
+ path = '~/git/tree-sitter-tnsl',
+ generate = true,
+ generate_from_json = false,
+ queries = 'queries/neovim'
+ }
+ }
+ end
+})
+