Skip to content

Commit

Permalink
fix: disable ts indenting for Ruby
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tjdevries committed Mar 15, 2024
1 parent 5ac4b58 commit 7892c0c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,14 @@ require('lazy').setup({
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
Expand Down

0 comments on commit 7892c0c

Please sign in to comment.