update: huge style update
This commit is contained in:
@@ -9,6 +9,9 @@ return {
|
||||
local tree = require("neo-tree")
|
||||
|
||||
tree.setup({
|
||||
clipboard = {
|
||||
sync = "universal",
|
||||
},
|
||||
document_symbols = {
|
||||
custom_kinds = {},
|
||||
},
|
||||
@@ -19,8 +22,31 @@ return {
|
||||
["h"] = "close_node",
|
||||
["<Right>"] = "open",
|
||||
["<Left>"] = "close_node",
|
||||
["C"] = "convert_to_directory",
|
||||
},
|
||||
},
|
||||
commands = {
|
||||
convert_to_directory = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node.path
|
||||
|
||||
if node.type ~= "file" then
|
||||
print("Node is not a file")
|
||||
return
|
||||
end
|
||||
|
||||
local confirm = vim.fn.confirm("Convert " .. node.name .. " to directory?", "&Yes\n&No", 2)
|
||||
if confirm ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
vim.fn.delete(path)
|
||||
vim.fn.mkdir(path, "p")
|
||||
|
||||
require("neo-tree.sources.manager").refresh(state.name)
|
||||
print("Converted to directory: " .. path)
|
||||
end,
|
||||
},
|
||||
})
|
||||
vim.keymap.set("n", "<F2>", "<CMD>Neotree toggle<CR>")
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user