zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
授权协议 BSD-3-Clause License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 常炯
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

zsh-syntax-highlighting Build Status

Fish shell-like syntax highlighting for Zsh.

Requirements: zsh 4.3.11+.

This package provides syntax highlighting for the shell zsh. It enableshighlighting of commands whilst they are typed at a zsh prompt into aninteractive terminal. This helps in reviewing commands before runningthem, particularly in catching syntax errors.

Some examples:

Before:
After: 

Before:
After: 

Before:
After: 

Before:
After: 

How to install

See INSTALL.md.

FAQ

Why must zsh-syntax-highlighting.zsh be sourced at the end of the .zshrc file?

zsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) andcomputing syntax highlighting for the command-line buffer as it stands at thetime z-sy-h's hook is invoked.

In zsh 5.2 and older,zsh-syntax-highlighting.zsh hooks into ZLE by wrapping ZLE widgets. It mustbe sourced after all custom widgets have been created (i.e., after all zle -Ncalls and after running compinit) in order to be able to wrap all of them.Widgets created after z-sy-h is sourced will work, but will not update thesyntax highlighting.

In zsh newer than 5.8 (not including 5.8 itself),zsh-syntax-highlighting uses the add-zle-hook-widget facility to installa zle-line-pre-redraw hook. Hooks are run in order of registration,therefore, z-sy-h must be sourced (and register its hook) after anything elsethat adds hooks that modify the command-line buffer.

Does syntax highlighting work during incremental history search?

Highlighting the command line during an incremental history search (by default bound toto Ctrl+R in zsh's emacs keymap) requires zsh 5.4 or newer.

Under zsh versions older than 5.4, the zsh-default underliningof the matched portion of the buffer remains available, but zsh-syntax-highlighting'sadditional highlighting is unavailable. (Those versions of zsh do not provideenough information to allow computing the highlighting correctly.)

See issues #288 and #415 for details.

How are new releases announced?

There is currently no "push" announcements channel. However, the followingalternatives exist:

How to tweak

Syntax highlighting is done by pluggable highlighter scripts. See thedocumentation on highlighters for details andconfiguration settings.

  • zsh的配置及常见插件的安装 先交代一下背景 最近刚入手了mac pro,用习惯了windows,突然一下用ios系统,别说,还真是不习惯。周末刚好有空来熟悉熟悉ios 的cmd是咋样的。 ios 的shell 之前用的都是bash,现在已经被zsh取代了,当然也还有其他的shell,比如fish等等,没怎么接触过,所以就不介绍了。接下来先来点开胃小菜。 编译和解释 编程语言没有编译型和解释型的区

  • 1. Mac 的 shell 1.1 查看 Mac 上已有的 shell ➜ ~ cat /etc/shells # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/bash /bin/csh

  • 方法一: 按照下列顺序执行指令: 来到zsh的插件目录列表 $ZSH_CUSTOM/plugins 下载自动补全插件 zsh-autosuggestions 和 高亮插件 zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-autosuggestions.git git clone https://github.co

  • yum install zsh git wget -y cd  # 想在哪个用户下使用,就使用哪个用户运行,多个用户可以运行多次哟 # 安装oh-my-zsh sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" # 高亮 git clone https://github

  • @BigTear In /etc/wsl.conf (create if it doesn't exist) add: [interop] appendWindowsPath=false Afterwards run wsl --shutdown and open a new session for the changes to take effect. Note that this will m

  • 官网:https://github.com/zsh-users/zsh-syntax-highlighting 安装: git clone https://github.com/zsh-users/zsh-syntax-highlighting.git echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.

  • 安装说明: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md 根据安装说明: 1.Clone this repository in oh-my-zsh’s plugins directory: git clone https://github.com/zsh-users/zsh-syntax-hi

  • 由于我的iterm打开总是先提示zsh-syntax-highlighting找不到问题,所以去网上搜了搜 很多命令行都无法连接git仓库,只有这个能够使用: git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax

  • git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUST

 相关资料
  • import "regexp/syntax" Package syntax parses regular expressions into parse trees and compiles parse trees into programs. Most clients of regular expressions will use the facilities of package regexp

  • Zsh

    Z shell是一个Linux用户很少使用的power-shell,这是由于大多数Linux产品安装,以及默认使用bash shell。几乎每一款Linux产品都包含有zsh,通常可以用apt-get、urpmi或yum进行安装。

  • Markdown语法说明 Markdown 的目标是实现「易读易写」。 行内HTML 不在 Markdown 涵盖范围之内的标签,可以直接在文档里面用 HTML 撰写。 例外:块区元素<div> <table> <pre> <p>,必须在前后加上空白。且不可用空白来缩排。 特殊字符自动转换 例如:在 HTML 文档中,有两个字符需要特殊处理: < 和 &。 标题: Markdown 支持两种标题的

  • Nebula Syntax A minimal Atom theme that's out of this world. Works best when paired with the nebula-ui theme Meet the colors. Every great theme starts with great colors. Five are not enough. Seven are

  • 我们将安装 zsh ,其拓展功能和主题将由 oh-my-zsh 提供。其中Env.sh 文件用于维护别名(aliases),输出(exports)和路径改变(path changes)等等,以免影响 ~/.zshrc。 Zsh 使用 Homebrew 完成 zsh 和 zsh completions 的安装 brew install zsh zsh-completions 安装 oh-my

  • 在~/.zshrc文件中加入如下内容: #screen integration to set caption bar dynamically function title { if [[ $TERM == "screen" || $TERM == "screen.linux" ]]; then# Use these two for GNU Screen:print -nR $'\033k'$1$