Giter VIP home page Giter VIP logo

ad's Introduction

ad

CI

Chdir with file-manager.

$ pwd
/path/to/directory

$ ad
/path/to/directory

dir1/
dir2/
file1.txt
file2.txt
(Up, up, up, move to another/, move to directory/, chdir and exit)

$ pwd
/another/directory

Usage

$ ad [<option(s)>]
chdir with file-manager.

options:
  -w, --wrapper=<shell>  output the wrapper script for the shell and exit
      --help             print usage and exit

supported-shells:
  sh, bash, zsh, yash, fish

environment-variables:
  AD_SHOW_HIDDEN_FILES  show hidden files if set to true (default: false)

keys:
  +       toggle show hidden files
  -       chdir to the parent directory in file-manager
  <CR>    chdir to the directory in file-manager
  <C-g>   quit file-manager and chdir to the last directory
  q       quit file-manager

Requirements

  • Bash (Even if you are not using Bash)
  • Vim

Installation

  1. Copy ad into your $PATH.
  2. Make ad executable.
  3. Add the following config to your shell's profile.
Shell
sh eval "$(ad -w sh)"
bash eval "$(ad -w bash)"
zsh eval "$(ad -w zsh)"
yash eval "$(ad -w yash)"
fish source (ad -w yash | psub)

Example

$ curl -L https://raw.githubusercontent.com/nil-two/ad/master/ad > ~/bin/ad
$ chmod +x ~/bin/ad
$ echo 'eval "$(ad -w bash)"' >> ~/.bashrc

Note: In this example, $HOME/bin must be included in $PATH.

Also, if you are using Bash, you can execute ad from a shortcut key by adding the following config to your .bashrc.

bind -x '"\C-g": ad'

Options

-w, --wrapper=<shell>

Output the wrapper script for the shell and exit. If you load the script, you will be able to chdir when you press <C-g> in file-manager.

Supported shells are as follows:

  • sh
  • bash
  • zsh
  • yash
  • fish
$ eval "$(ad -w sh)"
(Enable the shell integration for the shell compatible with Bourne Shell)

$ eval "$(ad -w bash)"
(Enable the shell integration for Bash)

$ eval "$(ad -w zsh)"
(Enable the shell integration for Zsh)

$ eval "$(ad -w yash)"
(Enable the shell integration for Yash)

$ source (ad -w fish | psub)
(Enable the shell integration for Fish)

--help

Print usage and exit.

$ ad --help
(Print usage)

Variables

AD_SHOW_HIDDEN_FILES

Show hidden files from the start if set to true. The default value is false.

# Show hidden files from the beginning
export AD_SHOW_HIDDEN_FILES=true

License

MIT License

Author

nil2 [email protected]

ad's People

Contributors

nil-two 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.