This commit is contained in:
Bryan Ramos 2024-08-20 17:11:27 -04:00
parent 4c8fadee55
commit 12b6749545
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
2 changed files with 16 additions and 1 deletions

View file

@ -6,7 +6,7 @@ return {
require("lualine").setup ({
options = {
icons_enabled = true,
theme = 'iceberg_dark',
theme = 'material',
component_separators = { left = '>', right = '|'},
section_separators = { left = '', right = ''},
disabled_filetypes = {

View file

@ -1,3 +1,12 @@
local function git_root()
local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
if git_dir and git_dir ~= "" then
return git_dir
else
return vim.fn.getcwd() -- Fallback to current working directory if not in a Git repo
end
end
return {
{
"nvim-telescope/telescope.nvim",
@ -11,7 +20,13 @@ return {
}
},
config = function()
-- Custom Telescope command to grep from Git root
vim.api.nvim_set_keymap('n', '<leader>lg', "<cmd>lua require('telescope.builtin').live_grep({ cwd = git_root() })<CR>", { noremap = true, silent = true })
require("which-key").add({
{ "<leader>/", function()
require('telescope.builtin').live_grep({ cwd = git_root() })
end,
desc = "grep" },
{ "<leader>/", ":Telescope live_grep<CR>", desc = "grep" },
{ "<leader>ff", ":Telescope fd<CR>", desc = "Search for Files" },
{ "<leader>fp", ":Telescope oldfiles<CR>", desc = "Oldfiles" },