]> git.r.bdr.sh - rbdr/dotfiles/commitdiff
Use treesitter in neovim
authorRuben Beltran del Rio <redacted>
Mon, 2 Oct 2023 22:28:19 +0000 (00:28 +0200)
committerRuben Beltran del Rio <redacted>
Mon, 2 Oct 2023 22:28:19 +0000 (00:28 +0200)
config/nvim/coc-settings.json [deleted file]
config/nvim/init.lua
config/nvim/lazy-lock.json
config/nvim/lua/lsp.lua
config/nvim/lua/plugins.lua
config/nvim/lua/treesitter_config.lua [new file with mode: 0644]
provisioning/brew_essential
provisioning/pacman_essential

diff --git a/config/nvim/coc-settings.json b/config/nvim/coc-settings.json
deleted file mode 100644 (file)
index 9be6d48..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "svelte.enable-ts-plugin": true,
-  "suggest.noselect": true
-}
index 1b5fda92408d9fae3efa156fd29837962822f035..e3e64279da2e97b36dec22cda757c29e74f31a44 100644 (file)
@@ -86,5 +86,6 @@ vim.g.vim_svelte_plugin_use_typescript = true
 
 -- Plugins
 require('plugins')
+require('treesitter_config')
 require('lsp')
 require('dap_config')
index 0502bd4bb680f7fbf265c6144957879d10963361..a32d9a504fa15183e75771714489116dc6396821 100644 (file)
@@ -1,29 +1,18 @@
 {
   "LargeFile": { "branch": "master", "commit": "3941a37b2b0288524300348a39521a46539bf9f6" },
   "api-notation.vim": { "branch": "master", "commit": "b6f0708fb9f009b7051db514423e9ebf86bc9af4" },
-  "dart-vim-plugin": { "branch": "master", "commit": "928302ec931caf0dcf21835cca284ccd2b192f7b" },
-  "fzf-lua": { "branch": "main", "commit": "335f908b912504015fefeeccacb4c325029d2bfc" },
+  "fzf-lua": { "branch": "main", "commit": "1ff0278882db9786fef6f77cbcea7d8fa4b9ccee" },
   "gemini.vim": { "branch": "master", "commit": "c9efb59c97b71c28d4678c79fd21fbdd3a69d196" },
-  "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" },
-  "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
-  "neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" },
+  "lazy.nvim": { "branch": "main", "commit": "59335c5b9d116f5d3948f833288a89e2a829a005" },
+  "neodev.nvim": { "branch": "main", "commit": "5147640bc8435ca3557a105ebd1143bc20420b60" },
   "nvim-dap": { "branch": "master", "commit": "b3d4408e29d924fe130c9397a7c3b3630b3ea671" },
   "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
-  "nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" },
-  "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
+  "nvim-lspconfig": { "branch": "master", "commit": "ac478757efcde1ac346f7044ab774e7cbb482533" },
+  "nvim-treesitter": { "branch": "master", "commit": "d96c216c54cc2d48d3c66ba7f0fc3c7c5b71b3b1" },
   "snes-syntax-vim": { "branch": "master", "commit": "a6a699c8905f7b6119bf91e44f960667d9f03d59" },
-  "typescript-vim": { "branch": "master", "commit": "31ede5ad905ce4159a5e285073a391daa3bf83fa" },
   "vim-closer": { "branch": "master", "commit": "6007d9db0a35e983af246b667282606612076b07" },
   "vim-endwise": { "branch": "master", "commit": "e714ac3bcfd5a90038de49c3254eded7c70ae3c3" },
   "vim-fugitive": { "branch": "master", "commit": "99db68d9b3304580bd383da7aaee05c7a954a344" },
-  "vim-glsl": { "branch": "master", "commit": "bfd330a271933c3372fcfa8ce052970746c8e9dd" },
-  "vim-graphql": { "branch": "master", "commit": "6089a44e89e76f9eba138fb68bfd132420404ff7" },
   "vim-indent-object": { "branch": "master", "commit": "5c5b24c959478929b54a9e831a8e2e651a465965" },
