Giter Club home page Giter Club logo

dtags's Introduction

Directory Tags for Lazy Programmers

Package Version

Python Versions

Issues Open

MIT License

Features

dtags is a lightweight command line tool which lets you:

  • Tag and un-tag directories
  • Run commands in multiple directories in parallel
  • Change directories quickly via tag names
  • Use shell variables to reference directories
  • Easily manage git repositories, vagrant machines etc.

Installation

Check requirements:

  • Python 2.7+ or 3.4+
  • Recent version of pip
  • Recent version of Bash, Zsh or Fish with tab-completion enabled

Install the package:

Add the following line at the end of your shell runtime configuration and reload the shell:

Once installed, you will have the following at your disposal:

  • Utility commands t, u, d, e, p
  • Main command dtags

All commands come with tab-completion.

Usage

Tag directories with t:

Un-tag directories with u:

Change directories with d (designed to fully replace cd!):

Execute commands in one or more directories with e:

Execute commands in parallel with p (same interface as e):

Display, search and manage tags with dtags:

If a tag points to a single directory, shell variables are automatically created:

You can always use the --help option to find out more about each command!

More Examples

Streamline your Git workflows:

Control multiple vagrant machines at the same time:

Technical Notes

  • The directory-to-tags mapping is stored in ~/.dtags/mapping
  • Tags are also stored on their own in ~/.dtags/tags for tab-completion
  • p is currently not fully supported on Windows
  • p cannot execute interactive commands that wait on input
  • p spawns child processes and redirects all output to temp files and then to stdout
  • p does not retain font colors due to shell limitations
  • p sends sigterm to its child processes when killed
  • e (or p) uses environment variable $SHELL to guess which shell is in use
  • e (or p) redirects stderr to stdout and always returns an exit status of 0
  • Using -i (interactive shell) has caveats:
    • The shell runtime configuration must be "sourced" for every command execution
    • The performance is affected by the shell startup time (beware oh-my-zsh users)
    • Any errors thrown during the "sourcing" will be displayed in the output
  • dtags edit uses environment variable $EDITOR
  • d prefers tags over subdirectories when there are name conflicts
    • To go to the subdirectory, put / after the directory name
  • d expects ~/.dtags/mapping to be correctly formatted:
    • Refrain from editing ~/.dtags/mapping directly.
    • Instead, use dtags edit which does the validation and formatting for you
  • Tab-completion expects ~/.dtags/tags to be correctly formatted:
    • Refrain from touching this file
    • This file is auto-generated whenever a dtags command is run.
  • A shell variable is created only if its name does not conflict with environment variables
  • When shell variables are created, any disallowed characters in the name are replaced with underscores

dtags's People

Contributors

acrisci avatar jetm avatar joowani 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.