mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-06-15 09:48:46 +02:00
update nvimtree config
This commit is contained in:
parent
44d060c036
commit
b0ec5593b4
|
@ -1,8 +1,6 @@
|
|||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
require("nvim-tree").setup {
|
||||
open_on_setup = not vim.g.started_by_vinput,
|
||||
open_on_setup_file = false,
|
||||
actions = {
|
||||
change_dir = {
|
||||
global = true,
|
||||
|
@ -23,4 +21,19 @@ require("nvim-tree").setup {
|
|||
},
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
callback = function(data)
|
||||
local is_no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
local is_dir = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
if is_dir then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
|
||||
if is_no_name or is_dir then
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
map("n", "TT", [[<cmd>NvimTreeToggle<CR>]], { noremap = true, silent = true })
|
||||
|
|
Loading…
Reference in a new issue