Git Product home page Git Product logo

fzf-obc's People

Contributors

rockandska avatar timurb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fzf-obc's Issues

(question) Is there a basic example for a custom completion function?

Hello,

I've been using https://github.com/lincheney/fzf-tab-completion/ but want to try fzf-obc as it supports completion post functions.

Is there a basic example to make a custom completion function work with fzf-obc?

Bash version: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)

_foo() {
  COMPREPLY=()
  local cur
  cur=$(_get_cword)
  local completions="10foo - first foo
11foo - second foo
12foo - third foo"
  local OLDIFS="$IFS"
  local IFS=$'\n'
  COMPREPLY=( $( compgen -W "$completions" -- "$cur" ) )
  IFS="$OLDIFS"
  if [[ ${#COMPREPLY[*]} -eq 1 ]]; then #Only one completion
    COMPREPLY=( ${COMPREPLY[0]%% - *} ) #Remove ' - ' and everything after
  fi
  return 0
} && complete -F _foo foo

After source'ing fzf-obc

source <path-to-fzf-obc>/fzf-obc.bash

When I press foo <tab-key>, I don't see the completions using the fzf-filter. I only see the default method of completion of bash.

complete -p foo returns complete -F __fzf_obc_wrapper__foo foo , so fzf-obc seems to be doing something but doesn't show the candidates in fzf.

However, when I use it one of the standard linux commands, e.g. ls -, then I see the ls options using the fzf window.

Am I missing an important step to make fzf-obc work with custom completion functions?

Thanks in advance.

pasting anis codes

I installed the latest fzf and fzf-obc from git

When I try to run the example ls /s[TAB] and choose any directory the ansi codes are pasted.

I have tried searching for solutions but have not found anything.

I am running

WSL Ububtu 20.04
fzf 0.27.2 (e086f0b)
fzf-obc fdfb34d

Gif below:

tiny

Items appear in reverse alphabetical order

OS: macOS 10.15.1

Something is wrong with the sort order of the results displayed by fzf-obc.

Without fzf-obc, ls /[TAB][TAB]:

.DS_Store         .vol/             System/           cores/            opt/              usr/              
.VolumeIcon.icns  Applications/     Users/            dev/              private/          var/              
.file             Library/          Volumes/          etc/              sbin/             
.fseventsd/       Network/          bin/              home/             tmp/              

With fzf-obc enabled:

$ ls /
>                                                                                                                              
  22/22                                                                                                                        
> Volumes/                                                                                                                     
  var/                                                                                                                         
  usr/                                                                                                                         
  Users/                                                                                                                       
  tmp/                                                                                                                         
  System/                                                                                                                      
  sbin/                                                                                                                        
  private/                                                                                                                     
  opt/                                                                                                                         
  Network/                                                                                                                     
  Library/                                                                                                                     
  home/                                                                                                                        
  etc/

Note that the order of the result is reverse alphabetic, and case seems to be ignored.
Original sort order is alphabetic, with all uppercase letters before all lowercase ones.

(question) help with bindings.

Thank you, this is amazing!
I have tried to configure bindings as shown via the wiki page but have been unsuccessful.
Most importantly:

  • I would like 'tab' to cycle through the entries just like normal bash does instead of its current behaviour (nothing or toggling multiple selections), if not can it be mapped as 'down' instead?

Also:

  • Can D-pad 'left' & 'right' be mapped? I'd love to map the to 'up' & 'down'.
  • Can 'control' be mapped?
  • Have 'multiple' & 'recursive' selections shown as default without * or ** before tab?

Thank you again, its really appreciated! amazing work!!

Pathname completion opens fzf when not needed

My ~/.config contains only a few things, and fzf-obc is the only item starting with f.

Type cd ~/.config/f
Expected: completes to cd ~/.config/fzf-obc/ (default bash completion does so)
Actual: fzf is triggered, displaying 2/2 results, one is fzf-obc/, one is an empty line (selecting that results in cd ~/.config/f/ which does not exist)

Same issue when trying to ls ~/.bashr (expected .bashrc, actual 2/2 results, one is .bashrc, one is an empty line - selecting that one results in ~/.bashr/).

macOS, bash 5.0.11 from homebrew, latest git version of fzf-obc (1.3.0)

fzf keybinding doesn't work

With plain fzf integration I can hit Ctrl-R and search history with fzf.
With fzf-obc the standard "reverse-i-search" is used.

This probably can be fixed by simply sourcing /usr/local/opt/fzf/shell/key-bindings.bash as it was previously done in ~/.fzf.bash

Error message on macOS

I've installed this per the instructions, but attempting to use tab completion results in this error being printed:
bash: /proc/cpuinfo: No such file or directory

There is no /proc on macOS.

The completion itself seems to be working, although with the annoying error message on every attempt to use it, I didn't do any extensive testing.

Difficult to use fzf-obc with gradle

I was trying to use gradle with fzf-obc, but it turns out to be not so convenient due to gradle completion list containing task descriptions, not just their names. As a result, both name and description end up on the command line, which is undesirable.

To test, install gradle (I have version 6.0), gradle-completion, and for testing purposes create a new directory and create a build.gradle file there, with contents from this gist, for example.
Type gradle <TAB> (with fzf-obc activated), and the completion list is shown. It takes several seconds when done for the first time, after that it will work instantaneous as gradle-completion has a cache.

Here's an example item from the completion list:
wrapper - Generates Gradle wrapper files.
If it's selected, the whole thing is appended to the command line, while it would be desirable to have only wrapper on the command line.
If it would be possible to be able to specify some post-processing step for a particular completion command, a function could be set up that strips the whitespace, the dash and the description.
Maybe it's already a feature? Or could be a new feature request. Or maybe you have better ideas?

Thanks for looking into it!

Dot files not sorted

default.cfg:

std_sort_opts='-V'
std_filedir_hidden_first='0'

Dot files are shown after regular files, as expected.
Regular files are sorted as expected.
Dot files, however, appear to be unsorted.

Screenshot:
Screenshot 2020-01-23 at 16 13 00

leading backslash

I noticed this as I sometimes use backslash to override aliases

$ \cd <tab>
$ \cd ^[\[01\;34m/usr/^[\[0m

note that mv \x <tab> works as expected
so it seems the issue is when backslash is the first non-blank character

readline's completion-ignore-case

it would be nice if case-insensitive matching were automatically enabled
when the readline option completion-ignore-case is on

maybe useful to consider other readline options too

No license found

This project does not seem to have a license declared in an obvious way, or at all. A license should be added (as this project seems to be intended as open source) so that users can run, modify, study, distribute, and use the code.

https://choosealicense.com/no-permission/

Add prerequisites step for MacOS

MacOS has a bit different flavor of coreutils and currently fzf-obc doesn't work on MacOS.
On MacOS there are the following incompatibilities with modern linux distributions:

  • sed doesn't support -r (I think -E is used instead) and -z options
  • head -n -1 syntax is not supported. head -n 1 works fine (don't know if in intended way or not)
  • cut doesn't support -z option
  • shopt globstar is not supported out of the box

Probably a few more options could be unsupported โ€” I gave up at this point.

I'm using MacOS 10.14.6 Mojave and tried to select tag 1.2.0 for installation.

async recursive lookup

I don't suppose there is some way to make recursive completion async (like vanilla fzf)?

Single tab triggers completion rather than double tab

Perhaps this is by design, in which case would be nice to hear the motivation behind that. It is mentioned in the README that the hotkey is .
When not using fzf-obc, one is used to complete the currently typed text, while a shows the whole list of available completions. With fzf-obc, habitually typing ls /<TAB><TAB> results in the completion list showing due to the first , and then the first item in the list being selected due to the second one. Of course a user can re-train their behavior if necessary, but I wonder if that is useful, perhaps it would be better to keep the traditional way?

fix tar completion

tar, on the first load reset the tar completion script
so on first keystroke, the completion happen normally but fail the second time until a new script call completion loader

Case insensitive completion does not work

$ ls -al
total 8
drwx------  2 mrich mrich 4096 Sep 17 22:19 .
drwxrwxrwt 32 root  root  4096 Sep 17 22:19 ..
-rw-rw-r--  1 mrich mrich    0 Sep 17 22:19 TEST

$ less t<TAB>

Nothing happens after pressing TAB. I have completion-ignore-case On, so I would expect it to show TEST. Since fzf-obc does not automatically pick up completion-ignore-case as per #29 I tried your suggestion of std_fzf_opts+=' +i' but that didn't help either.

GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Add support for readline completion

Thank you for you this amazing tool!

Addition of readline completion would allow for an even more pleasant experience.
fzf-tab-completion (https://github.com/lincheney/fzf-tab-completion) is a great tool, but lacks the customizablility fzf-obc provides. However it has readline completion which is very useful.

If possible, please consider adding similar functionality to fzf-obc.

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.