Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Cli shell plugin, the missing fuzzy tab completion feature for the z jump around command.

License

NotificationsYou must be signed in to change notification settings

mrjohannchang/fz.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A shell plugin that seamlessly adds fuzzy search to tab completion ofz,lets you easy to jump around among your historical directories.Not any additional key binding is needed. Currently supports Bash and zsh.

Demo

gif-demo

Installation

By simply sourcing corresponding script file for your shell, you're all set.However, this plugin is sitting on top ofz andfzf, so you must have them installed as well.

N.B.fz needs to be sourced afterz.

macOS

Fig

Fig adds apps, shortcuts, and autocomplete to your existing terminal.

Installfz in zsh or bash with one click.

Bash

  1. Install fzf viaHomebrew.

    brew install fzf
  2. Download z and fz.

    mkdir~/.bash_completion.dcurl"https://raw.githubusercontent.com/rupa/z/master/{z.sh}" \    -o~/.bash_completion.d/"#1"curl"https://raw.githubusercontent.com/changyuheng/fz/master/{fz.sh}" \    -o~/.bash_completion.d/z"#1"
  3. Add the following content to~/.bashrc:

    if [-d~/.bash_completion.d ];thenforfilein~/.bash_completion.d/*;do.$filedonefi

zsh

  1. Install fzf viaHomebrew.

    brew install fzf
  2. Install z and fz viazplug.Add the following content to~/.zshrc:

    zplug"changyuheng/fz", defer:1zplug"rupa/z", use:z.sh

Ubuntu

Bash

  1. Install fzf.

    git clone --depth 1 https://github.com/junegunn/fzf.git~/.fzf~/.fzf/install
  2. Download z and fz.

    mkdir~/.bash_completion.dcurl"https://raw.githubusercontent.com/rupa/z/master/{z.sh}" \    -o~/.bash_completion.d/"#1"curl"https://raw.githubusercontent.com/changyuheng/fz/master/{fz.sh}" \    -o~/.bash_completion.d/z"#1"
  3. Add the following content to~/.bashrc:

    if [-d~/.bash_completion.d ];thenforfilein~/.bash_completion.d/*;do.$filedonefi

zsh

  1. Install fzf.

    git clone --depth 1 https://github.com/junegunn/fzf.git~/.fzf~/.fzf/install
  2. Install z and fz viazplug.Add the following content to~/.zshrc:

    zplug"changyuheng/fz", defer:1zplug"rupa/z", use:z.sh

Usage

z [dir name slug]<TAB>zz [dir name slug]<TAB>
  • The function of fz is pretty much like what it is ofz.zz limits the search base starting from current working directory.Check z’s doc for more information.
  • tab/shift-tab,ctrl-n/ctrl-p,ctrl-j/ctrl-k,for next and previous item.Enter for selection.Check fzf’sdocfor the search syntaxes.
  • FZ_CMD=z specifies command name offz. Default isz.
  • FZ_SUBDIR_CMD=zz specifies command name for subdirectory onlyz.Default iszz.
  • FZ_SUBDIR_TRAVERSAL=0 disables subdirectory completion.Default is enabled.
  • FZ_CASE_INSENSITIVE=0 disables case-insensitive subdirectory completion.Default is enabled.
  • FZ_ABBREVIATE_HOME=0 disables abbreviating~. Default is enabled.
  • FZ_HISTORY_CD_CMD=_zlua works withz.lua.

See Also

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp