You'll never want to use cd again.

Related tags

CLI Tools Jmp
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.

You might also like...
Hack-All is a simple CLI tool that helps ethical-hackers to make a reverse connection without knowing the target device in use is it computer or phone
Hack-All is a simple CLI tool that helps ethical-hackers to make a reverse connection without knowing the target device in use is it computer or phone

Hack-All is a simple CLI tool that helps ethical-hackers to make a reverse connection without knowing the target device in use is it computer

CLI Web-CAT interface for people who use VIM.

CLI Web-CAT CLI Web-CAT interface. Installation git clone https://github.com/phuang1024/cliwebcat cd cliwebcat python setup.py bdist_wheel sdist cd di

CLTools provides various tools and command to use in the terminal.
CLTools provides various tools and command to use in the terminal.

CLTools provides various tools and command to use in the terminal. As of date, CLTools is only able to generate temporary email addresses and receive emails. There are plans to integrate more tools and options in the future.

Command-line tool to use LNURL with your LND instance

LND LNURL Commandline tool to use LNURL payRequest and withdrawRequest with LND. Usage: Customize config lndlnurl.conf Run python main.py LNURL Dock

A simple and easy-to-use CLI parse tool.

A simple and easy-to-use CLI parse tool.

A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE.

What? A command-line tool to flash python code to Codey Rocky without having to use the online mblock5 IDE. Description This is a very low-effort proj

Todo - You could use terminal to set your todo
Todo - You could use terminal to set your todo

Python Tutorial You can learn how to build a terminal application(CLI applicatio

Wik is use to get information about anything on the shell using Wikipedia.
Wik is use to get information about anything on the shell using Wikipedia.

WIK wik is a tool to view wikipedia pages from your terminal. It also let you search for any wikipedia up to date article on one query from your termi

🍦 Never use print() to debug again.

IceCream -- Never use print() to debug again Do you ever use print() or log() to debug your code? Of course you do. IceCream, or ic for short, makes p

Never use print for debugging again

PySnooper - Never use print for debugging again PySnooper is a poor man's debugger. If you've used Bash, it's like set -x for Python, except it's fanc

A python script that will automate the boring task of login to the captive portal again and again

A python script that will automate the boring task of login to the captive portal again and again

Never miss a deadline again

Hack the Opportunities Never miss a deadline again! Link to the excel sheet Contribution This list is not complete and I alone cannot make it whole. T

Never get booted from a game for inactivity ever again

Anti AFK Bot Never get booted from a game for inactivity ever again! Built With Python Installation Clone the repo git clone https://github.com/lippie

Never get kicked for inactivity ever again!

FFXIV AFK Bot Tired of getting kicked from games due to inactivity? This Bot will make random movements in random intervals to prevent you from gettin

First and foremost, we want dbt documentation to retain a DRY principle. Every time we repeat ourselves, we waste our time. Second, we want to understand column level lineage and automate impact analysis.

dbt-osmosis First and foremost, we want dbt documentation to retain a DRY principle. Every time we repeat ourselves, we waste our time. Second, we wan

Smilecreator4 - This site is for people who want to hack or want to learn it!

smilecreator4 This site is for people who want to hack or want to learn it! Furthermore, this program does not work without turning off Antivirus or W

Generate your own QR Code and scan it to see the results! Never use it for malicious purposes.

QR-Code-Generator-Python Choose the name of your generated QR .png file. If it happens to open the .py file (the application), there are specific comm

RepVGG: Making VGG-style ConvNets Great Again
RepVGG: Making VGG-style ConvNets Great Again

RepVGG: Making VGG-style ConvNets Great Again (PyTorch) This is a super simple ConvNet architecture that achieves over 80% top-1 accuracy on ImageNet

Share constant definitions between programming languages and make your constants constant again

Introduction Reconstant lets you share constant and enum definitions between programming languages. Constants are defined in a yaml file and converted

Owner
Grant Holmes
Grant Holmes
Konsave lets use save your KDE Plasma customizatios and restore them very easily!

Konsave (Save Plasma Customization) A CLI program that will let you save and apply your KDE Plasma customizations with just one command! Als

null 439 Jan 2, 2023
Fetch is use to get information about anything on the shell using Wikipedia.

Fetch Search wikipedia article on command line [Why This?] [Support the Project] [Installation] [Configuration] Why this? Fetch helps you to quickly l

Yash Singh 340 Dec 18, 2022
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

Nathan Reed 15 Sep 22, 2022
👻 Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal.

?? Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal. It c

Billy 11 Nov 10, 2021
A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

A ZSH plugin that enables you to use OpenAI's powerful Codex AI in the command line.

Tom Dörr 976 Jan 3, 2023
Easy-to-use terminal program that can compile your code.

Description Easy-to-use terminal program that can compile your code. Installition 1. Cloning repository $ git clone https://github.com/DarkJoij/Compil

DarkJoij 1 Oct 21, 2021
A selfbot made with DPY, doesn't have much commands but there's some useful commands to use.

Phantom Selfbot A selfbot made in DPY, made by Zenith. How to use Add your token in token = 'YOUR-MOMS-TOKEN-HERE' Change the prefix in prefix = > If

[Ͼ⁴] Ƶephyr 2 Dec 2, 2021
A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands

PIGIT A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands. For example: git status --short, this project c

Zachary 1 Apr 9, 2022
Use case: quick JSON processing/restructuring with jq without terminal

alfred-jq Alfred workflow to conveniently process JQ on clipboard based on a jq query Also available at: packal/jq Use case: quick JSON processing/res

T on Meta Mode 5 Sep 30, 2022
A useful and easy to use Terminal Timer made with Python.

Terminal SpeedCubeTimer Installation ¡No requirements! Just Download and play Usage Starts timer.py and you will see this. python timer.py Scramble

Achalogy 5 Dec 22, 2022