GithubHelp home page GithubHelp logo

zsh-easy-vcs-status's Introduction

easy-vcs-status for zsh

Synopsis

  • easy-vcs-status - a zle tweak for easy access to VCS status

Description

Screen shot

This tweak allows user to pop up VCS status using the completion menu UI with a key combination (default: Meta-Shift-S) whenever you are on the command line.

VCS status is shown in the completion menu which is scrollable back and forth. If you hit enter, the full output is written to the standard output. If you hit space, the last shell word on the current line is pasted into the previous command line as result of the completion. Otherwise, the menu simply disappears and user can get back to normal operation on the command line with the previous input.

How to set up

A variable defined by vcs_info is used to figure out what VCS is used in the current directory, so vcs_info must be loaded and configured in order for this tweak to work.

Given vcs_info is set up, put the file easy-vcs-status somewhere in your $fpath and add these lines to your .zshrc:

autoload -Uz easy-vcs-status
easy-vcs-status

This binds the tab key to expand-or-complete-or-vcs-status, a wrapper of expand-or-complete that casts all the magic.

Configuration

Keys for opening and closing VCS status popups are configurable via zstyle as follows:

# Use Meta-Control-S instead
zstyle ":easy-vcs-status:bindkey" open '^[^S'

You can alternatively manually bind a key to the function open-vcs-status.

Commands for showing VCS statuses are configurable via zstyle as follows:

zstyle ":easy-vcs-status:command" "$vcs" "$command"

For convenient scrolling through a long status output, I strongly suggest binding keys in the menuselect keymap if you haven't, for example:

zmodload zsh/complist
bindkey -M menuselect '\e[Z' reverse-menu-complete
bindkey -M menuselect '^V' forward-word
bindkey -M menuselect '^[v' backward-word
bindkey -M menuselect '^[<' beginning-of-history
bindkey -M menuselect '^[>' end-of-history

License

Copyright (c) 2013-2015 Akinori MUSHA

Licensed under the 2-clause BSD license. See LICENSE.txt for details.

zsh-easy-vcs-status's People

Contributors

knu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.