You'll never want to use cd again.

Related tags

Command-line ToolsJmp
Overview

Jmp

Description

Have you ever used the cd command? You'll never touch that outdated thing again when you try jmp. Navigate your filesystem with unprecedented speed, agility, and dexterity NEVER seen before. Become a truly unstoppable force on the command line.

Given a set of regular expressions, jmp will intelligently search through your files and cd you into your intended directory. Instead of cd /Users/gholmes/Projects/Diviner/core/ (what a waste of time and energy, am I right?), just input jmp D c to achieve the exact same results. Arguments can be regular expressions and can "guide" the search to a final prediction.

This tool is also very useful if you only remember part of the name of place you want to go to, as you can run jmp .+ .+ and then theres a good chance you'll end up in the right place. Thanks, regex!

Before After

Intallation

Have a working installation of Python 3. The script only leverages standard libraries so no need for a requirements.txt, pip install, or anything like that.


Clone this repo:

$ git clone https://github.com/gholmes829/Jmp.git


Without changing folders from the place you ran git clone, run

Jmp/jmp_wrapper.sh; \ echo "\nsource \"$(pwd)/Jmp/jmp_wrapper.sh\"" >> ">
$ echo -e "SCRIPT_DIR=\"$(pwd)/Jmp\"\n\n$(cat Jmp/jmp_wrapper.sh)" > Jmp/jmp_wrapper.sh; \
  echo "\nsource \"$(pwd)/Jmp/jmp_wrapper.sh\"" >> 
    

    

where is the path to your .bashrc, .zshrc, or whatever else you use that gets run upon opening a terminal.

These commands will set everything up so that you can always access jmp from the terminal.

Optionally, you can rename the jmp command to something else. Setting alias dc=jmp in your terminal config file will now let you run dc D c (from the example above), where dc is now cd's evil nemesis.

Basic Usage

Basic usage is as follows

$ jmp expr_1 expr_2 ...expr_n

where each expr_i is a Python-compatible regex string, which of course includes plain text searches if you don't want to use fancy regex. The algorithm will perform a breadth first search through the file system, attempting to sequentially match expressions with files it encounters. Once the last expression has been matched and popped off, your cwd will be changed to the target directory. By default without using regex, the algorithm attempts to match files starting with the expr. You can instead jump to files ending with an "query" with jmp .*query$.

If you find yourself not wanting to type out a directory's name every time, you can use aliases. You can modify aliases.json to include a key-value pair that transforms your input. For example, adding "cc": "EECS 665" to aliases.json would make it so jmp cc gets interpreted as jmp EECS\ 665. This allows for shorter commands that get you to where you want.

If you don't want to waste compute time on deep directories that you know don't contain anything useful, you can use the blacklist. Any blacklisted term will not be evaluated. For example, adding "Documents" into blacklist.json prevents us from searching for or inside of the documents folder. This allows for a faster experience.

Run the following to learn more about flags (-b, -f, -d, -l, -s, etc)

$ jmp -h

Flags enable you to specify type of file to search, limit max search depth, set search root path, silence output, and more.

Lastly, take note of function variations/ aliases jmpa (run jmp from root), jmpf (search only for files), and jmpd (search only for directories). Since a major point of jmp is for convenience and to save time, it would make sense to use jmpd rather than jmp -d.

Considerations

You may find yourself doing some experimentation to learn how to get the best use out of this tool. If you excessively shorten your expressions, it is very likely you'll end up in a lexically similiar location that is different from what you intended. Using multiple strategic expressions will conversely speed up the operation by narrowing the search space. Considering the absolute worst case in terms of convenience, we can see that jmp converges to cd as each expression could be the next folder that you would need to cd to (e.g. jmp Projects Diviner core vs cd Projects/Diviner/core).

In other words, jmp is at least as convenient as cd and has potential to be a lot, lot better. However, if you try to drop too much information, you may lose accuracy. Try to use the minimal number of expressions while still retaining substrings or patterns unique to your target location.

Advanced Customization

Take a look at jmp.py. The code is pretty succinct and modular, so it shouldn't be too hard to modify the constraints for searching, matching, or even the traversal algorithm itself.

Owner
Grant Holmes
Grant Holmes
CLI to show end-of-life dates for tools and technologies.

Python 3.9+ interface to endoflife.date to show end-of-life dates for tools and technologies.

Hugo van Kemenade 32 Jan 06, 2023
Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Website

🤖 rover Rover is a command line interface application that allows through browse through mission data, images, metadata from the NASA Official Websit

Saketha Ramanjam 4 Jan 19, 2022
Code for "Salient Deconvolutional Networks, Aravindh Mahendran, Andrea Vedaldi, ECCV 2016"

deconvnet_analysis Code for "Salient Deconvolutional Networks, Aravindh Mahendran, Andrea Vedaldi, ECCV 2016" Parts of this code Generate figures in t

Aravindh Mahendran 12 Jan 25, 2021
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022
A Python-based Wordle solver and CLI player

Wordle A Python-based Wordle solver and CLI player This was created using Python 3.9.7. SPOILER ALERT: the data directory contains spoilers for upcomi

Will Fitzgerald 1 Jul 24, 2022
grungegirl is the hacker's drug encyclopedia. programmed in python for maximum modularity and ease of configuration.

grungegirl. cli-based drug search for girls. welcome. grungegirl is aiming to be the premier drug culture application. it is the hacker's encyclopedia

Eristava 10 Oct 02, 2022
A multipurpose discord bot with more than 220 commands

Welcome WM Bot A advanced bot with more than 220 commands to fit your needs Explore the commands » View Demo · Report Bug · Request Feature Table of C

Wasi Master 12 Dec 16, 2022
Shellmon is a tool used to create and control a webshell remotely, created using the Python3

An Simple PHP Webshell Manager Description Shellmon is a tool used to create and control a webshell remotely, created using the Python3 programming la

22XploiterCrew 12 Dec 30, 2022
Synchronization tool for external devices which does not support time stamps, e.g. over MTP.

MTP-Sync Tool to synchronize data to a slow device, e.g. a smartphone which is connected over MTP. A state file (.mtp_sync_state.json) is created in t

2 Jul 22, 2022
Command line tool for interacting and testing warehouse components

Warehouse debug CLI Example usage for Zumo debugging See all messages queued and handled. Enable by compiling the zumo-controller with -DDEBUG_MODE_EN

1 Jan 03, 2022
⌨ Toward a more useful keyboard

Toward a more useful keyboard Steve Losh's Modern Space Cadet is an inspiration. It opened my eyes to the fact that there's a more useful keyboard hid

Jason Rudolph 1.7k Jan 01, 2023
MiShell is a multi-platform, multi-architecture project based on the first version (MiShell32)

MiShell is a multi-platform, multi-architecture project based on the first version (MiShell32), which offers super super small reverse shell payloads great for injection in buffer overflow vulnerabil

Kamyar Hatamnezhad 0 Oct 27, 2022
Todo list console based application. Todo's save to a seperate file.

Todo list console based application. Todo's save to a seperate file.

1 Dec 24, 2021
pls is a better ls for developers, pronounced /pliːz/ as in 'please'

pls is a better ls for developers. The "p" stands for ("pro" as in "professional"/"programmer") or "prettier". It works in a manner similar to ls, in

Dhruv Bhanushali 572 Dec 28, 2022
A command line tool made in Python for the popular rhythm game

osr!name A command line tool made in Python for the popular rhythm game "osu!" that changes the player name of a .osr file (replay file). Example: Not

2 Dec 28, 2021
Play videos in the terminal.

Termvideo Play videos in the terminal (stdout). python main.py /path/to/video.mp4 Terminal size: -x output_width, -y output_height. Default autodetect

Patrick 11 Jun 13, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
CLI/GUI Math commands based on python 3

PyMath Commands Syntax Installation Commands: pymath add: usage: pymath add 12.5 12.5 sub: usage: pymath sub 25 12.5 div: usage: pymath div 144 12 mul

eggsnham07 0 Nov 22, 2021
Investing library and command-line interface inspired by the Bogleheads philosophy

Lakshmi (Screenshot of the lak command in action) Background This project is inspired by Bogleheads forum. Bogleheads focus on a simple but powerful p

Sarvjeet Singh 108 Dec 26, 2022
The Prisma Cloud CLI is a command line interface for Prisma Cloud by Palo Alto Networks.

Prisma Cloud CLI The Prisma Cloud CLI is a command line interface for Prisma Cloud by Palo Alto Networks. Support This project has been developed by P

Palo Alto Networks 13 Oct 14, 2022