mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
feat: use lazy.nvim
This commit is contained in:
parent
2664b49a62
commit
5c8c442da4
37 changed files with 892 additions and 809 deletions
105
.config/nvim/lua/plugins/power.lua
Normal file
105
.config/nvim/lua/plugins/power.lua
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
return {
|
||||
-- Power tools
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local themes = require("telescope.themes")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>?", builtin.oldfiles, { desc = "[?] Find recently opened files" })
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(themes.get_dropdown({ previewer = false }))
|
||||
end, { desc = "[/] Fuzzily search in current buffer]" })
|
||||
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "Search [A]ll [F]iles" })
|
||||
vim.keymap.set("n", "<leader>gf", builtin.git_files, { desc = "Search [G]it [F]iles" })
|
||||
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>b", builtin.buffers, { desc = "Search [B]uffers" })
|
||||
end,
|
||||
},
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make", cond = vim.fn.executable("make") == 1 },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
|
||||
ts_update()
|
||||
end,
|
||||
opts = {
|
||||
{
|
||||
-- A list of parser names, or "all" (the four listed parsers should always be installed)
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"cpp",
|
||||
"lua",
|
||||
"vim",
|
||||
"help",
|
||||
"rust",
|
||||
"scala",
|
||||
"python",
|
||||
},
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
-- set to `false` to disable one of the mappings
|
||||
init_selection = "false",
|
||||
scope_incremental = "false",
|
||||
node_incremental = "<A-Up>",
|
||||
node_decremental = "<A-Down>",
|
||||
},
|
||||
},
|
||||
refactor = {
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
smart_rename = "grr",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
opts = {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
max_lines = 0, -- 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'
|
||||
-- Separator between context and content. Should be a single character string, like '-'.
|
||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||
separator = nil,
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue