mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-22 00:03:55 +01:00
neovim: Open tree by default
This commit is contained in:
parent
c588b3a0d8
commit
f0867c039e
@ -69,6 +69,19 @@
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
local real_file = vim.fn.filereadable(data.file) == 1
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
if not real_file and not no_name then
|
||||
return
|
||||
end
|
||||
|
||||
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
'';
|
||||
}
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user