Giter Club home page Giter Club logo

Comments (6)

junegunn avatar junegunn commented on May 27, 2024 1

Also, why do I get `__fzf_cd__` when I use Alt+c? I don't get `__fzf_history__` when I use Ctrl+r or nvim ** <tab>.
Is it intentional?

That's because ALT-C uses a different mechanism than the others. No -x option.

fzf/shell/key-bindings.bash

Lines 126 to 144 in 7bac1a7

# CTRL-T - Paste the selected file path into the command line
if [[ "${FZF_CTRL_T_COMMAND-x}" != "" ]]; then
bind -m emacs-standard -x '"\C-t": fzf-file-widget'
bind -m vi-command -x '"\C-t": fzf-file-widget'
bind -m vi-insert -x '"\C-t": fzf-file-widget'
fi
# CTRL-R - Paste the selected command from history into the command line
bind -m emacs-standard -x '"\C-r": __fzf_history__'
bind -m vi-command -x '"\C-r": __fzf_history__'
bind -m vi-insert -x '"\C-r": __fzf_history__'
fi
# ALT-C - cd into the selected directory
if [[ "${FZF_ALT_C_COMMAND-x}" != "" ]]; then
bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"'
bind -m vi-command '"\ec": "\C-z\ec\C-z"'
bind -m vi-insert '"\ec": "\C-z\ec\C-z"'
fi

The reason we decided to use this method (only for ALT-C) can be found here: #2674 (and an older one: #546 (comment))

I have no experience with starship, so I'm currently unaware of how you can work around the issue.

from fzf.

Drllap avatar Drllap commented on May 27, 2024

Note that if I execute after leaving the vi-insert-mode the "correct" thing is executed (the prompt arrow doesn't affect it) so this is only a minor visual glitch

from fzf.

Drllap avatar Drllap commented on May 27, 2024

Also, why do I get `__fzf_cd__` when I use Alt+c? I don't get `__fzf_history__` when I use Ctrl+r or nvim ** <tab>.
Is it intentional?

from fzf.

tmpm697 avatar tmpm697 commented on May 27, 2024

this is probably how u play with fzf, i got this issue before, but it does not appear now.

from fzf.

Drllap avatar Drllap commented on May 27, 2024

@tmpm697 I'm not entirely sure what you mean by "how you play with fzf"

I'm just using the default keybindings. The only thing I have in my .bashrc

eval "$(fzf --bash)"
eval "$(starship init bash)"

from fzf.

Drllap avatar Drllap commented on May 27, 2024

Ok, I narrowed it down a bit. This is pretty much what starship does when I have deleted most of the things that aren't relevant to my issue:

function set_PS1 {
  PS1="something cool
\[�[1;38;2;152;151;26m\]\[�[0m\] "
}

precmd_functions+=(set_PS1)

Edit: Ok github doesn't render all of the "characters" in the file so here is the file:
test-bashrc.txt

from fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.