You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mapping): deprecate user mappings and add on_attach
See the help doc. I think this is better than providing our custom
binding methods, idea taken from gitsigns.nvim.
Once this is complete, we could remove the whole mapping code and
simplify the actions -> dispatch configurations.
The new keymap.lua module is now used whenever on_attach is defined.
The `list` option in `view.mappings.list` is a table of
1074
+
Setting your own mapping in the configuration is deprecated, see |nvim-tree.on_attach| now.
1075
+
1076
+
You can remove default mappings with |nvim-tree.remove_keymaps|.
1077
+
1078
+
`<CR>`, `o`, `<2-LeftMouse>` open a file or folder; root will cd to the above directory
1079
+
`<C-e>` edit the file in place, effectively replacing the tree explorer
1080
+
`O` same as (edit) with no window picker
1081
+
`<C-]>`, `<2-RightMouse>` cd in the directory under the cursor
1082
+
`<C-v>` open the file in a vertical split
1083
+
`<C-x>` open the file in a horizontal split
1084
+
`<C-t>` open the file in a new tab
1085
+
`<` navigate to the previous sibling of current file/directory
1086
+
`>` navigate to the next sibling of current file/directory
1087
+
`P` move cursor to the parent directory
1088
+
`<BS>` close current opened directory or parent
1089
+
`<Tab>` open the file as a preview (keeps the cursor in the tree)
1090
+
`K` navigate to the first sibling of current file/directory
1091
+
`J` navigate to the last sibling of current file/directory
1092
+
`I` toggle visibility of files/folders hidden via |git.ignore| option
1093
+
`H` toggle visibility of dotfiles via |filters.dotfiles| option
1094
+
`U` toggle visibility of files/folders hidden via |filters.custom| option
1095
+
`R` refresh the tree
1096
+
`a` add a file; leaving a trailing `/` will add a directory
1097
+
`d` delete a file (will prompt for confirmation)
1098
+
`D` trash a file via |trash| option
1099
+
`r` rename a file
1100
+
`<C-r>` rename a file and omit the filename on input
1101
+
`x` add/remove file/directory to cut clipboard
1102
+
`c` add/remove file/directory to copy clipboard
1103
+
`p` paste from clipboard; cut clipboard has precedence over copy; will prompt for confirmation
1104
+
`y` copy name to system clipboard
1105
+
`Y` copy relative path to system clipboard
1106
+
`gy` copy absolute path to system clipboard
1107
+
`[e` go to next diagnostic item
1108
+
`[c` go to next git item
1109
+
`]e` go to prev diagnostic item
1110
+
`]c` go to prev git item
1111
+
`-` navigate up to the parent directory of the current file/directory
1112
+
`s` open a file with default system application or a folder with default file manager, using |system_open| option
1113
+
`f` live filter nodes dynamically based on regex matching.
1114
+
`F` clear live filter
1115
+
`q` close tree window
1116
+
`W` collapse the whole tree
1117
+
`E` expand the whole tree, stopping after expanding |actions.expand_all.max_folder_discovery| folders; this might hang neovim for a while if running on a big folder
1118
+
`S` prompt the user to enter a path and then expands the tree to match the path
1119
+
`.` enter vim command mode with the file the cursor is on
1120
+
`<C-k>` toggle a popup with file infos about the file under the cursor
1121
+
`g?` toggle help
1122
+
`m` Toggle node in bookmarks
1050
1123
1051
-
- `key` can be either a string or a table of string (lhs)
1052
-
- `action` is the name of the action, set to `""` to remove default action
1053
-
- `action_cb` is the function that will be called, it receives the node as a parameter. Optional for default actions
1054
-
- `mode` is normal by default
1055
-
>
1056
-
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
{ key = "s", cb = tree_cb("vsplit") }, --tree_cb and the cb property are deprecated
1066
-
{ key = "<2-RightMouse>", action = "" }, -- will remove default cd action
1067
-
}
1068
-
<
1069
-
Mouse support defined in |KeyBindings|
1070
-
1071
-
DEFAULT MAPPINGS *nvim-tree-default-mappings*
1072
-
1073
-
`<CR>` edit open a file or folder; root will cd to the above directory
1074
-
`o`
1075
-
`<2-LeftMouse>`
1076
-
`<C-e>` edit_in_place edit the file in place, effectively replacing the tree explorer
1077
-
`O` edit_no_picker same as (edit) with no window picker
1078
-
`<C-]>` cd cd in the directory under the cursor
1079
-
`<2-RightMouse>`
1080
-
`<C-v>` vsplit open the file in a vertical split
1081
-
`<C-x>` split open the file in a horizontal split
1082
-
`<C-t>` tabnew open the file in a new tab
1083
-
`<` prev_sibling navigate to the previous sibling of current file/directory
1084
-
`>` next_sibling navigate to the next sibling of current file/directory
1085
-
`P` parent_node move cursor to the parent directory
1086
-
`<BS>` close_node close current opened directory or parent
1087
-
`<Tab>` preview open the file as a preview (keeps the cursor in the tree)
1088
-
`K` first_sibling navigate to the first sibling of current file/directory
1089
-
`J` last_sibling navigate to the last sibling of current file/directory
1090
-
`I` toggle_git_ignored toggle visibility of files/folders hidden via |git.ignore| option
1091
-
`H` toggle_dotfiles toggle visibility of dotfiles via |filters.dotfiles| option
1092
-
`U` toggle_custom toggle visibility of files/folders hidden via |filters.custom| option
1093
-
`R` refresh refresh the tree
1094
-
`a` create add a file; leaving a trailing `/` will add a directory
1095
-
`d` remove delete a file (will prompt for confirmation)
1096
-
`D` trash trash a file via |trash| option
1097
-
`r` rename rename a file
1098
-
`<C-r>` full_rename rename a file and omit the filename on input
1099
-
`x` cut add/remove file/directory to cut clipboard
1100
-
`c` copy add/remove file/directory to copy clipboard
1101
-
`p` paste paste from clipboard; cut clipboard has precedence over copy; will prompt for confirmation
1102
-
`y` copy_name copy name to system clipboard
1103
-
`Y` copy_path copy relative path to system clipboard
1104
-
`gy` copy_absolute_path copy absolute path to system clipboard
1105
-
`[e` prev_diag_item go to next diagnostic item
1106
-
`[c` prev_git_item go to next git item
1107
-
`]e` next_diag_item go to prev diagnostic item
1108
-
`]c` next_git_item go to prev git item
1109
-
`-` dir_up navigate up to the parent directory of the current file/directory
1110
-
`s` system_open open a file with default system application or a folder with default file manager, using |system_open| option
1111
-
`f` live_filter live filter nodes dynamically based on regex matching.
1112
-
`F` clear_live_filter clear live filter
1113
-
`q` close close tree window
1114
-
`W` collapse_all collapse the whole tree
1115
-
`E` expand_all expand the whole tree, stopping after expanding |actions.expand_all.max_folder_discovery| folders; this might hang neovim for a while if running on a big folder
1116
-
`S` search_node prompt the user to enter a path and then expands the tree to match the path
1117
-
`.` run_file_command enter vim command mode with the file the cursor is on
1118
-
`<C-k>` toggle_file_info toggle a popup with file infos about the file under the cursor
1119
-
`g?` toggle_help toggle help
1120
-
`m` toggle_mark Toggle node in bookmarks
1121
-
`bmv` bulk_move Move all bookmarked nodes into specified location
0 commit comments