This repository was archived by the owner on Sep 19, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathgitbare.lua
More file actions
33 lines (29 loc) · 2.54 KB
/
Copy pathgitbare.lua
File metadata and controls
33 lines (29 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
return {
"denxeiy/gitbare.nvim",
dependencies = {
"telescope-nvim/telescope.nvim", -- dependency for beautiful UI windows and navigation
"nvim-tree/nvim-web-devicons", -- dependency for beautiful colorful icons
},
config = function ()
require("gitbare").setup({ -- setup is strongly required, maybe won't work without it
dir = "/home/user", -- or any other directory. i prefer to use $HOME
git_dir_name = ".git", -- or .*any*, depends on how you named it if your place
find_in_current_dir = false, -- false - search system-wide in your bare git repo, true - only in current dir (pwd)
grep_in_current_dir = false, -- same as above but for live grep, search by words
filter_key = "<C-f>", -- keybind to toggle filter that shows all files and dirs with files, or only modified files and dirs with modified files
})
vim.keymap.set("n", "<leader>cb", function() -- file browser, you can put keymap in your separate file with mappings or change keys here
require("gitbare").gitbare_browser() -- if you will set keymap somewhere else - do it with this function()
end, { desc = "GitBare File Browser" }) -- if you don't need this bind - just comment it with "--" on left side
vim.keymap.set("n", "<leader>cf", function() -- find files, you can put keymap in your separate file with mappings or change keys here
require("telescope.builtin").gitbare_find_files() -- if you will set keymap somewhere else - do it with this function()
end, { desc = "GitBare Find Files" }) -- if you don't need this bind - just comment it with "--" on left side
vim.keymap.set("n", "<leader>cg", function() -- live grep, you can put keymap in your separate file with mappings or change keys here
require("telescope.builtin").gitbare_live_grep() -- if you will set keymap somewhere else - do it with this function()
end, { desc = "GitBare Live Grep" }) -- if you don't need this bind - just comment it with "--" on left side
------------------------or you can add keymaps like this, using commands-----------------------
-- vim.keymap.set("n", "<leader>cb", "<CMD>BareBrowser<CR>", { desc = "GitBare File Browser" })
-- vim.keymap.set("n", "<leader>cf", "<CMD>BareFiles<CR>", { desc = "GitBare Find Files" })
-- vim.keymap.set("n", "<leader>cg", "<CMD>BareGrep<CR>", { desc = "GitBare Live Grep" })
end, -- at the end of installation you can remove all of my silly comments like this one :)
}