top | item 44548630

Show HN: VS Code extension to edit the filesystem like a text buffer

67 points| hexomancer | 7 months ago |github.com

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

46 comments

order

mprovost|7 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|7 months ago

That's so cool, I was actually curious about history of such programs. Thanks for posting this :)

turboponyy|7 months ago

"Look what they need to mimic a fraction of our power" - some Emacs user, probably

hexomancer|7 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.

whalesalad|7 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|7 months ago

Some vim user too! oil.nvim is a pretty popular package that does this.

gschizas|7 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|7 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.

norman784|7 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|7 months ago

Is it possible to make an extension like that for Zed?

weakfish|7 months ago

AFAIK not with their current extremely limited API, but it’s on their roadmap to have a more extendable editor.

norman784|7 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|7 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.

_Broken_Cloud_|7 months ago

The idea's cool, but the ui is kinda raw

hexomancer|7 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?

weakfish|7 months ago

Awesome work! I’ll definitely try this out.

dcreater|7 months ago

Falling to see why `touch newfile` doesn't accomplish this as fast if not faster and without yet another extension.

hexomancer|7 months ago

I doubt this comment was in good faith (you decided to ignore literally all the features I mentioned and focused on just creating files) but I am going to reply anyway:

1. There is no way that `touch newfile` is faster. Using voil, you press a keybind, enter `newfile`, save and you are done. Using touch you have to first, use some keybinding to switch to terminal, then type `touch ` (6 letter overhead) then type the name of the file and then switch back to vscode. I am not saying voil is meaningfully faster, but you saying that `touch newfile` is faster is wild to me.

2. If I am editing a comlpex file name I like having access to all the text editing features that I have in vscode as opposed to the barebones text editing features in the terminal.

3. There is also all the other moving/copying/renaming with visual feedback that you decided to completely ignore.

4. If touch was faster then oil.nvim would not have been such a popular extension. I am sure most vim users know how to use `touch`.

senectus1|7 months ago

haha yeah this'll never bee a problem with AI plugged into your VSCode :-D

hexomancer|7 months ago

Since voil uses its own file extension (.voil) you can easily disable copilot for voil windows.

Also voil asks you to confirm destructive actions. And even if you do, by default voil moves deleted files to a trash location and has undo functionality so you can easily undo your mistakes.

Etheryte|7 months ago

In this day and age, this could very well be an up and coming startup. "Hey <LLM>, find all files on my computer that might be a virus and delete them."