Giter Club home page Giter Club logo

oh-my-zsh-flow-plugin's Introduction

Flow Framework Helper for Oh-my-ZSH

Copyright 2012-2019 Sebastian Kurfürst, sandstorm|media

Installation

oh-my-zsh

First, you need to install oh-my-zsh from https://github.com/robbyrussell/oh-my-zsh.git

Then, install this repository inside custom/plugins of your oh-my-zsh directory:

mkdir -p .oh-my-zsh/custom/plugins
cd .oh-my-zsh/custom/plugins
git clone [email protected]:sandstorm/oh-my-zsh-flow-plugin.git flow

Afterwards, add the flow plugin to your oh-my-zsh config list.

antigen

If you're using the Antigen framework (https://github.com/zsh-users/antigen), add antigen bundle sandstorm/oh-my-zsh-flow-plugin to your .zshrc Antigen will automatically clone and install the plugin the next time you open a new terminal session.

zgenom

If you're using the zgen framework (https://github.com/jandamm/zgenom), add zgenom load sandstorm/oh-my-zsh-flow-plugin to your .zshrc with your other zgenom load and/or zgen load statements. Zgenom will automatically clone and install the plugin the next time you run zgenom save.

Usage

Here, the features of the Flow helper are explained:

flow Command

The Flow plugin makes the flow command available inside every subdirectory of the Flow distribution. Thus, you can use flow instead of ./flow, and you do not have to be in the base directory of your distribution for it. Example:

cd <YourFlowDistribution>
./flow help    # this is the command you know already ;-)
flow help      # shortcut to the one above, saves you two keystrokes -- yeah!
cd Packages/Application/Acme.Demo
flow help      # now, that's actually quite cool, as the system will find the correct
               # flow CLI executable by traversing the parent directories

Tab Completion

You can use tab completion on the flow subcommands, and the system will intelligently auto-complete it. When autocompleting a fully written command, the full command reference is displayed:

flow <TAB>                            # list all currently installed commands with a short description
flow k<TAB>                           # autocompletes to "kickstart:"
flow kickstart:<TAB>                  # show all commands starting with "kickstart:"
flow kickstart:actioncontroller <TAB> # show the full help for kickstart:actioncontroller from Flow

Unit and Functional Testing

In order to save a few keystrokes when typing phpunit -c ..../Build/Common/PhpUnit/UnitTests.xml path/to/MyTest.php, there are two commands available: ffunctionaltest and funittest.

They, as well, can be called inside every subfolder of the Flow distribution:

cd <YourFlowDistribution>
funittest Packages/Application/Acme.Demo/Tests/Unit       # Runs all unit tests; lot of typing necessary
cd Packages/Application/Acme.Demo/
funittest Tests/Unit                                      # runs all unit tests, but with a lot less typing ;-)
ffunctionaltest Tests/Functional                          # runs the functional tests

Directly accessing Flow Packages using cd

Often, I find myself working for longer timespans in a particular Flow distribution, jumping between the different packages of the distribution very often. In order to save some keystrokes, I found the "cdpath" variable in ZSH, which can be defined like:

cdpath=(/..../FlowBase/Packages/Framework /..../FlowBase/Packages/Application)

Then, you can directly cd into any subdirectory of the directories in cdpath. This enables you to directly jump to all packages inside the distribution:

cd Acme.Demo
cd SandstormMedia.Plumber

In order to work with multiple distributions more easily, you should set the flow_distribution_paths variable inside your .zshrc to the base directories of all distributions:

flow_distribution_paths=(/Volumes/data/htdocs/FlowBase /Volumes/data/htdocs/PackageRepositoryDistribution /Volumes/data/htdocs/SandstormMediaFlowDistribution)

Then, you can use the f-set-distribution command to choose which distribution shall be active right now.

The system automatically updates the cdpath in ALL running zsh instances :-)

f-package-foreach

Often, I need to run some command in all packages. Before using composer, this was easy using git submodule foreach. This is why we install f-package-foreach which loops through all Flow packages; skipping all Packages/Libraries.

Usage:

f-package-foreach <your-command>

This command can be run from any subdirectory inside the current Flow distribution, and will always loop through all packages.

Internals

The system caches temporary files inside Data/Temporary/Development/.flow-autocompletion* in order to not invoke ./flow too often (to improve performance).

Future Ideas

If you have suggestions on how to improve this software, pull requests etc are highly appreciated :-)

Or you can contact me directly as well, I usually hang out as sebastian in slack.neos.io.

License

You can choose to use the LGPL or MIT license when you use this work.

oh-my-zsh-flow-plugin's People

Contributors

jirgn-cornelsen avatar jrenggli avatar kdambekalns avatar mhsdesign avatar mstruebing avatar skurfuerst avatar unixorn avatar visay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oh-my-zsh-flow-plugin's Issues

Plugin installation with zplug

I tried to add the plugin with zplug like this in my .zshrc

zplug "sandstorm/oh-my-zsh-flow-plugin", from:oh-my-zsh

But this does not work. If I add it like this:

zplug "sandstorm/oh-my-zsh-flow-plugin"

The command flow work, but the tab completion does not work. I got the same error like in issue #10

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.