Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add ability to edit files i.e. with NVIM #42

Open
dwilliam62 opened this issue Mar 4, 2024 · 7 comments
Open

[Feature Request] Add ability to edit files i.e. with NVIM #42

dwilliam62 opened this issue Mar 4, 2024 · 7 comments

Comments

@dwilliam62
Copy link

I really like the look and remote capabilities. It may not be possible for remote connections, but for local files the ability to browse and do quick edits would be amazing

@juftin
Copy link
Owner

juftin commented Mar 4, 2024

This is coming! (eventually). I've had my eye on this feature for a while - that's why I recently refactored browsr to be more modular.

It wouldn't be NVIM - instead it's a textual (the underlying framework behind browsr) widget called TextArea.

It will improve the code viewing experience too as it supports things like text highlighting. It will even support (some) remote filesystems.

I'm specifically waiting on more languages to be supported by syntax highlighting for this (Textualize/textual#4160).

As far as the UX is concerned I was thinking about an E keyboard shortcut that launches you into editing mode in a new window. It'll probably be more similar to nano than vim - since that's what I know and I'd like it to be pretty simple.

@dwilliam62
Copy link
Author

dwilliam62 commented Mar 4, 2024 via email

@juftin
Copy link
Owner

juftin commented Mar 4, 2024

Fair enough, but figuring out how to implement NVIM/EMACS inside a Python process run by textual will likely be prohibitively difficult. I typically have to work with existing "widgets" that are already in the textual ecosystem, like the built-in TextArea.

Invoking NVIM/EMACs via a shell plugin (#44) is probably a cleaner path for this.

@dwilliam62
Copy link
Author

dwilliam62 commented Mar 4, 2024 via email

@davep
Copy link

davep commented Mar 7, 2024

Fair enough, but figuring out how to implement NVIM/EMACS inside a Python process run by textual will likely be prohibitively difficult.

@juftin Apologies for barging in, and perhaps I've misread this, but it should be pretty straightforward.

@juftin
Copy link
Owner

juftin commented Mar 7, 2024

@juftin Apologies for barging in, and perhaps I've misread this, but it should be pretty straightforward.

Thank you Dave - no need to apologies! I love having your textual knowledge on stuff like this. I actually stumbled on the concept of suspending the context manager after looking into this - this is an awesome solution to this. Ideally I'd be able to do this with the TextArea widget though so editing files would be supported on both local and remote filesystems (like editing an S3 file). Whether it's used for editing files or not, there is also a need to be able to run a local terminal session alongside browsr - I'm initially more inclined to use something like textual-terminal like this though.

@davep
Copy link

davep commented Mar 7, 2024

Sure thing, I thought it worth a mention just in case. Should be useful for those who prefer $EDITOR support (and as I'm sure you know, most who would likely have their editor set to support remote editing, so that might be worth keeping in mind -- see tramp in Emacs as an example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants