mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-22 04:21:03 +00:00
154 lines
4.3 KiB
Lua
Executable file
154 lines
4.3 KiB
Lua
Executable file
return {
|
|
{
|
|
"rmagatti/goto-preview",
|
|
event = "BufEnter",
|
|
config = true, -- necessary as per https://github.com/rmagatti/goto-preview/issues/88
|
|
keys = {
|
|
{
|
|
"gpd",
|
|
"<cmd>lua require('goto-preview').goto_preview_definition()<CR>",
|
|
noremap = true,
|
|
desc = "goto preview definition",
|
|
},
|
|
{
|
|
"gpD",
|
|
"<cmd>lua require('goto-preview').goto_preview_declaration()<CR>",
|
|
noremap = true,
|
|
desc = "goto preview declaration",
|
|
},
|
|
{
|
|
"gpi",
|
|
"<cmd>lua require('goto-preview').goto_preview_implementation()<CR>",
|
|
noremap = true,
|
|
desc = "goto preview implementation",
|
|
},
|
|
{
|
|
"gpy",
|
|
"<cmd>lua require('goto-preview').goto_preview_type_definition()<CR>",
|
|
noremap = true,
|
|
desc = "goto preview type definition",
|
|
},
|
|
{
|
|
"gpr",
|
|
"<cmd>lua require('goto-preview').goto_preview_references()<CR>",
|
|
noremap = true,
|
|
desc = "goto preview references",
|
|
},
|
|
{
|
|
"gP",
|
|
"<cmd>lua require('goto-preview').close_all_win()<CR>",
|
|
noremap = true,
|
|
desc = "close all preview windows",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"nvim-mini/mini.hipatterns",
|
|
event = "BufReadPre",
|
|
opts = {
|
|
highlighters = {
|
|
hsl_color = {
|
|
pattern = "hsl%(%d+,? %d+,? %d+%)",
|
|
group = function(_, match)
|
|
local utils = require("config.eliasdev.utils")
|
|
local h, s, l = match:match("hsl%((%d+),? (%d+),? (%d+)%)")
|
|
h, s, l = tonumber(h), tonumber(s), tonumber(l)
|
|
local hex_color = utils.hslToHex(h, s, l)
|
|
return MiniHipatterns.compute_hex_color_group(hex_color, "bg")
|
|
end,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
"dinhhuy258/git.nvim",
|
|
event = "BufReadPre",
|
|
opts = {
|
|
keymaps = {
|
|
-- Open blame window
|
|
blame = "<Leader>gb",
|
|
-- Open file/folder in git repository
|
|
browse = "<Leader>go",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"nvim-telescope/telescope.nvim",
|
|
opts = function(_, opts)
|
|
local actions = require("telescope.actions")
|
|
|
|
opts.defaults = {
|
|
file_ignore_patterns = {
|
|
"node_modules",
|
|
"package-lock.json",
|
|
"yarn.lock",
|
|
"bun.lockb",
|
|
},
|
|
prompt_prefix = "> ", -- Set the prompt to just ">"
|
|
layout_strategy = "horizontal", -- Use horizontal layout
|
|
sorting_strategy = "ascending",
|
|
|
|
winblend = 0, -- No transparency
|
|
results_title = false, -- Remove the "Results" title
|
|
|
|
borderchars = {
|
|
prompt = { "─", " ", " ", " ", " ", " ", " ", " " }, -- Top border for the prompt only
|
|
results = { " ", " ", " ", " ", " ", " ", " ", " " }, -- No borders for results
|
|
preview = { "─", "│", " ", "│", "╭", "╮", "", "" }, -- Borders for the preview (top and sides)
|
|
},
|
|
mappings = {
|
|
i = {
|
|
["<C-Down>"] = actions.cycle_history_next,
|
|
|
|
["<C-Up>"] = actions.cycle_history_prev,
|
|
["<C-f>"] = actions.preview_scrolling_down,
|
|
|
|
["<C-b>"] = actions.preview_scrolling_up,
|
|
},
|
|
n = {
|
|
["q"] = actions.close,
|
|
},
|
|
},
|
|
}
|
|
|
|
-- Load the fzf extension for fast searches
|
|
require("telescope").load_extension("fzf")
|
|
|
|
-- Add hidden files and no-ignore options to file search and live_grep
|
|
opts.pickers = {
|
|
find_files = {
|
|
find_command = { "rg", "--files", "--hidden", "--no-ignore", "--iglob", "!.git/" },
|
|
},
|
|
live_grep = {
|
|
additional_args = function()
|
|
return { "--hidden", "--no-ignore" }
|
|
end,
|
|
},
|
|
}
|
|
return opts
|
|
end,
|
|
|
|
dependencies = {
|
|
{
|
|
"nvim-telescope/telescope-live-grep-args.nvim",
|
|
version = "^1.0.0",
|
|
config = function()
|
|
require("telescope").load_extension("live_grep_args")
|
|
end,
|
|
},
|
|
{
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
build = "make",
|
|
config = function()
|
|
require("telescope").load_extension("fzf")
|
|
end,
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
require("telescope").setup(opts)
|
|
|
|
vim.keymap.set("n", "<leader>fg", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>")
|
|
end,
|
|
},
|
|
}
|