Skip to content

Commit 7892c0c

Browse files
committed
fix: disable ts indenting for Ruby
Tree-sitter indenting for ruby is pretty terrible. But the fix requires a few steps, so showed those and documented how you could do that for other languages as well (with the tricky part being the additional_vim_regex_highlighting trick)
1 parent 5ac4b58 commit 7892c0c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,14 @@ require('lazy').setup({
790790
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
791791
-- Autoinstall languages that are not installed
792792
auto_install = true,
793-
highlight = { enable = true },
794-
indent = { enable = true },
793+
highlight = {
794+
enable = true,
795+
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
796+
-- If you are experiencing weird indenting issues, add the language to
797+
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
798+
additional_vim_regex_highlighting = { 'ruby' },
799+
},
800+
indent = { enable = true, disable = { 'ruby' } },
795801
},
796802
config = function(_, opts)
797803
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`

0 commit comments

Comments
 (0)