update to nvim 0.9

This commit is contained in:
veypi
2023-09-12 18:55:10 +08:00
parent 1349868048
commit e53c7aa336
8 changed files with 66 additions and 97 deletions
+7 -47
View File
@@ -1,65 +1,25 @@
local tree_cb = require 'nvim-tree.config'.nvim_tree_callback -- following options are the default
-- r rename
-- d delete
-- s open item in system tool
-- a add file/dir
require 'nvim-tree'.setup {
open_on_setup = true;
open_on_setup_file = false,
git = {
enable = true,
ignore = true,
timeout = 400,
sort_by = "case_sensitive",
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
custom = {},
exclude = {},
},
system_open = {
cmd = nil,
args = {},
git = {
enable = true,
ignore = true,
timeout = 400,
},
view = {
width = 24,
mappings = {
custom_only = true,
list = {
{ key = "<BS>", cb = tree_cb("dir_up") },
{ key = { "q", "<Esc>" }, cb = tree_cb("close") },
{ key = { "<2-RightMouse>", "<CR>" }, cb = tree_cb("cd") },
{ key = "<Tab>", cb = tree_cb("preview") },
{ key = "R", cb = tree_cb("refresh") },
{ key = "h", cb = tree_cb("close_node") },
{ key = { "o", "<CR>", "<2-RightMouse>" }, cb = tree_cb("edit") },
{ key = "a", cb = tree_cb("create") },
{ key = "d", cb = tree_cb("remove") },
{ key = "r", cb = tree_cb("rename") },
{ key = "x", cb = tree_cb("cut") },
{ key = "c", cb = tree_cb("copy") },
{ key = "p", cb = tree_cb("paste") },
{ key = "G", cb = tree_cb("prev_git_item") },
{ key = "g", cb = tree_cb("next_git_item") },
{ key = "?", cb = tree_cb("toggle_help") },
{ key = "<", cb = tree_cb("prev_sibling") },
{ key = ">", cb = tree_cb("next_sibling") },
{ key = "P", cb = tree_cb("parent_node") },
{ key = "K", cb = tree_cb("first_sibling") },
{ key = "J", cb = tree_cb("last_sibling") },
{ key = "I", cb = tree_cb("toggle_ignored") },
{ key = "H", cb = tree_cb("toggle_dotfiles") },
{ key = "<C-r>", cb = tree_cb("full_rename") },
{ key = "y", cb = tree_cb("copy_name") },
{ key = "Y", cb = tree_cb("copy_path") },
{ key = "gy", cb = tree_cb("copy_absolute_path") },
{ key = "S", cb = tree_cb("system_open") },
}
}
}
}