Code Monkey home page Code Monkey logo

fast-syntax-highlighting's Introduction

Zshell Fast Syntax Highlighting

60 commits that optimized standard zsh-syntax-highlighting to the point that it can edit 10 kB functions with zed/vared (optimizations done in history-search-multi-word). Also added:

  1. Variable highlighting

    variables

  2. Colorizing of ${(a)parameter[...]} inside strings (normally only $parameter is colorized)

    in-string

  3. Fixed colorizing of function definition, like abc() { ... } โ€“ย abc will not be red

    function

  4. Fixed colorizing of complex conditions inside [[, like [[ "$a" || "$b" ]]

    complex conditions

  5. Closing ]] and ] are highlighted (see above)

  6. Paths from $CDPATH aren't colorized unless the command is cd

Performance differencies can be observed at Asciinema recording, where 10 kB function is being edited:

asciicast

Installation

The plugin is "standalone", which means that only sourcing it is needed. So to install, unpack fast-syntax-highlighting somewhere and add

source {where-fsh-is}/fast-syntax-highlighting.plugin.zsh

to zshrc.

If using a plugin manager, then Zplugin is recommended, but you can use any other too, and also install with Oh My Zsh (by copying directory to ~/.oh-my-zsh/custom/plugins).

Add zplugin load psprint/fast-syntax-highlighting to your .zshrc file. Zplugin will handle cloning the plugin for you automatically the next time you start zsh. To update issue zplugin update psprint/fast-syntax-highlighting (update-all can also be used).

Antigen

Add antigen bundle psprint/fast-syntax-highlighting to your .zshrc file. Antigen will handle cloning the plugin for you automatically the next time you start zsh.

Oh-My-Zsh

  1. cd ~/.oh-my-zsh/custom/plugins
  2. git clone https://github.com/zdharma/fast-syntax-highlighting.git
  3. Add fast-syntax-highlighting to your plugin list

Zgen

Add zgen load psprint/fast-syntax-highlighting to your .zshrc file in the same place you're doing your other zgen load calls in.

fast-syntax-highlighting's People

Contributors

psprint avatar

Stargazers

 avatar  avatar

Watchers

 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.