Explorer: vim-style shortcuts for cutting, copying, deleting, renaming etc
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Is your feature request related to a problem? Please describe.
The way hjkl work in Explorer by default is wonderful. I was hoping that other commands such as copy/paste/cut will work similarly. However, they don't.
Describe the solution you'd like
See my screencast below and essentially the change boils down to defaulting to these keybindings:
{
"key": "x",
"command": "filesExplorer.cut",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "y",
"command": "filesExplorer.copy",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus"
},
{
"key": "p",
"command": "filesExplorer.paste",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "d d",
"command": "deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceMoveableToTrash && !explorerResourceReadonly && !inputFocus"
},
{
"key": "i",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
}
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceReadonly && !inputFocus"
},
(the last one was suggested by @Edgar-P-yan )
I think we can add them to existing keybindings (Cmd/Ctrl+C for copying etc) rather than replacing them.
Describe alternatives you've considered
🤔
Additional context
I recorded a screencast showcasing what I would like to see by default:
https://user-images.githubusercontent.com/14952597/135591050-9365e7dd-fd4c-4d95-8f59-fb1f70813cb7.mov
What else can be done here
I have not yet tried but selecting files as lines in visual mode (Shift+v + j/k) with similar functionality as described above.
By the way, thank you all for contributing to this nice extension ❤️ !
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing VS Code Explorer keybindings and the commands named in the request: filesExplorer.cut, filesExplorer.copy, filesExplorer.paste, deleteFile, renameFile, and explorer.newFile. Check how default bindings are registered and verify that the proposed keys work in Explorer without removing the existing Cmd/Ctrl shortcuts; done means the listed operations work with the stated context conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100