-  "vim-javascript": { "branch": "master", "commit": "c470ce1399a544fe587eab950f571c83cccfbbdc" },
-  "vim-json": { "branch": "master", "commit": "3727f089410e23ae113be6222e8a08dd2613ecf2" },
-  "vim-pug": { "branch": "master", "commit": "ea39cd942cf3194230cf72bfb838901a5344d3b3" },
-  "vim-svelte-plugin": { "branch": "master", "commit": "612b34640919c29b5cf2d85289dbc762b099858a" },
-  "vim-swift": { "branch": "master", "commit": "76dd8b90aec0e934e5a9c524bba9327436d54348" },
-  "vim-togglelist": { "branch": "master", "commit": "48f0d30292efdf20edc883e61b121e6123e03df7" },
-  "zig.vim": { "branch": "master", "commit": "15841fc4fecfb1b6c02da9b4cc17ced135edbf8e" }
+  "vim-togglelist": { "branch": "master", "commit": "48f0d30292efdf20edc883e61b121e6123e03df7" }
 }
\ No newline at end of file
index eb8b98f86b8339069380bf426c49181a4ada16f6..dc90a7bad69967520ef463316d82ef6c9e2a8b48 100644 (file)
@@ -13,12 +13,6 @@ lspconfig.rust_analyzer.setup {
     ['rust-analyzer'] = {},
   },
 }
-lspconfig.cssls.setup {
-  capabilities = capabilities,
-}
-lspconfig.html.setup {
-  capabilities = capabilities,
-}
 lspconfig.lua_ls.setup{}
 
 -- Global mappings.
index 27d1c3252848911747989e14ced80cdda7a51108..0a43a3e7caaf48ff891bf4a853490034a6ea7621 100644 (file)
@@ -45,20 +45,8 @@ require('lazy').setup({
 
   -- Syntaxes
   'https://git.sr.ht/~rbdr/api-notation.vim',
-  'elzr/vim-json',
-  'pangloss/vim-javascript',
   'ARM9/snes-syntax-vim',
-  'leafgarland/typescript-vim',
-  'leafOfTree/vim-svelte-plugin',
-  'bumaociyuan/vim-swift',
-  'udalov/kotlin-vim',
-  'tikhomirov/vim-glsl',
-  'jparise/vim-graphql',
-  'digitaltoad/vim-pug',
   'https://git.sr.ht/~torresjrjr/gemini.vim',
-  'rust-lang/rust.vim',
-  'dart-lang/dart-vim-plugin',
-  'ziglang/zig.vim',
 
   -- Debugging
   'mfussenegger/nvim-dap',
@@ -69,6 +57,9 @@ require('lazy').setup({
   'rstacruz/vim-closer',
   'michaeljsmith/vim-indent-object',
 
+  -- Treesitter
+  'nvim-treesitter/nvim-treesitter',
+
   -- LSP
   'neovim/nvim-lspconfig',
   'folke/neodev.nvim',
diff --git a/config/nvim/lua/treesitter_config.lua b/config/nvim/lua/treesitter_config.lua
new file mode 100644 (file)
index 0000000..fc4a4a7
--- /dev/null
@@ -0,0 +1,48 @@
+require'nvim-treesitter.configs'.setup {
+  -- A list of parser names, or "all" (the five listed parsers should always be installed)
+  ensure_installed = {
+    'bash',
+    'css',
+    'dart',
+    'diff',
+    'dockerfile',
+    'gitcommit',
+    'graphql',
+    'html',
+    'htmldjango',
+    'javascript',
+    'jsdoc',
+    'json',
+    'kotlin',
+    'lua',
+    'make',
+    'markdown',
+    'python',
+    'ruby',
+    'rust',
+    'sql',
+    'svelte',
+    'swift',
+    'toml',
+    'tsx',
+    'typescript',
+    'yaml'
+  },
+
+  sync_install = false,
+  auto_install = true,
+
+  highlight = {
+    enable = true,
+
+    disable = function(lang, buf)
+        local max_filesize = 100 * 1024 -- 100 KB
+        local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+        if ok and stats and stats.size > max_filesize then
+            return true
+        end
+    end,
+
+    additional_vim_regex_highlighting = false,
+  },
+}
index 613e2b2d0d3d7c7984fba3d71dd45e11ae8e21f7..60148bc0acc15a2d7394d722d53a97493712fb96 100644 (file)
@@ -20,3 +20,4 @@ zsh
 koekeishiya/formulae/yabai
 koekeishiya/formulae/skhd
 pass
+tree-sitter
index 7eecca0b27e8dbe4912531e083ecf9badb103427..e30d6103e4df5b7cd89a2120785a40a15195d881 100644 (file)
@@ -20,3 +20,4 @@ zsh
 inetutils
 z
 pass
+tree-sitter