Reputation: 61
Like in vim nerd tree plugin, when you push 'm' then 'a' button in vim nerd tree you can add file in current directory where cursor on Nerd tree. Is it possible do it in vs code? Maybe some plugins?
Upvotes: 6
Views: 1441
Reputation: 5355
Unfortunately there is no such plugin yet but you could define some customized keybindings which resembles NERDTree to some extent ( File > Preferences > Keyboard Shortcuts
and click on the link keybindings.json
):
[
{
"key": "f",
"command": "explorer.newFile",
"when": "explorerViewletFocus && !inputFocus"
},
{
"key": "d",
"command": "explorer.newFolder",
"when": "explorerViewletFocus && !inputFocus"
},
{
"key": "x",
"command": "deleteFile",
"when": "explorerViewletFocus && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "enter",
"command": "list.select",
"when": "listFocus && !inputFocus"
},
{
"key": "o",
"command": "list.select",
"when": "listFocus && !inputFocus"
}
]
You could change the key
s freely and commands are self explanatory. i. e: hitting f
in explorer will add a file in selected directory and ... ).
Fortunately we also have j
and k
movements in explorer via vscodevim plugin.
The only missing part is searching the tree; and of course there is a promise to be added by January 2019 ( see issue #10026 )
Upvotes: 4