Giter VIP home page Giter VIP logo

redo's Introduction

Redo

Release CI Test

Redo is a command line application to easily create reusable functions in your own shell. Think of redo like an interactive way combine multiple commands from your shell history in a single command. This can be handy for quickly re-doing multiple commands for example deleting and starting a new docker container.

Features

  • Easily create reusable functions from shell history
  • Shell agnostic, can be used with ZSH, Bash etc.
  • Aliases are stored in a single file which can be put in version control

Installation

Prebuilt binaries

Download one of the prebuilt binaries from: https://github.com/barthr/redo/releases and run the following command

tar -xf <downloaded_archive> redo && sudo mv redo /usr/local/bin

Install from source

go install github.com/barthr/redo@latest

After downloading add the following line to your ~/.bashrc or ~/.zshrc

source "$(redo alias-file)"

This will make sure that the aliases from redo are loaded on every shell session.

Quickstart

redo contains a couple of commands, which can be used to create reusable functions.

  1. redo - Opens up the interactive window to create a new function
  2. redo alias-file - Prints the path to the functions file
  3. redo edit - Opens the functions file in your configured editor
  4. redo help - Prints a help message which includes information about all the commands

Configuration

Redo can mostly run without requiring any specific configuration, however it is possible to customize this configuration by setting the following environment variables:

REDO_ALIAS_PATH: The path where the alias file of redo is stored (defaults to aliases file in user config dir)

REDO_CONFIG_PATH: The config path for redo (defaults to user config dir)

REDO_HISTORY_PATH: The location of the history file which redo uses to source commands (*defaults to HISTFILE if it is exported)

REDO_EDITOR: The editor you want to use when running commands like redo edit (defaults to EDITOR if it is exported)

Shortcuts

Redo can be bind to a shortcut, so you can easily summon it without calling it directly.

zsh CTRL+e summons redo: Put the following line in your zshrc file

bindkey -s '^e' 'redo^M'

bash CTRL+e summons redo: Put the following line in your bashrc file or bash_profile

bind '"\C-e":"redo\n"'

Roadmap

  • Reordering of selected tasks
  • Easy listing/deletion of functions
  • Inline editing of shell functions
  • Prebuilt binaries published as .deb .rpm .yum etc.

Acknowledgements

License

MIT

redo's People

Contributors

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