Skip to content

Extended Vi mode f, F, t, and T key mapping for zsh (inspired by clever-f.vim).

Notifications You must be signed in to change notification settings

kamykn/smart-f.zsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

smart-f.zsh⛵️

Extended Vi mode f, F, t, and T key mapping for zsh.
Read a character from the keyboard, and move to the next (or prev) occurrence of it in the BUFFER.
smart-f.zsh is a zsh plugin inspired by clever-f.vim.

Demo

smart-f.zsh

Installation

zplug

zplug "kamykn/smart-f.zsh", defer:2

Usage

f (Emacs mode)

Finding character and move to the next in the BUFFER (for Emacs mode).

smart-f.zsh emacs-mode

# This is overriding default Emacs mode command
Ctrl-X Ctrl-F {char}

f, F, t and T (Vi mode)

In vi mode f, F, t and T are overridden (for Vi mode).

smart-f.zsh vi-mode

# For normal mode (vicmd).
# Finding character and move to the next.
f {char}

# Finding character and move to the previous.
F {char}

# Finding character and move to the position just before the next.
t {char}

# Finding character and move to the position just before the previous.
T {char}

Remapping

You can remap shortcut key.

# Finding character and move to the next.
bindkey '^F' smart_f_next

# Finding character and move to the previous.
bindkey '^B' smart_f_prev

About

Extended Vi mode f, F, t, and T key mapping for zsh (inspired by clever-f.vim).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages