mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
ref(nvim): redid plugin config system
This commit is contained in:
parent
d5406b8487
commit
56336c8e5e
14 changed files with 16 additions and 0 deletions
|
|
@ -1,56 +0,0 @@
|
|||
require "nvim-treesitter.configs".setup {
|
||||
|
||||
ensure_installed = {},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
|
||||
-- Disable for large files
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Text objets
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
selection_modes = {
|
||||
["@parameter.outer"] = "v", -- charwise
|
||||
["@function.outer"] = "V", -- linewise
|
||||
["@class.outer"] = "<c-v>", -- blockwise
|
||||
},
|
||||
include_surrounding_whitespace = true,
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require "treesitter-context".setup {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
max_lines = 2, -- How many lines the window should span. Values < = 0 mean no limit.
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values < = 0 mean no limit.
|
||||
line_numbers = true,
|
||||
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
|
||||
trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
mode = "topline", -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue