fix: replace nvim-tree properly with file browser
This commit is contained in:
parent
4737f707b4
commit
a5d8f1e277
3 changed files with 21 additions and 6 deletions
|
@ -33,7 +33,7 @@ local function open_nvim_tree(data)
|
|||
end
|
||||
|
||||
-- Using VimEnter is crucial, other autocmds will break the "focus = false" behaviour
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
--vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
|
||||
-- From https://github.com/nvim-tree/nvim-tree.lua/issues/1368#issuecomment-1512248492
|
||||
vim.api.nvim_create_autocmd("QuitPre", {
|
||||
|
|
|
@ -20,10 +20,14 @@ require("lazy").setup({
|
|||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons", -- optional, for file icons
|
||||
},
|
||||
init = function()
|
||||
require("nvim-tree-config")
|
||||
end,
|
||||
--[[ init = function()
|
||||
require("nvim-tree-config")
|
||||
end,]]
|
||||
opts = {
|
||||
hijack_directories = {
|
||||
enable = false,
|
||||
auto_open = false,
|
||||
},
|
||||
renderer = {
|
||||
highlight_modified = "name",
|
||||
},
|
||||
|
@ -33,7 +37,7 @@ require("lazy").setup({
|
|||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
update_focused_file = { enable = true },
|
||||
--update_focused_file = { enable = true },
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_ignored = false,
|
||||
|
@ -117,6 +121,9 @@ require("lazy").setup({
|
|||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
auto_depth = true,
|
||||
no_ignore = false,
|
||||
hidden = { file_browser = true, folder_browser = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -327,3 +334,11 @@ vim.diagnostic.config({
|
|||
})
|
||||
|
||||
vim.cmd("colorscheme catppuccin")
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function(data)
|
||||
if vim.fn.isdirectory(data.file) == 1 then
|
||||
require("telescope").extensions.file_browser.file_browser()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -23,5 +23,5 @@ wk.add({
|
|||
{ "<leader>xr", "<cmd>Trouble lsp_references toggle<cr>", desc = "" },
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Open Trouble" },
|
||||
{ "<leader>tt", require("telescope").extensions.file_browser.file_browser, desc = "Open the file browser" },
|
||||
{ "/", require("telescope.builtin").grep_string, desc = "Search for a string in the current buffer" },
|
||||
{ "/", require("telescope.builtin").current_buffer_fuzzy_find, desc = "Search for a string in the current buffer" },
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue