From 464644246c6601fa52c0af6add619c91770fdcbf Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Fri, 4 Feb 2022 09:41:54 +0100 Subject: [PATCH] Only one treesitter config --- init.lua | 67 +++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/init.lua b/init.lua index b9ef08d..513e63e 100644 --- a/init.lua +++ b/init.lua @@ -28,7 +28,38 @@ require('nvim-treesitter.configs').setup({ ensure_installed = 'maintained', highlight = { enable = true - } + }, + rainbow = { + enable = true, + extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + max_file_lines = nil, -- Do not enable for files with more than n lines, int + -- colors = {}, -- table of hex strings + -- termcolors = {} -- table of colour name strings + }, + textobjects = { + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + lsp_interop = { + enable = true, + border = 'none', + peek_definition_code = { + ["df"] = "@function.outer", + ["dF"] = "@class.outer", + }, + }, + }, }) -------------------- GITSIGNS ------------------------------ require('gitsigns').setup({ @@ -104,40 +135,6 @@ require("project_nvim").setup { } require('telescope').load_extension('projects') utils.map('n', 'p', 'Telescope projects') --------------------- TS-RAINBOW ---------------------------- -require'nvim-treesitter.configs'.setup { - rainbow = { - enable = true, - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {} -- table of colour name strings - }, - textobjects = { - select = { - enable = true, - - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - lsp_interop = { - enable = true, - border = 'none', - peek_definition_code = { - ["df"] = "@function.outer", - ["dF"] = "@class.outer", - }, - }, - }, -} -------------------- LUASNIP ------------------------------- require("luasnip.loaders.from_vscode").load() -------------------- AUTOPAIRS -----------------------------