GithubHelp home page GithubHelp logo

auto-ls's Introduction

Auto-ls

There are many auto-lss out there but this one is mine.

Features

  • Custom command on cwd/enter-key
  • Auto ls on cwd
  • Auto ls on enter-key (with empty buffer)
  • Git status on a git work tree

Install

  • Manual

    curl -L https://git.io/auto-ls > /path/to/auto-ls.zsh
    source /path/to/auto-ls.zsh
    
  • Antigen

    antigen bundle desyncr/auto-ls
    
  • zplugin

    zplugin ice wait'0' lucid
    zplugin load desyncr/auto-ls
    

Configuration

  • AUTO_LS_COMMANDS: Use this configuration option to define the functions to run on cwd/enter-key.

Example: AUTO_LS_COMMANDS=(ls git-status)

  • AUTO_LS_NEWLINE: Configure ls to put a newline (Default: true).

Example: AUTO_LS_NEWLINE=false

  • AUTO_LS_PATH: Detect command full path to execute (Default: true).

Example: AUTO_LS_PATH=false

  • AUTO_LS_CHPWD: Enable/disable auto-ls on directory change (Default: true)

Example: AUTO_LS_CHPWD=false

Customization

You can configure commands in order to execute on cwd/ls, example:


AUTO_LS_COMMANDS=(ls git-status '/usr/bin/git log')
# Or...
AUTO_LS_COMMANDS=(ls git-status '[[ -d $PWD/.git ]] && /usr/bin/git log|head')

You may redefine default functions or define custom functions to be run on cwd/enter-key:

  • Before loading auto-ls define a function to be executed:

    auto-ls-custom_function () {
      echo "Current directory list:"
      ls -ltra
    }
    
    • Be sure to call it auto-ls-<name of your function>.
  • Configure auto-ls to load your function. Put the following line before sourcing auto-ls:

    AUTO_LS_COMMANDS=(custom_function)
    
    • Only use <name of your function> rather than auto-ls-<name of your function>.

You may as well load the default functions, ls and git-status:

 AUTO_LS_COMMANDS=(ls git-status custom_function)

Future

  • zstyle options to customize ls options
  • zstyle options to customize git status

auto-ls's People

Contributors

desyncr avatar tiifuchs avatar ntninja avatar omares avatar rohitchormale 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.