From d92bfab3203d63a20b571b7c782c458c5f8d251e Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sat, 3 Jun 2023 19:53:43 -0600 Subject: move treesitter to independent file --- init.lua | 66 ++-------------------------------------------------------------- 1 file changed, 2 insertions(+), 64 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 4a32cbf..7d14185 100644 --- a/init.lua +++ b/init.lua @@ -25,6 +25,7 @@ vim.o.hlsearch = false -- Make line numbers default vim.wo.number = true +vim.wo.relativenumber = true -- Enable mouse mode vim.o.mouse = 'a' @@ -75,70 +76,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { pattern = '*', }) --- [[ Configure Treesitter ]] -require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, - - highlight = { enable = true }, - indent = { enable = true, disable = { 'python' } }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, -} + -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' }) -- cgit v1.2.3-54-g00ecf