mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat(nvim-treesitter.lua): add support for additional parsers (markdown_inline, markdown) to improve syntax highlighting capabilities
feat(nvim-treesitter.lua): enable textobjects for moving, selecting, and swapping code blocks to enhance code navigation and manipulation within the editor
This commit is contained in:
@@ -1,6 +1,18 @@
|
|||||||
require 'nvim-treesitter.configs'.setup {
|
require("nvim-treesitter.configs").setup({
|
||||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||||
ensure_installed = { "rust", "javascript", "typescript", "python", "c", "lua", "vim", "vimdoc", "query" },
|
ensure_installed = {
|
||||||
|
"rust",
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"python",
|
||||||
|
"c",
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"query",
|
||||||
|
"markdown_inline",
|
||||||
|
"markdown",
|
||||||
|
},
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
@@ -19,4 +31,39 @@ require 'nvim-treesitter.configs'.setup {
|
|||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
}
|
textobjects = {
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = false, -- you can change this if you want.
|
||||||
|
goto_next_start = {
|
||||||
|
--- ... other keymaps
|
||||||
|
["]b"] = { query = "@code_cell.inner", desc = "next code block" },
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
--- ... other keymaps
|
||||||
|
["[b"] = { query = "@code_cell.inner", desc = "previous code block" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true, -- you can change this if you want
|
||||||
|
keymaps = {
|
||||||
|
--- ... other keymaps
|
||||||
|
["ib"] = { query = "@code_cell.inner", desc = "in block" },
|
||||||
|
["ab"] = { query = "@code_cell.outer", desc = "around block" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
swap = { -- Swap only works with code blocks that are under the same
|
||||||
|
-- markdown header
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
--- ... other keymap
|
||||||
|
["<leader>sbl"] = "@code_cell.outer",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
--- ... other keymap
|
||||||
|
["<leader>sbh"] = "@code_cell.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user