Hi all,

I frequently use fzf for quickly finding files in projects like

  $ emacsclient (fzf --options...)
  
I would like to make that a bit easier to type.  Ideally, I'd like to
have a keybinding which would just insert '(fzf --options...)' at the
current position in the command line editor.  But I can't get that
working.

As a very simple test case not requiring fzf, I tried this:

  function insert_hello
      echo -n "Hello"
  end
  bind \co insert_hello
  
When I now type

  echo ^o
  
in the command line editor, it actually reads correct, i.e., "echo
Hello".  However, if I confirm with RET, echo echos just an empty line.
The output of insert_hello is not used.

And when I just type ^o at a fresh line, the line reads Hello and the
cursor is at its right end.  But I also cannot move leftwards.  It seems
as if the Hello is kind of a part of the prompt...

So what am I doing wrong?

Instead of a keybinding, I also tried defining an abbr __ for '(fzf
--options...)'  but here the problem is that abbrevs expand only when
they start a command, not when they are in the end or middle of a
command.

And while we are at the command line editor: is there no "command insert
mode" where I could check out which editor commands are there and how
they are named by tab-completing, e.g., what ZSH has bound to M-x.

Thanks,
Tassilo



_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to