Compare commits
No commits in common. "948e49df35d092c7c7a01f500c9b143655740c23" and "309450a92688d662d1e5cade55e9cf3ab41c1385" have entirely different histories.
948e49df35
...
309450a926
|
@ -1,69 +1,19 @@
|
|||
local function on_attach(bufnr)
|
||||
local api = require("nvim-tree.api")
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "Tree: " .. desc, buffer = bufnr, noremap = true,
|
||||
silent = true, nowait = true }
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<CR>", api.node.open.edit, opts("Open"))
|
||||
|
||||
end
|
||||
|
||||
local tree = {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
lazy = false,
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {
|
||||
on_attach = on_attach,
|
||||
disable_netrw = true,
|
||||
sort_by = "case_sensitive",
|
||||
view = {
|
||||
adaptive_size = true,
|
||||
centralize_selection = true,
|
||||
number = true,
|
||||
relativenumber = true,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
highlight_git = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
},
|
||||
actions = {
|
||||
change_dir = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local function is_modified_buffer_open(buffers)
|
||||
for _, v in pairs(buffers) do
|
||||
if v.name:match("NvimTree_") == nil then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- [[
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
nested = true,
|
||||
callback = function()
|
||||
if
|
||||
#vim.api.nvim_list_wins() == 1
|
||||
and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil
|
||||
and is_modified_buffer_open(vim.fn.getbufinfo({ bufmodified = 1 })) == false
|
||||
then
|
||||
vim.cmd("quit")
|
||||
end
|
||||
end,
|
||||
})
|
||||
-- ]]
|
||||
|
||||
return { tree }
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
# charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
Loading…
Reference in New Issue