File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ local notify = require "nvim-tree.notify"
6
6
local M = {}
7
7
8
8
local ALLOWED_MODIFIERS = {
9
- [" :p" ] = true ,
9
+ [" :p:h " ] = true ,
10
10
[" :t" ] = true ,
11
11
[" :t:r" ] = true ,
12
12
}
@@ -68,6 +68,9 @@ function M.fn(default_modifier)
68
68
local extension = vim .fn .fnamemodify (node .name , " :e" )
69
69
append = extension :len () == 0 and " " or " ." .. extension
70
70
end
71
+ if modifier == " :p:h" then
72
+ default_path = default_path .. " /"
73
+ end
71
74
72
75
local input_opts = { prompt = " Rename to " , default = default_path , completion = " file" }
73
76
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ Api.fs.remove = inject_node(require("nvim-tree.actions.fs.remove-file").fn)
97
97
Api .fs .trash = inject_node (require (" nvim-tree.actions.fs.trash" ).fn )
98
98
Api .fs .rename_node = inject_node (require (" nvim-tree.actions.fs.rename-file" ).fn " :t" )
99
99
Api .fs .rename = inject_node (require (" nvim-tree.actions.fs.rename-file" ).fn " :t" )
100
- Api .fs .rename_sub = inject_node (require (" nvim-tree.actions.fs.rename-file" ).fn " :p" )
100
+ Api .fs .rename_sub = inject_node (require (" nvim-tree.actions.fs.rename-file" ).fn " :p:h " )
101
101
Api .fs .rename_basename = inject_node (require (" nvim-tree.actions.fs.rename-file" ).fn " :t:r" )
102
102
Api .fs .cut = inject_node (require (" nvim-tree.actions.fs.copy-paste" ).cut )
103
103
Api .fs .paste = inject_node (require (" nvim-tree.actions.fs.copy-paste" ).paste )
You can’t perform that action at this time.
0 commit comments