diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-05 00:13:48 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-05 00:13:48 +0900 |
| commit | 36a349d92eb530cd4678aa24bcfab89a165f58de (patch) | |
| tree | 220f33f6ccc47ef9ef8d4524ae693ea9553559cc /.config/nvim/lua/vimrc | |
| parent | 621beef73e8c120f3e3d5c660ce0ee94c1469bbf (diff) | |
| download | dotfiles-36a349d92eb530cd4678aa24bcfab89a165f58de.tar.gz dotfiles-36a349d92eb530cd4678aa24bcfab89a165f58de.tar.zst dotfiles-36a349d92eb530cd4678aa24bcfab89a165f58de.zip | |
nvim: migrate nvim-treesitter from legacy master branch to main branch
Diffstat (limited to '.config/nvim/lua/vimrc')
| -rw-r--r-- | .config/nvim/lua/vimrc/plugins.lua | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/.config/nvim/lua/vimrc/plugins.lua b/.config/nvim/lua/vimrc/plugins.lua index 217f21c..9cbe3ae 100644 --- a/.config/nvim/lua/vimrc/plugins.lua +++ b/.config/nvim/lua/vimrc/plugins.lua @@ -307,36 +307,25 @@ return { -- Tree-sitter integration. { 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdateSync', + branch = 'main', + build = ':TSUpdate', config = function() - require('nvim-treesitter.configs').setup { - ensure_installed = 'all', - sync_install = false, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - --[[ - incremental_selection = { - enable = true, - keymaps = { - init_selection = 'TODO', - node_incremental = 'TODO', - scope_incremental = 'TODO', - node_decremental = 'TODO', - }, - }, - --]] - indent = { - enable = true, - }, - } + require('nvim-treesitter').setup({}) + vimrc.autocmd('FileType', { + callback = function(ctx) + local ok = pcall(vim.treesitter.start) + if not ok then + return + end + vim.o.indentexpr = 'v:lua.require("nvim-treesitter").indentexpr()' + if vim.o.foldmethod == 'manual' then + vim.o.foldmethod = 'expr' + vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + end + end, + }) end, }, - -- Tree-sitter debugging. - { - 'nvim-treesitter/playground', - }, -- Highlight specified words. { 't9md/vim-quickhl', |
