-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Long commands aren't horizontally scrollable #577
Comments
If you start matching on the right, (in your example, by typing "component"), you can view more (but there is no way to bind a key to scroll to the right for you) |
@edi9999 Thanks for chiming in.
Yes that's what I would do. A large But anyway I don't have a great answer to this. Adding support for manual horizontal scrolling is the last thing I want to do as getting it right and implementing a clean, straightforward interface is not going to be trivial (manual scroll vs. auto scroll, short item vs. long item) When the above trick doesn't work you, you might want to fall back to the original "reverse-search-history" that can display the command in multiple lines by binding it to a different key sequence (e.g. Closing as "wontfix" (at least for the moment). Thanks. |
No problem. Thanks for the feedback everyone :-) |
With the latest fzf, we have these options: # always-visible preview window that shows full command
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:2"
# hidden by default, made visible on `?`
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden --bind ?:toggle-preview" |
Thanks for sharing @junegunn. When I tried those options, the command was truncated to the window width, so it didn't provide much value. From some searching it looks like behaviour has changed since you posted your tip. For anyone looking to do this now, I updated my export FZF_CTRL_R_OPTS="--preview 'echo {} |sed -e \"s/^ *\([0-9]*\) *//\" -e \"s/.\\{\$COLUMNS\\}/&\\n/g\"' --preview-window down:3:hidden --bind ?:toggle-preview" It's the preview window example given above, but it will wrap the command. If you want some fancy looking line wrap indicator, try this one: export FZF_CTRL_R_OPTS="--preview 'echo {} |sed -e \"s/^ *\([0-9]*\) *//\" -e \"s/^\\(.\\{,\$COLUMNS\\}\\).*$/\\1/\"; echo {} |sed -e \"s/^ *[0-9]* *//\" -e \"s/^.\\{,\$COLUMNS\\}//g\" -e \"s/.\\{1,\$((COLUMNS-2))\\}/⏎ &\\n/g\"' --preview-window down:5 --bind ?:toggle-preview"``` |
Hmm I would like to understand how The following example result the same
|
turns out there was a new line after foobar in example above
works |
This makes it possible to see multiple lines of a multi-line command with the C-r keybinding when using `FZF_CTRL_R_OPTS` to provide a multi-line preview window, as done in junegunn#577 (comment).
@markmcd check the 'fold' command, it does wrapping and also handles breaking at words |
This feature needs to be implemented. There are so many use cases that are craving for this functionality. |
I can't seem to be able to scroll horizontally along any results that are longer that my terminal screen. The example image above shows many different
curl
requests that look the same, but in fact point to different URLs so it's impossible to know which one I want.The text was updated successfully, but these errors were encountered: