Readit News logoReadit News
Posted by u/hexomancer 8 months ago
Show HN: VS Code extension to edit the filesystem like a text buffergithub.com/ahrm/voil...
This is a spiritual adaptation of oil.nvim for vscode. The main idea is you edit the filesystem by editing the current directory listing's text buffer. For example, if I want to rename a file, I just rename it in the listing file. This is extremely powerful because it translates all of your text-editing skills immediately into file editing capabilities.

Some features:

* Create/rename/move/delete files by editing the current directory listing's textbuffer

* Filter using glob pattern

* Trash and undo support

* Works even in remote-ssh workspaces

* Works across multiple vscode windows

mprovost · 8 months ago
There's a long history of "directory editor" programs going back to (at least) 1974, which predates emacs. It's not surprising that there are many examples of convergent evolution.

https://invisible-island.net/ded/dating-dired.html

hexomancer · 8 months ago
That's so cool, I was actually curious about history of such programs. Thanks for posting this :)
lorenzohess · 8 months ago
See vimv (https://github.com/thameera/vimv) for a minimal version of this in the CLI, using Vim as the editor.
mjw1007 · 8 months ago
Also vidir, which is in the moreutils package in popular distros.

Deleted Comment

turboponyy · 8 months ago
"Look what they need to mimic a fraction of our power" - some Emacs user, probably
hexomancer · 8 months ago
I don't use emacs so I may not be familiar with the full power, but if you are referring to dired, I think oil.nvim is much, much more powerful than dired.

The major difference being that you still need to learn some new keybinds for dired, for example, you can't just create a file by editing the text buffer whereas in oil.nvim (and by extension, voil) your text editing skills immediately apply.

globular-toast · 8 months ago
You can switch to wdired and then edit the filenames etc. But true you can't create/delete files. Creating empty files is rarely useful or necessary, though, so not sure why you'd want that. Deleting files is more useful but that seems perfect in normal dired as you can see what you've marked rather than try to mentally keep track of lines you've already deleted.
whalesalad · 8 months ago
Was literally thinking the same thing. A colleague of mine basically used emacs as an operating system. Pretty sure he could get his to make buttered toast.
heltale · 8 months ago
Some vim user too! oil.nvim is a pretty popular package that does this.
hexomancer · 8 months ago
I obviously love oil.nvim and that's why I ported it to vscode. But I think in some ways voil is even more powerful than oil. Specifically:

- It can work across multiple vscode windows

- The top line (that shows the current directory) can be used to filter files. For example, if you add "*.{txt,md}" to the end of that line, it will only show the txt and markdown files.

- The ability to defined custom shell commands and bind keybindings to them. For example, I can create a command that zips selected files and run it with a single keybinding in voil.

- Undo functionality

Deleted Comment

gschizas · 8 months ago
This looks cool, but I'm a bit wary of publishers that aren't verified.

> Do you trust the publisher "Ali Mostafavi"?

> The extension voil is published by Ali Mostafavi. This is the first extension > you're installing from this publisher.

> Ali Mostafavi is not verified.

> Visual Studio Code has no control over the behavior of third-party extensions, including how they manage your personal data. Proceed only if you trust the publisher.

hexomancer · 8 months ago
You can view the source code and package the extension yourself if you are worried about that. It is only ~2000 LOC.

It is not easy to get verified in vscode marketplace, even major publishers like Qt organization are not verified much less so a solo open source developer like myself.

aaomidi · 8 months ago
I’m Iranian too and our names get people a lot more concerned.

If your name sounded English the implicit bias would make you sound more trust worthy.

gschizas · 8 months ago
I have high 2 digits of extensions in my VS Code, and yours is the only one that wouldn't have a verified publisher. And I certainly have more than one from solo developers.

Qt organization (because you mentioned it) also has verification. It displays a different message (because I haven't installed anything from them):

> The extension Qt Core is published by Qt Group. This is the first extension you're installing from this publisher.

> Qt Group has verified ownership of qt.io.

> Visual Studio Code has no control over the behavior of third-party extensions, including how they manage your personal data. Proceed only if you trust the publisher.

EDIT: I'm sure there are other extensions that are also by unverified publishers. It was the first time I was hit with that message though.

SketchySeaBeast · 8 months ago
The burden isn't just when I install it, I need to validate every time it's updated as well. But let's be realistic, the fact that I intrinsically trust extensions published by Microsoft isn't any better.
4gotunameagain · 8 months ago
> view the source code and package the extension yourself

The problem is that nobody will do that. Even if it were 500 LOC.

And this is why supply chain attacks are on the rise.

Deleted Comment

norman784 · 8 months ago
For the current extension model, I would not trust anyone besides any known org. Even installing themes are potentially dangerous, because of the attack vector.
SwiftyBug · 8 months ago
Is it possible to make an extension like that for Zed?
weakfish · 8 months ago
AFAIK not with their current extremely limited API, but it’s on their roadmap to have a more extendable editor.
norman784 · 8 months ago
At this point I opted to just install extension from known ORGs only, like Microsoft, Github, etc and the official extensions from the languages I use. All other extensions, even themes are no more for me.
nsonha · 8 months ago
When I was a student about 10 years ago there was a custom shell that works like this and even had an extension for sublime, but for the life of me I cannot remember its name.
Davidbrcz · 8 months ago
So emacs-dired ?
_Broken_Cloud_ · 8 months ago
The idea's cool, but the ui is kinda raw
hexomancer · 8 months ago
Thanks for the feedback. Can you be a little more specific? What do you mean by "raw"? Do you mean from an aesthetic standpoint or is there some functionality you are missing from the UI?