Giter Site home page Giter Site logo

zsh-quiet-accept-line's Introduction

Zsh Quiet-Accept-Line

Build Status

Zsh plugin is to enable to run typed zsh command without triggering a new prompt and saving the query to the history

asciicast

Usage

This plugins define 3 zle widgets:

  • quiet-accept-line bound to C-x RET/C-x C-m: run the current typed command, without output a new prompt
  • silent-accept-line bound to C-x C-j: run the current typed command, without output a new prompt. output wil be suppressed
  • last-quiet-accept-line bound to C-x C-k: restore to the prompt the last command that was run with `quiet/silent-accept-line``

Optionaly status code of the quietly runned command can be display. To do so, set ZLE_QAL_STATUS_DISPLAY to true, on or yes. (QAL stands for Quiet Accept Line)

Installation

Just source quiet-accept-line content, or if you use a plugin manager set adrieankhisbe/zsh-quiet-accept-line as plugin:

  • for antigen, just add zsh-quiet-accept-line to your bundles as adrieankhisbe/zsh-quiet-accept-line antigen bundle adrieankhisbe/zsh-quiet-accept-line
  • for zplug, add zplug "adrieankhisbe/zsh-quiet-accept-line"

Configuration

Keys can be configured based on the following variables: ZLE_QAL_QUIET_KEY, ZLE_QAL_SILENT_KEY, and ZLE_QAL_LAST_KEY. (default being ^X^M, ^X^J and ^X^K)

Output of the status code can be customized with the following variable:

  • ZLE_QAL_STATUS_DURATION: how long status is displayed, blocking the prompt (default 0.5s)
  • ZLE_QAL_STATUS_OK: what is output for successful command (default green โœ” with prompt color escape %{%})
  • ZLE_QAL_STATUS_KO: what is output for failing command (default red โœ– with prompt color escape %{%}) note that status is saved to ZLE_QAL_STATUS variable

About

This plugin was driven by the need to improve tmux-resurrect zsh history saving that was poluting terminal with fc commands. After some research I end up on the following stack overflow question, that inspired the initial implementation.

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.