-
-
Notifications
You must be signed in to change notification settings - Fork 577
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
Content is cut off with fzf#vim#with_preview #751
Comments
I got same behavior on Mac with vim8, did you find a fix yet @npearson72 ? |
@lan-nguyen91 afraid not. |
@junegunn, do you happen to know if vim default config hide stuff on preview window, right now the first 30 lines show on my set up, but as I scrolled, it is all blank. :( |
The behavior is intentional and is not configurable: https://github.com/junegunn/fzf.vim/blob/master/bin/preview.sh#L50-L54 For now, I suggest that you fork the repository and change it to your needs since I'm not planning to add more configuration options for the time being. |
@junegunn thanks for the direction, @npearson72 I followed June direction, and removed this condition |
Works like a charm. Thanks guys! |
Removing I ended up with these changes:
# if [ -z "$FZF_PREVIEW_COMMAND" ] && command -v bat > /dev/null; then
# bat --style=numbers --color=always --pager=never \
# --line-range=$FIRST:$LAST --highlight-line=$CENTER "$FILE"
# exit $?
# fi
DEFAULT_COMMAND="bat --style=numbers --color=always {} || highlight -O ansi -l {} || coderay {} || rougify {} || cat {}"
CMD=${FZF_PREVIEW_COMMAND:-$DEFAULT_COMMAND}
CMD=${CMD//{\}/$(printf %q "$FILE")}
eval "$CMD" 2> /dev/null | awk "NR >= $FIRST { \
if (NR == $CENTER) \
{ gsub(/\x1b[[0-9;]*m/, \"&$REVERSE\"); printf(\"$REVERSE%s\n$RESET\", \$0); } \
else printf(\"$RESET%s\n\", \$0); \
}" |
How do you scroll the preview pane? 🤔 |
Easiest way for me to hack around this was to set
@junegunn Why do we limit the file preview? |
Just use shift + down or shift +up, |
@Rodrigo-Barros the content is not all there though, it's cut off. Preview a large file and scroll, you'll see you only have a small subsection of the file, rather than all the contents. |
Do any of you know how I can keep the highlighted line in the preview in the middle by default. Right now, it always shows 5 lines above the highlighted line, which isn't helpful to get context before the highlighted line. #1092 has a screenshot with an example. Another question for you guys, I saw that Shift + Up/Down works great with scrolling, is it possible to rebind those keys ? Arrow keys are harder to reach (Would prefer something like Ctrl -j/k). Looking forward to hearing from you. Thanks in advance. |
@123subhadeep you can install bat it's an optional dependency that enables syntax highlight. This info available on manual. I don't know if there another way to rebind your keys. |
This allows you to scroll upwards Fix junegunn#1053 Fix junegunn#751 Fix junegunn#749
I'm using the following configs:
After invoking
Ctrl
+p
I'm presented with a list of my files with a preview window. However the lines of content in the preview is limited to ~19, when in actuality the files have more lines.The text was updated successfully, but these errors were encountered: