Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ ltcd Public

Changing directory more efficiently

License

dczhu/ltcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ltcd

Less Typing Changing Directory (cd)

Alt Text

Introduction

Inspired by acd_func.sh, ltcd provides the following features to make life easier:

  • Global dir listing, which shows recently visited dirs from all terminal tabs/windows.
  • Local dir listing, which is local to current shell session.
  • Both listings support quick navigation by using j/k (go down/up), numbers, and word searching.
  • Global free jumping (e.g. cd dir or cd ar to go to /path/to/foo/bar/directory/).

Installation

In ~/.bashrc:

  1. source the script h, which is a multi-color pattern highlighter.
  2. source the script cxpgrep, which is an exteded grep command that uses the command h.
  3. source the script ltcd, and the commands cd/cdrm/cdedit will be ready for use. The script ltcd uses the command cxpgrep.

Usage

  • Alt+A or cd -? brings up global dir list.
  • Alt+Q or cd -- brings up local dir list.
  • cd $word for free jumping - 'word' is any part of the FULL path of the dir to go.
  • If there is a list, follow the prompt to choose a path to go.
    • Use the keys j/k to navigate down/up the entries - A single backspace will remove the whole line - Be fast!
    • Type a number to select a specific entry (0 or empty means staying put).
    • Start a search by typing / and then the word.
  • This code is intended to be compatible with the original cd command - e.g. cd - brings you back to the previous dir.
  • Run cdrm to remove invalid entries in global bookkeeping. Invalid entries are removed/renamed/inaccessible dirs.
  • Run cdedit in case you want to edit the global bookkeeping. For example, if you feel some dirs with "tmp" in the path name are not useful to stay in the record, you can manually remove them with this command.

Note

The files created by ltcd are all at ~/.cd/ for cleanness and debugging purposes.

Releases

  • 1.0
    • First working code
  • 1.1
    • Function namespace cleanup
    • Merge cd_utils to ltcd
    • More info added to README

License

This software (ltcd) is distributed under the MIT license.