123456789101112131415161718192021222324252627282930313233343536373839 |
- -- Use Treesitter for syntax highlighting
- require('nvim-treesitter.configs').setup({
- highlight = {
- enable = true,
- },
- indent = {
- enable = true,
- },
- incremental_selection = {
- enable = true,
- keymaps = {
- init_selection = ']t',
- node_incremental = ']t',
- node_decremental = '[t',
- },
- },
- textobjects = {
- swap = {
- enable = true,
- swap_next = {
- ['>,'] = '@parameter.inner',
- },
- swap_previous = {
- ['<,'] = '@parameter.inner',
- },
- },
- },
- })
- -- set foldexpr to use treesitter
- vim.o.foldmethod = 'expr'
- vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
- vim.o.foldenable = false
- -- Treesitter context
- require('treesitter-context').setup({
- enable = true,
- multiline_threshold = 5,
- })
|