Giter Club home page Giter Club logo

zce.zsh's Introduction

vim’s EasyMotion / Emacs’s ace-jump-mode for zsh.

Author: Takeshi Banse <[email protected]>

License: BSD-3

Thank you very much, Kim Silkebækken and winterTTr! I want to use the EasyMotion/ace-jump-mode in zsh.

zsh.zsh demo

Install

Please source it and bind the function to your favorite key.

% . zce.zsh
% bindkey "^Xz" zce

Styles

:zce:* keys

Keys to be used for target characters.
(default: the result of setopt braceccl; ${(j..)$(print {a-z} {A-Z})})

:zce:* fg

A highlight sepc for target characters.
(default: 'fg=196,bold')

:zce:* bg

A highlight spec for BUFFER during zce is in effect.
(default: 'fg=black,bold')

:zce:* prompt-char

A prompt string for querying the searching character.
(default: '%{\e[1;32m%}Search for character:%{\e[0m%} ')

:zce:* prompt-key

A prompt string for querying the target character.
(default: '%{\e[1;32m%}Target key:%{\e[0m%} ')

customization example

() {
  setopt localoptions braceccl
  zstyle ':zce:*' keys ${(j..)$(print {a-z})}
}
zstyle ':zce:*' fg 'fg=white,bold'
zstyle ':zce:*' bg 'fg=7'
zstyle ':zce:*' prompt-char '%{\e[1;32m%}Character:%{\e[0m%} '
zstyle ':zce:*' prompt-key '%{\e[1;32m%}Key:%{\e[0m%} '

Notes

Optionally you can use the zcompiled file with the autoloading for a little faster loading on every shell start up, if you zcompile the necessary functions. zcompile zce.zsh to ~/.zsh/zfunc/zce:

% Z=~/c/experiment/zsh/zce.zsh/zce.zsh; ($SHELL -c ". $Z && zce-zcompile $Z ~/.zsh/zfunc")
** zcompiling zce in ~/.zsh/zfunc for a little faster startups...
+ mkdir -p ~/.zsh/zfunc
* writing code ~/.zsh/zfunc/zce
* re-compiling ~/.zsh/zfunc/zce.zwc: succeeded
** All done.
** Please update your .zshrc to load the zcompiled file like this,
-- >8 --
## zce.zsh stuff.
# source ~/c/experiment/zsh/zce.zsh/zce.zsh
autoload -w ~/.zsh/zfunc/zce; zle -N zce
# bindkey "^Xz" zce
-- 8< --

Please copy and paste the contents between -- >8 -- and -- 8< -- into your ~/.zshrc

zce.zsh's People

Contributors

hchbaw avatar lpm11 avatar

Watchers

 avatar James Cloos avatar

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.