antonmedv / walk

Terminal file manager
MIT License
3.24k stars 88 forks source link

Added ability to select editor inside llama #10

Closed habitualdev closed 2 years ago

habitualdev commented 2 years ago

Adding an additional hotkey (Ctrl+e) to spawn and de-spawn a text input window (that does not interfere with current fuzzy searching setup) that allows the user to temporarily assign the editor that is used without having to change the env variable and respawn llama.

Thoughts?

habitualdev commented 2 years ago

Additionall added the use of "github.com/inancgumus/screen" just for a cleaner aesthetic.

antonmedv commented 2 years ago

Hi, but what problem do you trying to solve? Opening different editors for file types?

I'd want to avoid introducing new shortcuts. The main idea behind llama was to be as simple as possible. To be opposite of other terminal file managers, bloated with features and shortcuts to remember.

What about using .llamarc instead? For example to specify configuration for file extensions there? What do you think?

habitualdev commented 2 years ago

The problem I was trying to solve was using different tools for different file types/purposes, ie less is great for quickly scanning a file, vim similarly is great for editing, but in the instances where the file is a less human readable notation format (XML/JSON/etc), being able to quickly hotswap to something like fx.

I'm of two minds about a config file. I personally try to make the binary as portable as possible while maintaining functionality, and without dropping small little files along the way. I think as long as llama pulls from a .llamarc during runtime, it'll solve that "hotswap" problem, with the compromise being an extra set of keystrokes to edit, but fewer hotkeys for the user to wrestle with.

antonmedv commented 2 years ago

Something else I was thinking: using Space key to show a dropdown (like context menu in Finder) with common options: Copy, Cut, Preview, Edit, Delete.

Only one key binding to remember - how to open the context menu.

habitualdev commented 2 years ago

Oh, I really like that idea. What I'll do then is rework/remake this PR to use a llamarc, then make a dropdown menu with spacebar, with those options you listed, and leave it nice and extendable in case more options are needed. How does that sound?

habitualdev commented 2 years ago

Ripped out "ctrl-e" and added .llamarc support. right now its just a simple extension:application format, but wanted to leave it open ended to what you think it should look like.

habitualdev commented 2 years ago

Closing as .llamarc integration is also in #11