profile
viewpoint
Aloxaf Aloxaf BIT Beijing, China https://www.aloxaf.com coder, ingresser, student

Aloxaf/fzf-tab 541

Replace zsh's default completion selection menu with fzf!

Aloxaf/dotfiles 19

my dotfiles

Aloxaf/exloli 19

从 E 站抓取画(ben)廊(zi)并上传 telegraph 并转发至 telegram channel

Aloxaf/CAPIx 8

使CMD能够高速调用API

Aloxaf/10_0_0_55_login 7

BIT 10.0.0.55 的登入与登出的Python实现

Aloxaf/Crypko.Spider 5

(目前是)一次性的Crypko小爬虫

Aloxaf/aur-build 3

Build AUR packages with GitHub Actions

Aloxaf/GCD-1 2

综合性批处理游戏开发第三方

Aloxaf/gencomp 2

Generate zsh completion functions from manpage or `--help`

delete branch Aloxaf/fzf-tab

delete branch : more_c

delete time in 10 minutes

push eventAloxaf/fzf-tab

Aloxaf

commit sha 0f5622a64b273d203046b570e76ba5baef84be58

refactor: port more shell code to C (#136)

view details

push time in 10 minutes

PR merged Aloxaf/fzf-tab

refactor: port more shell code to C
+375 -185

0 comment

5 changed files

Aloxaf

pr closed time in 10 minutes

push eventAloxaf/fzf-tab

Aloxaf

commit sha be3a325a37fe2991631088bef8121fb9828060af

fix: use after free

view details

push time in 18 minutes

issue commentromkatv/zsh4humans

Feedback

Yes, there are many pitfalls with tmux, for example, in the chkservice 0.3 program, scrolling with the mouse does not work. :(

Just add the following lines to your tmux.conf:

bind -n WheelUpPane send-keys up
bind -n WheelDownPane send-keys down

Another problem with colors, using tmux:

I cannot reproduce this...

maximbaz

comment created time in 2 hours

pull request commentAloxaf/fzf-tab

Improve completion descriptions

How can I do that ? it seems that the colors are getting escaped when I try to insert some inside the completion

You need to use $'\033[0m'

adelin-b

comment created time in 2 hours

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

@delucca have you updated to the latest master?

delucca

comment created time in 2 hours

push eventAloxaf/fzf-tab

Aloxaf

commit sha 9258a88381755f842bc7287755acf86bba97b302

fix(preview): sometimes there is no group See #134

view details

Aloxaf

commit sha 7888fd3769288cf356312a3c118b55e42488b6bc

Merge branch 'master' into more_c

view details

push time in 2 hours

issue commentAloxaf/fzf-tab

[BUG] fzf-tmux popup in 3.3 tmux next

I already exec zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup but whenever I tab nothing happens until I ctrl-c again. I think it works but the pop-up not showing up.

Did you start tmux?See https://github.com/Aloxaf/fzf-tab/issues/135#issuecomment-716702075

jeeeem

comment created time in 11 hours

issue commentAloxaf/fzf-tab

[BUG] fzf-tmux popup in 3.3 tmux next

I tried tmux-popup with fzf-tab but its not working.

Make sure you have set zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup

Do I really need to install 3.2 to make it work? but from what I read it has been merged to master.

Yes it has been merged to master, but tmux hasn't released the new version so you have to use tmux-git.

jeeeem

comment created time in 12 hours

issue commentAloxaf/fzf-tab

[BUG] Breaks "cd +"

How about add this line to your zshrc

zstyle ":fzf-tab:complete:cd:*" query-string
laggardkernel

comment created time in 13 hours

push eventAloxaf/fzf-tab

Aloxaf

commit sha 14d02c2b1112908a75dc9672cd5952758fdda331

fix: binary module can add color for file/dir now

view details

push time in 13 hours

PR closed tikv/tikv

copr: Add vectorize GreatestInt and LeastInt contribution sig/coprocessor status/waiting

Signed-off-by: Aloxaf aloxafx@gmail.com

PCP #5751 <!-- Thank you for contributing to TiKV!

If you haven't already, please read TiKV's CONTRIBUTING document.

If you're unsure about anything, just ask; somebody should be along to answer within a day or two. -->

What have you changed?

Add vectorize greatest_int and least_int

What is the type of the changes?

  • Improvement (a change which is an improvement to an existing feature)

How is the PR tested?

  • Unit test
  • Integration test

Does this PR affect documentation (docs) or should it be mentioned in the release notes?

No

Does this PR affect tidb-ansible?

No

+3 -0

16 comments

2 changed files

Aloxaf

pr closed time in 15 hours

pull request commenttikv/tikv

copr: Add vectorize GreatestInt and LeastInt

It seems that this part is already finished in the master branch.

I think this PR can be closed now.

Aloxaf

comment created time in 15 hours

push eventAloxaf/tikv

Rustin

commit sha bc540b10e09e973e85846c6db365ae42d0baa9ba

tikv_util: refine some slog relate code (#6988) Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

view details

pingcap-github-bot

commit sha 0af3ae2d6bafac516a034e992274dda95ffe4aac

Move WriteBatch from engine to engine_traits/rocks (#6697) Signed-off-by: Brian Anderson <andersrb@gmail.com>

view details

pingcap-github-bot

commit sha 63e42a9226af874f628ab3f5c8f2c462b3cdf6a7

Parameterize much of raftstore over engines (#6707) Signed-off-by: Brian Anderson <andersrb@gmail.com>

view details

Calvin Weng

commit sha ccf831e445eb2dc7a3c072e9a200d878af57b9b1

Add security audit report (#6997) * Add security audit report Signed-off-by: Calvin Weng <wenghao@pingcap.com>

view details

pingcap-github-bot

commit sha 23a1797dbf6350fa6d888acec6b0cab72914925e

copr: add vectorized char_length (#7010) Signed-off-by: zhongzc <zhongzc_arch@outlook.com>

view details

lysu

commit sha 649e038fe4049f275401ecc6c52a429ee174a290

txn: check keys must be not exists (#6715) Signed-off-by: lysu <sulifx@gmail.com>

view details

NingLin-P

commit sha f050c2e85f5e410f2aff11897ba43e61871c9632

config: enable dynamic config by default (#7015) Signed-off-by: linning <linningde25@gmail.com>

view details

pingcap-github-bot

commit sha a095c7081e8dc9b6c16604425d9aca9e6f4e1224

rust-rocksdb: Revert "implemented !Send for PerfContext struct (#442)" (#7013) Signed-off-by: sre-bot <sre-bot@pingcap.com>

view details

Jay

commit sha 5c573c661c2e736d513168fe5d3966f5fd467d70

*: speed up test build (#7012) Tests has been built slowly lately. That's because we use multiple compile command to build tests for different crates. Things go worse when cdc is split as a component. On my local machine, running `make test`, cargo will be invoked 6 times. 4 of them takes minutes to finish. The reason why we try to run multiple compile command is to get around the problem mentioned in #6097, which is introduced when trying to support prost and protobuf in tests at the same time. But in practice, we don't run tests with prost. Hence overhead is introduced with just potential benefit. In fact, after #6317, it's impossible to run tests by `PROST=1 make test` due to rust-lang/cargo#6669. It's still possible to build, clippy check or release with prost. Given that tests with PROST=1 does not work, this PR combines all the cargo commands into single one, which save a lot of compile time. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>

view details

5kbpers

commit sha 83cbf52466671789048026ef448ee9c4b379c350

cdc: check failpoints feature for failpoint tests (#7018) Signed-off-by: 5kbpers <tangminghua@pingcap.com>

view details

Rustin

commit sha cedcc8c3efc082545d7355ad73c598789891a3c5

*: remove CompactionJobInfo re-exports (#6989) Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

view details

qupeng

commit sha 7bf9c2da127b5ae7de27a3425bf5f255671982d8

allow to custom quorum fn (#6578) Signed-off-by: qupeng <qupeng@pingcap.com> Co-authored-by: gengliqi <gengliqiii@gmail.com>

view details

Yilin Chen

commit sha 274ca86f863361f7d3d8ee8491496c6a80c79ae4

cop: move the logic of limiting heavy tasks out of runner (#6699) Signed-off-by: Yilin Chen <sticnarf@gmail.com>

view details

Fullstop000

commit sha cc424374af5c50246d4f1e0cb282f63540beb1b9

utils: Use an extra drainer for slow logs (#6986) * use a extra drainer for slow log Signed-off-by: Fulstop000 <fullstop1005@gmail.com> * improve test_serde_custom_tikv_config Signed-off-by: Fullstop000 <fullstop1005@gmail.com> * add slow_log_threshold Signed-off-by: Fulstop000 <fullstop1005@gmail.com> * use Instant instead unnecessary SlowTimer Signed-off-by: Fulstop000 <fullstop1005@gmail.com> * some improvements Signed-off-by: Fullstop000 <fullstop1005@gmail.com> * fix ci Signed-off-by: Fullstop000 <fullstop1005@gmail.com> * use custom Value serializer Signed-off-by: Fullstop000 <fullstop1005@gmail.com> * fix compiling err Signed-off-by: Fullstop000 <fullstop1005@gmail.com> Co-authored-by: Neil Shen <overvenus@gmail.com>

view details

Zhang Yuning

commit sha 10b92099c5956144025b68f44795b78210b15d89

copr: Add non-vectorized repeat (#5885) Signed-off-by: Yuning Zhang <codeworm96@outlook.com> Co-authored-by: NingLin-P <linningde25@gmail.com>

view details

Rustin

commit sha 658f2cde80778cae8ef90be993059059feded345

tikv_alloc: remove unwrap and refine README.md (#7034) Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

view details

mahjonp

commit sha e176677fde08d94c444de9e90f3cd3eaa3ed3617

Update coverage badge (#7037) Signed-off-by: mahjonp <junpeng.man@gmail.com>

view details

zhangjinpeng1987

commit sha 5d26636a5185f1ae2b986ed407861e43c971b742

Contribution.md: add contribution map icon and link (#7041)

view details

Wallace

commit sha bd296e5b17b9ea75db330557e1e5173930b17d51

fix failed test by `reserve space` (#7030) Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>

view details

Jay

commit sha 1ebd3e2178bcea0543bb356d80e521bc1bc44782

tests: add custom runner (#7044) - Always write logs for tests - Fix hang when panic during failpoint pause - Simplify failpoint test setup Signed-off-by: Jay Lee <BusyJayLee@gmail.com>

view details

push time in 15 hours

fork Aloxaf/skim

Fuzzy Finder in rust!

fork in 16 hours

push eventAloxaf/fzf-tab

Aloxaf

commit sha 080632bcd3f7f9ac72bbf6e4fc1fb75ea1174da2

fix: check if fzf-tab-compcap-generate exists

view details

push time in a day

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

@delucca Oh, it's bug that I haven't noticed before!

Please try this again:

zstyle ':fzf-tab:complete:*' fzf-preview '
echo word: $word
echo description: $desc
(( $+ctxt[group] )) && echo group: $group
(( $+ctxt[isfile] )) && echo path: $realpath
'
delucca

comment created time in a day

push eventAloxaf/fzf-tab

Aloxaf

commit sha 9258a88381755f842bc7287755acf86bba97b302

fix(preview): sometimes there is no group See #134

view details

push time in a day

issue commentAloxaf/fzf-tab

file-sort by access/modification time not working

@mxmilkiib You should also specify the file sort: zstyle ':completion:*' file-sort access

And make sure you're using ls not something like exa.

tastytea

comment created time in a day

issue commentAloxaf/fzf-tab

Not worked popup

No, it's not a standalone tool to provide popup, it's a terminal emulator. So you must run your shell in it.

webmastak

comment created time in a day

push eventAloxaf/fzf-tab

Aloxaf

commit sha b6633227fdf4e4bcc62054cc19fbd6ec43084cc9

fix(fzf): custom key bindings

view details

Aloxaf

commit sha da952d141de497faa842d0b52b862d7f8be54023

test: add test for binary module (#138)

view details

Aloxaf

commit sha dc99949b6a48837ef81bf68bcf790d9651cb616f

Merge branch 'master' into more_c

view details

push time in 2 days

delete branch Aloxaf/fzf-tab

delete branch : test_module

delete time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha da952d141de497faa842d0b52b862d7f8be54023

test: add test for binary module (#138)

view details

push time in 2 days

PR merged Aloxaf/fzf-tab

test: add test for binary module
+32 -24

0 comment

2 changed files

Aloxaf

pr closed time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 0bd047d117b74300cf112d4fb4b1d908343b6874

test: add test for binary module

view details

push time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 58eb17feb31c1464b89ab0918f3c05ad2d6ba185

test: add test for binary module

view details

push time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha def06d80a60cbc0098cc0b845ae0410afd13b28a

test: add test for binary module

view details

push time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha bddb061139604ab7c58baac66d03fffe424fd8c8

test: add test for binary module

view details

push time in 2 days

PR opened Aloxaf/fzf-tab

test: add test for binary module
+10 -7

0 comment

1 changed file

pr created time in 2 days

create barnchAloxaf/fzf-tab

branch : test_module

created branch time in 2 days

issue commentromkatv/zsh4humans

Feedback

@pkazmier I think you just haven't tried it. z4h doesn't use a full tmux. It's a patched version which has no other features except popup. You can't even feel the existence of tmux.

maximbaz

comment created time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 1971b6ae5aed4868611eda509eb2ed047f3bf9ae

fix(module): memory leak

view details

push time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

Then you must take a look at https://github.com/romkatv/zsh4humans/issues/35#issuecomment-716172250.

@romkatv creates a custom tmux that can use popup but doesn't need to tolerate other drawbacks of tmux.

I think I can also add it as a way to use popup for those who don't like tmux when the feature is finally stablized.

webmastak

comment created time in 2 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 109b86b79255e6a75a4a6e4615c08ff3589c1672

fix(fzf): failed to read /dev/tty

view details

push time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

Colors differ. When the window pops up, the selection bar is black. How to make it the same color as without the popup.

I don't know how fzf-tab choose the color of current line. But you can specify it explicitly with zstyle ":fzf-tab:*" fzf-flags '--color=bg+:23'

And I also didn't understand how to enable scrolling as in the terminal using Shift+PageUp/PageDown and Shift+Home/End

You should first enter copy mode with C-b [. Then you can use PageUp/PageDown.

As for Home/End, you should bind it manually. Put these lines to you ~/.tmux.conf

bind-key -T copy-mode 'Home' send-keys -X history-top
bind-key -T copy-mode 'End' send-keys -X history-bottom
webmastak

comment created time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

I can not figure out how to properly start the tmux server?

Just type tmux and press enter. It's something like a terminal emulator which will wrap you shell.

You can also put this line to your ~/.zshrc to start it automatically:

[[ -z $TMUX ]] && exec tmux
webmastak

comment created time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

tmux 3.1b

That's not correct. That should be "tmux 3.2-rc2" if you're using https://github.com/tmux/tmux/releases/tag/3.2-rc

tmux popup -KE -R 'fzf' - no server running on /tmp/tmux-1000/default

That's really strange. Do you have tmux started? What's the value of $TMUX variable?

webmastak

comment created time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

@webmastak What's your output of tmux -V? BTW, you need to kill/exit the old server after upgrade.

webmastak

comment created time in 2 days

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

How about this:

``zsh zstyle ':fzf-tab:complete:*' fzf-preview --preview=' echo word: $word echo description: $desc echo group: $group if (( $+ctxt[isfile] )); then echo path: $realpath fi '

delucca

comment created time in 2 days

issue commentAloxaf/fzf-tab

Not worked popup

@webmastak Does tmux popup -KE -R 'fzf' work?

webmastak

comment created time in 2 days

issue commentAloxaf/fzf-tab

Installation issue? fzf-tab not working [Q]

https://github.com/Aloxaf/fzf-tab#compatibility-with-other-plugins

You should make sure fzf-tab is loaded after completion.zsh

tkolleh

comment created time in 2 days

issue commentromkatv/zsh4humans

Cannot install when current directory is not $HOME

Disscussing with you inspires me again!

In fact, I doesn't need to stick with zsh module. I can write a custom fzf which can process the output from _ftb_compadd directly.

In this way, I don't need to use C anymore (I love Rust) and streaming completion is also possible. I can even write a new UI to support groups.

Aloxaf

comment created time in 3 days

issue commentAloxaf/fzf-tab

Installation issue? fzf-tab not working [Q]

How about run enable-fzf-tab manually?

Can you give the results of the following code:

bindkey "^I"
tkolleh

comment created time in 3 days

issue commentAloxaf/fzf-tab

Not worked popup

As MaienM said, This is not enabled by default because the stable version of tmux is 3.1 now.

webmastak

comment created time in 3 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha b6633227fdf4e4bcc62054cc19fbd6ec43084cc9

fix(fzf): custom key bindings

view details

push time in 3 days

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

@delucca That's strange. What's your preview configuration?

delucca

comment created time in 3 days

PR opened Aloxaf/fzf-tab

refactor: port more shell code to C
+361 -181

0 comment

4 changed files

pr created time in 3 days

create barnchAloxaf/fzf-tab

branch : more_c

created branch time in 3 days

issue closedAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

Hey!

I've just upgraded to the most recent version (after the major refactor) and now my fzf-tab is not working anymore.

I had this config previously:

export FZF_TAB_OPTS=(
   --expect='/'
   --color='hl:$(( $#headers == 0 ? 108 : 255 ))'
   --nth='2,3'
   --delimiter='\0'
   --tiebreak=begin -m --bind=tab:down,change:top,ctrl-space:toggle --cycle
   --query='$query'
   --header-lines='$#headers'
   --preview-window='0%'
 )

I've already deactivated my old configs, but when I tap TAB to test it I got the following error:

-ftb-complete:11: command not found: -ftb-generate-complist

And then the standard zsh-autocomplete appears.

Here is a copy of my .zshrc:

#!/usr/bin/env zsh

##
# ---- Configure tools ----
##

current_emulator=$(pstree -sA $$)

# Bash Hub
source ~/.bashhub/bashhub.zsh

# Enhancd
source ~/.enhancd/bin/init.sh

# asdf
source /opt/asdf-vm/asdf.sh

# zsh-autosuggestions
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#5E5E5E"

# Desk
[ -n "$DESK_ENV" ] && source "$DESK_ENV" || desk go shared.common

# Keychain
zstyle :omz:plugins:keychain agents gpg,ssh
zstyle :omz:plugins:keychain identities id_rsa

# compinit
autoload -U compinit

##
# ---- Load Zplugin ----
##
source ${HOME}/.zinit/bin/zinit.zsh

##
# ---- Load plugins ---

# Order sensitive plugins
zinit light "Aloxaf/fzf-tab"

# Oh-my-zsh configs that I want
zinit snippet "OMZ::lib/completion.zsh"
zinit snippet "OMZ::lib/history.zsh"
zinit snippet "OMZ::lib/key-bindings.zsh"
zinit snippet "OMZ::lib/theme-and-appearance.zsh"
zinit snippet "OMZ::lib/spectrum.zsh"
zinit snippet "OMZ::plugins/git/git.plugin.zsh"
zinit snippet "OMZ::plugins/git-extras/git-extras.plugin.zsh"
zinit snippet "OMZ::plugins/kubectl/kubectl.plugin.zsh"
zinit snippet "OMZ::plugins/fzf/fzf.plugin.zsh"
zinit snippet "OMZ::plugins/dotenv/dotenv.plugin.zsh"
zinit snippet "OMZ::plugins/keychain/keychain.plugin.zsh"

# Improving ZSH usage
zinit light "denysdovhan/spaceship-prompt"
zinit light "chrissicool/zsh-256color"
zinit light "rupa/z"
zinit light "changyuheng/fz"
zinit light "djui/alias-tips"
zinit light "supercrabtree/k"
zinit light "zsh-users/zsh-autosuggestions"
zinit light "zsh-users/zsh-syntax-highlighting"
zinit light "zsh-users/zsh-history-substring-search"
zinit light "Tarrasch/zsh-bd"
zinit light "changyuheng/zsh-interactive-cd"
zinit light "shannonmoeller/up"
zinit light "tcnksm/docker-alias"
zinit light "bonnefoa/kubectl-fzf"
zinit light "jamesob/desk"
zinit light "relastle/pmy"
zinit light "b4b4r07/emoji-cli"

zinit cdreplay -q

# Autoload tmux
if [ -z "$TMUX" ] && [[ $current_emulator == *"termite"* ]]; then
  tmuxinator start default
fi

Can anyone help? Thanks :)

EDIT 1:

If I deactivate everything from my configs (let only the fzf-tab I got the following error when I press tab:

odelucca-pc% git _ftb__main_complete:45: command not found: _setup
odelucca-pc% git _ftb__main_complete:96: permission denied: 
_ftb__main_complete:135: command not found: _complete
_ftb__main_complete:135: command not found: _ignored
_ftb__main_complete:322: permission denied: 

## FOR REFERENCE, this test .zshrc was
source ${HOME}/.zinit/bin/zinit.zsh

autoload -U compinit

zinit light "Aloxaf/fzf-tab"
zinit snippet "OMZ::plugins/fzf/fzf.plugin.zsh"

closed time in 4 days

delucca

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

This should be fixed in https://github.com/Aloxaf/fzf-tab/commit/a7c4890445d6c7a8cc7b64fed3c4e62711ad5b5f

delucca

comment created time in 4 days

issue commentAloxaf/fzf-tab

-ftb-complete:11: command not found: -ftb-generate-complist

What's your zsh version?

I guess this is because autoloading with an absolute path only works on the newer version of zsh.

delucca

comment created time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha a7c4890445d6c7a8cc7b64fed3c4e62711ad5b5f

fix: don't autoload with absolute path

view details

push time in 4 days

GollumEvent
GollumEvent
GollumEvent

delete branch Aloxaf/fzf-tab

delete branch : refactor

delete time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 629417fd2aa3bb1d9ca310a9ac658e72d0d54551

refactor: apply some good points from z4h (#132)

view details

push time in 4 days

PR merged Aloxaf/fzf-tab

refactor: apply some good points from z4h

It is time to refactor my terrible code.

This will be a breaking change. It will invalidate most of the user's configuration. But become easier to use.

  • [x] split fzf-tab.zsh into some small autoload functions.
  • [x] remove uncessary feature
  • [x] code style
  • [ ] <s>faster colorize?</s>
  • [ ] <s>avoid using zle -R?</s>

Breaking Changes

  • command tag is splitted into fzf-commad fzf-bindings
  • extra-opts tag is renamed to fzf-flags
  • add a new tag fzf-preview for previewing
  • fake-compadd, insert-space and ignore tag are removed

For information about new configuration, please see https://github.com/Aloxaf/fzf-tab/wiki/Configuration

+550 -1126

0 comment

11 changed files

Aloxaf

pr closed time in 4 days

pull request commentAloxaf/fzf-tab

Improve completion descriptions

  1. This is difficult... You can reset the color, but you have no way to restore it.

  2. There is an array $words which contains the words on the command line. But it is editable so some completion function may remove some of its content...

adelin-b

comment created time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 230aaf1fc79b2644981bf7e8797b393165f2dcae

test: fix test

view details

push time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha fbe3933211889667577ec2adaefeb5c462841623

feat: add check for old conf

view details

push time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 6ba6dc0c69df664f1d8394a2d0917f2efc61f57b

test: fix test

view details

push time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 8ee06889641b31b2ddcd9e3766c6dbac4b37454e

docs: update README

view details

push time in 4 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 0500996dd22356a2f545c64372c50c49fcd58ef9

feat: add new tag `fzf-preview`

view details

push time in 4 days

issue commentromkatv/zsh4humans

Cannot install when current directory is not $HOME

It won't be easy because the new API is stream-based. This works in z4h because I colorize completion candidates only when all of them are files. In fzf-tab you colorize files even if not all candidates are files (this is extremely rare in practice). ... This one may not be possible to implement in fzf-tab, or at least not as nicely as in z4h. This is because z4h has full control over all widget-wrapping plugins such as zsh-syntax-highlighting, zsh-autosuggestions and powerlevel10k.

This control has a ton of advantages. E.g., in z4h highlighting is correct in corner cases where it would be wrong when using zsh-syntax-highlighting with zsh-autosuggestions in the officially approved way. In addition, highlighting is twice as fast.

So embarrassed, it seems that all the features I am interested in is hard to port to fzf-tab.

I planned to port more part of fzf-tab to C to imporve its speed. LOL, It seems that we finally go to two different paths.

Initially I was afraid of this myself but now I like this a lot. Since the normal completions are always displayed at the top, the recursive completions are extra. If you don't want them, they are easy to ignore. On the other hand, I'm now frequently relying on "deep completion". E.g., when I want to look at a _git burried somewhere in /usr, I would type less /usr/, hit Tab and type /_git$. It takes only a second to traverse /usr -- much less than completing /usr/local/share/zsh/5.8/functions/_git one segment at a time.

That sounds attractive. I will give it a try. It's a pity that fzf-tab has no chance to integrate it (at least, in the short term).

BTW, a compromise solution is using less /usr/**/_git\t, though it is a little slow.

I don't use tmux because I really like having native terminal scrollback, so I cannot just use tmux popup. I hacked something together that allows me to use the equivalent to tmux popup without running everything in tmux. More precisely, I run zsh in a hidden tmux compiled from patched sources but this is invisible to the user of zsh. So far it seems to work well. It doesn't preclude the user from running tmux if they want to. I'll need to experiment more with this. If I can make fzf pop up without pushing the command line up, that would be fantastic.

Yes, I also don't like tmux at first. It invalidates some special features of the terminal emulator--if you use tmux, all terminal emulator will have nearly the same experience. I started use it just because alacritty doesn't support splitting window. But soon I found that tmux allows me to better interact with the content on the terminal. Some plugins like tmux-copycat or zsh-tmux-capture is really useful.

Your solution is interesting. I will waiting for you finish it.

Aloxaf

comment created time in 4 days

GollumEvent

push eventAloxaf/fzf-tab

Aloxaf

commit sha 528256b59b8ce98c23301d1dd238229cf2df49b5

docs: update README & remove README_CN

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 654c7d1e5571fc0af13e8a009f11347c707b0a92

fix: reduce COLUMNS from 9999 to 500 set it to 9999 will cause OOM when set zstyle ':completion:*:processes' command "ps -u $USER -o pid,user,comm,cmd -w -w" I thinks it is a bug.

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 8ade271ab289394e2150d34b5549db8a0f46231e

refactor: rename some variables

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha cba9d0eb36826159b0d076dd89c9d0e7b5f2972d

fix: set COLUMNS to 9999 so that descriptions won't be truncated

view details

Aloxaf

commit sha 7d589530826e4465a6ee9fa4799143c421481fdf

refactor: add -ftb-{colorize,generate-query}

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha e6cc87a0a4774fbf98a1f7e0ea861940a22787a4

fix: set COLUMNS to 9999 so that descriptions won't be truncated

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha f3afb03746a135b40b3f09de29c6b09c367b8bc2

refactor: _fzf_tab_get_headers => -ftb-generate-header

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 252fd4e1d511de24a77bc3fbb2b9e450557a7657

fix: the max height of fzf window if LINE/2

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 74f6f8f849c9b247e91e49d1236ef2adc33d934f

refactor: _fzf_tab_get_candidates => -ftb-generate-complist

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha ea9ff17c2dba56c98337795ea97c3214d36c814b

refactor: add -ftb-fzf as a wrapper function of fzf Also, `command` tag is splitted into `fzf-command`, `fzf-bindings` and `fzf-flags`.

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 9d9ee7c590d3838b5b9b45994954771cb242015f

refactor: remove `fake-compadd` tag This tag is useless. There should be a better way to fix the "extra whitespace" bug.

view details

Aloxaf

commit sha bdcb818f2011754cc578c524fcd70a36f2856568

refactor: remove `insert-space` and `ignore` tag

view details

push time in 5 days

PR opened Aloxaf/fzf-tab

refactor: apply what I learned from z4h

It is time to refactor my terrible code.

+476 -476

0 comment

1 changed file

pr created time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 4a840795da7b6862f717e86fddc69143f9361b69

style: set ident width to 2

view details

push time in 5 days

create barnchAloxaf/fzf-tab

branch : refactor

created branch time in 5 days

pull request commentAloxaf/fzf-tab

wip: improve completion description

Well, this PR is closed automatically after I merged #126.

You can make a new PR to the master branch.

adelin-b

comment created time in 5 days

PR closed Aloxaf/fzf-tab

wip: improve completion description

This pr aim to have a way to customize the description field image

There is a lot of problem that I do not manage to resolve due to zsh-ing code, maybe you can give an helping hand, I wrote all the TODO inside the code for context

# TODO once the dscr changed with the icon the $in variable in fzf preview has the icon in front,
#
# > echo $in 
#  copy_from_zsh_src.zsh
#
# how to get $word and $dscr in fzf preview
typeset -g fzf_tab_preview_init="
# TODO dscr
local dscr=\${\${\"\$(<{f})\"%\$'\0'*}#*\$'\0'*\$'\0'}
# TODO word
local word=\${\${\"\$(<{f})\"%\$'\0'*}#*\$'\0'*\$'\0'}
# TODO how to get groups?
# GROUPS seem unaccessible
groups=
# TODO how to get group id ?
# I dont think it is safe if there is numbers before group
local gid="${__tmp_value//[!0-9]/}"
# TODO how to get group name ?
local group=groups[gid]

# TODO do this the same way of fzf_tab_preview_init
# # Here will be the custom script injection for icons
# if [ "$fzf_tab_completion_description_init" ]
#   dscr=$(eval 'local $dscr'$fzf_tab_completion_description_init)

# TODO remove this and use custom fzf_tab_completion_description_init above
dscr=$(echo "$dscr" | devicon-lookup)

+16 -4

16 comments

1 changed file

adelin-b

pr closed time in 5 days

delete branch Aloxaf/fzf-tab

delete branch : improve_preview

delete time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 06ee70598df39f54fc1feac64145697124d6b3d2

feat: more powerful preview (#126)

view details

push time in 5 days

PR merged Aloxaf/fzf-tab

feat: more powerful preview

This will close #79.

Example:

zstyle ':fzf-tab:complete:*' extra-opts --preview=$fzf_tab_preview_init'
echo word: $word
echo description: $desc
echo group: $group
if (( $+ctxt[isfile] )); then
  echo path: $realpath
fi
'
+40 -16

10 comments

2 changed files

Aloxaf

pr closed time in 5 days

issue closedAloxaf/fzf-tab

Tag specific preview and cycling

Is your feature request related to a problem? Please describe. Im trying to define different preview specific to the type/tag of the completion, for example it can be either a command / folder / textfile / image / aliases vim Describe the solution you'd like Actually Im using

zstyle ':fzf-tab:complete:*' extra-opts --preview=$extract'

  # Display Information about the command
  which ${~ctxt[hpre]}$in | grep -v "not found" 2> /dev/null;
  whatis ${~ctxt[hpre]}$in 2> /dev/null;

  # Search through man and give the description segment
 man "${~ctxt[hpre]}$in" 2> /dev/null |col -bx|awk -v S="$2" "DESCRIPTION ~ S {cap="true"; print} DESCRIPTION !~ S && /^[A-Z ]+$/ {cap="false"} DESCRIPTION !~ S && !/^[A-Z ]+$/ {if(cap == "true")print}" 2> /dev/null;

  # Display images
  tiv -h ${FZF_PREVIEW_LINES} -w ${FZF_PREVIEW_COLUMNS} ${~ctxt[hpre]}$in  2> /dev/null;

  # Display exif data
  # exiftool ${~ctxt[hpre]}$in  2> /dev/null;
  
  # Display directory
  lsd --tree --depth 2 --color=always ${~ctxt[hpre]}$in 2> /dev/null
  # exa -1 --color=always ${~ctxt[hpre]}$in 2> /dev/null;
  # du -h ${~ctxt[hpre]}$in 2> /dev/null | tail -n1

  # Display file
  bat --theme="OneHalfDark" --style=numbers,changes --color always ${~ctxt[hpre]}$in 2> /dev/null | head -n50 | grep -v "bat warning";
  '

I would like to be able to handle all kind of completion types like options / commits / users / services / diff / urls. So the extra ops should have a way to know which kind of tag is previewed.

Hence thoses questions that are in the way:

  1. How to make preview that are aware of the current tag to display?
  2. How to make functions available inside zstyle? (I tryed to define functions just above be I couldnt use theme)
  3. How to make aliases available inside zstyle? (which g work inside a shell but not when im trying to show it during the completion preview)
  4. How would you implement a way to switch the preview mode (for example the type imageFile would have 2 preview mode: exif and terminal preview)

Here is what the code above do, im using tiv for the image display and bat for the code fzf-tab

git diff

closed time in 5 days

adelin-b

push eventAloxaf/fzf-tab

Aloxaf

commit sha 7073162244a5d53f8ed79049d0ee4cb1a11a3cf6

fix: update the way to get group id

view details

push time in 5 days

pull request commentAloxaf/fzf-tab

feat: more powerful preview

There is currently a bug, group is lost

fzf_tab_preview_debug='
echo "word: $word"
echo "group: $group"
echo "dscr: $dscr"
echo "realpath: $realpath"
'
zstyle ':fzf-tab:complete:*' extra-opts --preview=$fzf_tab_preview_init$fzf_tab_preview_debug

image

Oh sorry I forgot to update $fzf_tab_preview_init after c88df0f (#126).

Aloxaf

comment created time in 5 days

issue commentromkatv/zsh4humans

Cannot install when current directory is not $HOME

By the way, there are a few things in zsh4humans that you might want to copy over to fzf-tab. At some point I wanted to upstream them but when I stopped using fzf-tab it was harder to justify the time cost for doing so. It's also hard work because fzf-tab has a lot of users, so backward compatibility is a thing.

Yes. I am very interested in it. But this may take much time since I have lots of things to do but little free time.


There is a stream-based file colorized that's very fast. You can try it within z4h by pasting this:

# usage: colorize context
function colorize() {
  [[ -o list_types ]]
  local -i list_types=$((! $?))
  -z4h-set-list-colors "$1" $list_types
  local -i list_colors=$((! $?))
  -z4h-present-files $list_colors $list_types
}

And running it like this:

find . | colorize :complete:ls::

This outputs two columns separated by \0. The first is the original file, the second is colorized.

That's amazing. I will look into it later to check whether I can replace zsh-ls-colors with it.


The way you can customize fzf is nice. See fzf-bindings, fzf-flags and fzf-command in #35 (comment).

Nice design! I always regret putting all parameters together, it exposes all parameters to users and makes it hard for me to add/remove parameters.


When completing files, directories are recursed automatically. These completions appear below the normal ones.

I'd like to use fd + zsh-tmux-capture here. Listing all files seems messy.


Suffix match in fzf (e.g., .md$ to list markdown files) works as expected. In fzf-tab it doesn't work due to junegunn/fzf#2099.

To be honest, I haven't used suffix match before. I use matcher-list tag to let me complete a file with its extension.

This may be useful when combining with the feature above (directories are recursed automatically).


There is no zle -R when completing. This makes it look much better on slow terminals.

That's really nice! I will also look into it later.


Tab inserts unambiguous prefix automatically. If you set auto_menu option (it's unset by default at the bottom of .zshrc), fzf will open automatically without requiring a second tab. The query in fzf is based on the command line and not on the longest prefix among completion candidates. This way, if you have auto_menu unset, you don't need to look at the query because it's always what you've already typed in zle.

That's good. I think it is time for me to fix https://github.com/Aloxaf/fzf-tab/issues/8...


The support for groups is completely lost though. It's possible to add them but I couldn't design a UI that would work well.

Yes, my ideal UI is like zstyle ':completion:*' menu yes select search. But this is impossible unless I create a another fork of fzf.

Another approach is https://github.com/Aloxaf/fzf-tab/pull/127#issuecomment-714919704. But this need users to write code themselves.


One more thing. If you'd like to switch to zsh4humans, check out #35. It's super long but has a ton of useful info for advanced users. The default .zshrc and the docs are aimed at the average user but there is much more to z4h than that.

At the very least please read #35 (comment). I'd love to have you onboard and would welcome feedback and bug reports from you!

Thanks! This project is awesome. I will try it more later and decide whether I can switch my configuration to zsh4humans.


Your project inspired me a lot!

I really should remove some rarely used features from fzf-tab to reduce its complexity and speed. It used to be simple, but now it is very compelx and not so efficient.

Streaming completion is cool. But it's getting more and more hard for me to implement it since I have built too many functions on the top of this feature (like https://github.com/Aloxaf/fzf-tab/pull/130). I think I won't implement it in the short term.

Aloxaf

comment created time in 5 days

pull request commentAloxaf/fzf-tab

feat: add support for tmux popup

@solarizedalias Oh sorry I didn't notice your reply.

Inside the popup, PWD is current directory of...

This bug is fixed in https://github.com/Aloxaf/fzf-tab/commit/966e7b47cd937014e8a0ec7de5273d3c60ffbeeb. I disabled all the preview while developing this branch so I didn't notice this bug but after merging it into master I soon notice it.


It looks like the descriptions are truncated to the pane's width so you will still lose the exceeded lengths

This is an known issue. But I still haven't find a way to solve it. I think I should move it into my TODO lists now.


Oh looks like it's merged while I'm editing. Should I move it to issues?

Feel free to move it to issue.

Aloxaf

comment created time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 0915bf591a5e38c189d8d971a4e35b711cfc373f

fix(colorize): use `word` instead of `descriptions` to get the file path related: #127

view details

Aloxaf

commit sha 7f8254a184d159016587f586c13f6686c17f3e7a

fix: use the first explanation This fixes a part of #131

view details

Aloxaf

commit sha 988408bfb45d96116d78304b598e79b906225874

feat: add support for tmux popup (#130)

view details

Aloxaf

commit sha c49a3d7c2e68b54b3928e6a2746c80736d104b47

Merge branch 'master' into improve_preview

view details

Aloxaf

commit sha 966e7b47cd937014e8a0ec7de5273d3c60ffbeeb

fix(tmux-popup): set directory to PWD before run fzf

view details

Aloxaf

commit sha 6f4deab529e1e1136262279a8e221e75c45b3a64

Merge branch 'master' into improve_preview

view details

push time in 5 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 966e7b47cd937014e8a0ec7de5273d3c60ffbeeb

fix(tmux-popup): set directory to PWD before run fzf

view details

push time in 5 days

GollumEvent
GollumEvent

issue closedromkatv/zsh4humans

Cannot install when current directory is not $HOME

You always create impressive projects. :+1:

Full log:

[root@261341dba2ed /]# cd /usr/
[root@261341dba2ed usr]# if command -v curl >/dev/null 2>&1; then
>   sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh4humans/v4/install)"
> else
>   sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v4/install)"
> fi
Greetings, Human!

What kind of keyboard are you using?

  (1)  Mac. It has Option key(s) and does not have Backspace.
  (2)  PC.  It has Backspace key(s) and does not have Option.
  (q)  Quit and do nothing.

Choice [12q]: 1
What keybindings do you prefer?

  (1)  Standard. I delete characters with Delete key.
  (2)  Like in vi. I delete characters with X key in command mode.
  (q)  Quit and do nothing.

Choice [12q]: 1
You have the following Zsh startup files:

    ~/.zshenv
    ~/.zshrc

What should I do with them?

  (1)  Move them to ~/zsh-backup/20201023-135540. Recommended.
  (2)  Delete them.
  (q)  Quit and do nothing.

Choice [12q]: 1
Settings up Zsh For Humans...

z4h: fetching z4h.zsh from github.com/romkatv/zsh4humans
z4h: generating ~/.zshenv
z4h: generating ~/.zshrc
cp: cannot stat '.zshenv': No such file or directory

closed time in 6 days

Aloxaf

delete branch Aloxaf/fzf-tab

delete branch : tmux-popup

delete time in 6 days

push eventAloxaf/fzf-tab

Aloxaf

commit sha 988408bfb45d96116d78304b598e79b906225874

feat: add support for tmux popup (#130)

view details

push time in 6 days

PR merged Aloxaf/fzf-tab

feat: add support for tmux popup

asciicast

I love this. It won't push my prompt to the top of pane when the completion list is too long.

Close #128.

How to use (need tmux 3.2!!):

FZF_TAB_COMMAND[1]=fzf-tmux-popup
zstyle ':fzf-tab:*' command $FZF_TAB_COMMAND
+62 -0

2 comments

2 changed files

Aloxaf

pr closed time in 6 days

issue closedAloxaf/fzf-tab

[FR] integration with tmux popup

https://github.com/tmux/tmux/issues/1842

That would be useful if the current pane is too small to show the full candidate list.

closed time in 6 days

Aloxaf

push eventAloxaf/fzf-tab

Aloxaf

commit sha f0471713b53b43d2c40ed4858d14e114fd3b5755

feat: add new tag popup-pad

view details

push time in 6 days

more