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
Improvements to switch-buffer
: tagged buffers; and better interaction with buffers when the prompt is open: keybinding to switch to/from prompt to buffer
#1654
Comments
Lots of great ideas here! :) Technically nothing seems to be very difficult, but first we must
That the mouse enables focus is actually an not well defined behaviour The first two points are actually the same thing: we need to be able to We could also anticipate window manager and support multiple main Suggestion: We need a (or (current-prompt-buffer)
(active-buffer sender)) we would just cal
Already listed in atlas-engineer/prompter#32.
We've discussed buffer groups in the past, tags are probably a better
It's possible by defining a custom prompt and setting We would need a more systematic approach, for instance a default filter But I'm also wondering if regexps are the right approach. There are Could we do better with a more graphical and interactive approach? Like
Can you expand?
What about using another Nyxt window for this kind of things? In #178 we discuss how to |
As someone who doesn't understand anything in regex, I couldn't agree more. I was just thinking it might be good if regex was supported so that advanced users can define complex rules in their config, but was hoping some shortcuts would be implemented as well so that the filter function can actually be used on the fly too without going into complex syntaxes. In the end, perhaps only a very small fraction of users would use regex anyway, so simple rules might be enough. Maybe something similar to what search engines usually offer would work, like
What I had in mind was a way to automatically append a string to the input field of
This would work for some users, but other users tend to have a strict view on whether they should keep concurrent windows for their web browser. I'm not saying I can explain why with relevant arguments, but I certainly can say I belong to that group. I suppose this would use more resources, may pose some challenges to restore multiple sessions, and most importantly, having several windows of the same application can be annoying in tiling window managers. For instance if you have a rule that moves your web browser to a given workspace, having two or three windows for the browser will tile them on that workspace. You can of course use a tabbed or stacked view of the windows with some WMs, and users of tiling WM would probably know how to do it, but this will eat some space in most cases by adding a tab bar to the windows. |
I believe special syntaxes are used interactively mostly for the following operations:
Anything else? Regexps are actually not very useful for "does not contain". So either we go with our own special syntax, like For instance, we could have multiple prompt buffer inputs:
This you can easily do by writing a custom command which takes the suffix as Let me know if you want a concrete example. Of course it would solve your problem only in a clunky way.
Not really, it's the same Nyxt process and the same WebKit processes.
should not be a problem either, session persistence is independent of windows. |
I can see how an interactive interface with consecutive prompt inputs would help learning, but I assume most Nyxt user would rather just use operators to directly type what they want in one go. This is what most web applications offer too: one text field where you can use things like
I was confident this would be doable with
Good to know!
That's good news! However my personal use case would very probably still be to use only one window as much as possible, and probably reconsider what I am doing if it requires multiple windows and window manipulation. But |
What I dislike with this approach is that computer users got to learn a new syntax for Ideally I'd like to offer an unambiguous, trivially accessible and Another option would be to have buttons or actions in a menu to insert I'd also love to stick to a Lispy syntax:
In the past (Nyxt 1.5) we had Lispy bookmark filtering, like so (or (and foo bar) (and qux baz)) I'd love to re-introduce it in a generalized way. With some smart input, the about can be really fast and we can enable
Sure, I can totally see how buffer tags have their use. |
Something along these lines (untested): (define-command switch-buffer-suffix (&key id (current-is-last-p nil) suffix)
"Switch the active buffer in the current window.
Buffers are ordered by last access.
With CURRENT-IS-LAST-P, the current buffer is listed last so as to list the
second latest buffer first."
(if id
(set-current-buffer (buffers-get id))
(prompt
:prompt "Switch to buffer"
:input suffix
:sources (list (make-instance 'user-buffer-source
:constructor (buffer-initial-suggestions
:current-is-last-p current-is-last-p))))))
Then you can bind a key to (make-command switch-buffer-FOO ()
(switch-buffer :suffix "foo")) and the resulting command will have "foo" pre-inserted in the prompt. Is this what you want? |
Awesome. That's exactly what I was looking for, yes! Then I can see that becoming even more useful when web-buffers can be interacted with while the prompto is expanded (text input, following links with the mouse, etc.) in the future or when/if tags can be automatically assigned to domains. I had to add
|
That makes perfect sense. I am not familiar with Lisp at all (as you noticed, I'm sure) which is probably why I didn't even think about it for filters, and I was thinking about keeping the number of keystrokes as low as possible, pretty much like what some search engines use (combination of Just keeping the number of keystrokes low is important in my opinion, so that people can realistically use the filter from their prompt and not only from predefined commands in their configuration. I am not a big fan of multiple steps in the prompt if it can be done in one line, but you are right that it would help discovering/learning/mastering the feature. Autocompletion and buttons as you suggested might be a great solution to all this, but I suspect it would be a lot of work for something maybe just a fraction of users would use on a regular basis? I don't want to distract you guys from more important things.
Of course! Keep in mind that my skills are very limited though. You are lucky you are not on IRC to see all the silly questions I ask to aartaka and jmercouris every so often. I am happy to test anything though, including broken things, and hopefully by the time this is on the short-term to-do list, I will be able to write a couple simple commands in common lisp and really help. |
Sorry, I mistyped the example, should obviously be |
That fixed the warning but
|
We could keep the number of keystrokes minimal by auto-inserting Lispy snippets.
|
About your warning: can you show me the whole code? |
I pushed the whole config here (the command is defined in
Nyxt doesn't start until I remove the keybinding that broke GTK. |
You misunderstood, you must More specifically, (define-key *my-keymap* "C-x C-b" (make-command ...)) |
You should use |
Then I might have other issues because I get warnings with I'm also struggling with adding the key to my other custom bindings even if I directly embed |
I would like to bring attention to column ordering, where a good example that I wish the order to be changed is switch buffer, where I think title before url, instead of url at first column to allow better visibility, personally at the very least. Is there a way to configure this? |
We don't have a way to change ordering, only to toggle columns. I wonder how we might extend the prompt buffer to support ordering. |
It would be nice if the user could drag-and-drop the columns, thus
providing a familiar user experience.
Another key aspect is that current the first column is special in the
sense that it is cannot be hidden, plus it is used for things like
copying and pasting.
If we are to reorder columns, we would need to visually and
programmatically mark the "key column".
|
switch-buffer
(and better interaction with buffers when the prompt is open)switch-buffer
(and better interaction with buffers when the prompt is open)
switch-buffer
(and better interaction with buffers when the prompt is open)switch-buffer
: tagged buffers; and better interaction with buffers when the prompt is open: keybinding to switch to/from prompt to buffer
switch-buffer
with the power of fuzzy search is one of the great features Nyxt offers. One thing I love about it is it can live-preview buffers (provided they have been loaded, else it will load them first) and then cycling through the preview of each buffer is very fast.However, unless the buffer selection is confirmed with
Return
and the prompt is closed (which implies losing any keyword filtering, and also implies extra keystrokes as well as some UI delays), one cannot interact much in the previewed tabs: scrolling works, but text input and clicking on hyperlinks are not possible. Yet, there are multiple cases where one would be interested in interacting with buffers without closing the prompt, particularly when switching buffers frequently to just peek at them or copy/paste stuff from one buffer to a text field of another one, or when filtering the buffer list with a search in the prompt input.The video below doesn't show much, every Nyxt user already knows about the power of fuzzy search in the
switch-buffer
view. I recorded it just to illustrate a simple case with buffers opened on git-related stuff and on work-related stuff. Keeping the prompt open could be convenient for a user ready to sacrifice some vertical space, if full interaction was possible when the prompt is open. For instance I could cycle through git buffers only, or work buffers only, and keep a clean view of my dynamic buffer list without compromising the browsing experience.Possible improvements could be:
I
andN
indicators, or a modeswitch-buffer
list (I tried at 0'18" but eventually used the keyboard, sometimes the mouse is convenient too for lazy browsing)screenrecorder-2021-07-23_10.59.01.mp4
I think there would be a wide range of uses for this. And also more specific ones: with tags, I could even filter my buffers with "work" if I have to discuss something with my boss in front of my computer and don't them to see that I also have 10 tabs open on puppies and cats of the Internet. Of course I could also temporarily reduce unwanted buffers, but the use case is not exactly the same and I couldn't hide those tags in just a keybinding, while I could define commands or macros to switch-buffers on a certain keyword with just a keystroke.
The text was updated successfully, but these errors were encountered: