Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

tiawl-archives/flagbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flagbox - a 2-keys bookmarks written in bash



Did you ever see those typed commands in a terminal before? Whatever your answer, I am convinced that you find it ambiguous and not friendly-user. You are right: Flagbox was not conceived with friendly-usage in mind. It was conceived for user efficiency. For this purpose friendly-user aspect was not a priority during Flagbox conception. If you are searching a tool which allows you to make a similar job with a more friendly usage, you can go to the Credit section. Most of them inspired the creation of Flagbox.

Flagbox is a mark manager. It allows you to save the directory you are in and jump it later.

Basic usage

Saving a directory is easy. If your Flagbox settings are default settings, when you launch your terminal you have an empty box. Type ? to see your current box content:



Here Flagbox is saying that your current box is empty. After entering , and typing ? again, you can easily understand that the , mark is used for the directory where you entered ,.



Now if you are changing directory (exemple: /tmp directory) and you are typing ,, you will come back to the directory pointed by , mark. Full comma aliases are used by Flagbox to save directory and jump it later. By default, you can save up to 3 marks in a box (,, ,, and ,,, marks). You can change this setting later.

What now if you want to erase a mark that you will not use anymore? Flagbox generates resetting aliases for this purpose. Let's assume that your current box is built with the following content:



Resetting a mark is a bit tricky but really easy to use when you understand the mechanism. To reset a mark you have to build a string composed with ? and , characters. A comma means "keep the matched mark" and a question mark means "reset the matched mark". For the above box, if you type: ?,? you will:

  1. reset , mark,
  2. keep ,, mark,
  3. and reset ,,, marks

Why? Because for the first and third alias' indexes, you placed ? characters.



Now that you know how to save a directory, delete a mark, use a mark and list marks you defined, you have enough background for a basic usage of this tool. If you want to learn about advanced features, you can read the documentation

Installation

Flagbox will source a script. This script will generate aliases described in the documentation, will build 1 function and will define 1 environment variable (1 associated array) in your current shell. If this specification is not respected, please open an issue, I will fix it. If it is OK to integrate this specification in your workspace, here are the steps:

  1. git clone https://github.com/pabtomas/flagbox.git
  2. copy flagbox/sourceme.sh where you want:
cp flagbox/sourceme.sh ${WHERE_YOU_WANT}
  1. sourceme.sh generates aliases in the shell where it is sourced so you have to put this line in your ~/.bashrc or your ~/.bash_aliases (which should be sourced in your ~/.bashrc):
source ${WHERE_YOU_WANT}/sourceme.sh

Contribution

I would be very grateful for anybody wanting to contribute anything. Here are the instructions.

Credit

About

Bookmarks written in Bash for learning purpose

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors