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

Names garbled when using neovim master #1644

Closed
3 of 15 tasks
neevparikh opened this issue Jul 22, 2019 · 2 comments
Closed
3 of 15 tasks

Names garbled when using neovim master #1644

neevparikh opened this issue Jul 22, 2019 · 2 comments
Labels

Comments

@neevparikh
Copy link

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Windows Subsystem for Linux
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Directory names and file names appear garbled when using neovim master with FZF (floating window or not)

fzf

Any fix on the fzf side or is it a neovim issue?

@junegunn
Copy link
Owner

Looks like an issue of your $FZF_DEFAULT_COMMAND. fzf doesn't parse ANSI color codes when not explicitly requested via --ansi for performance reasons.

@victoriastuart
Copy link

victoriastuart commented Aug 5, 2019

"When selecting files with fzf, we show file content with syntax highlighting, or without highlighting if it's not a source file. If the file is a directory, we use tree to show the directory's contents. We only load the first 200 lines of the file which enables fast previews of large text files. Requires highlight and tree: pacman -S highlight tree"

"--ansi tells fzf to extract and parse ANSI color codes in the input and it makes the initial scanning slower. So it's not recommended that you add it to your $FZF_DEFAULT_OPTS."

Try this:

export FZF_DEFAULT_OPTS="--ansi --preview '(highlight -O ansi -l {} 2>/dev/null || cat {} || tree -C {}) 2>/dev/null | head -200'"

... note the --ansi before --preview ...


Selection_999(2434)

export FZF_DEFAULT_OPTS="--preview '(highlight -O ansi {} 2>/dev/null || cat {} || tree -C {}) 2>/dev/null | head -200'"

victoria@victoria:-mnt-Vancouver-programming-scripts_999

export FZF_DEFAULT_OPTS="--ansi --preview '(highlight -O ansi {} 2>/dev/null || cat {} || tree -C {}) 2>/dev/null | head -200'"

victoria@victoria:-mnt-Vancouver-programming-scripts_999(001)

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

No branches or pull requests

3 participants