2025-02-01 23:06:34 +01:00
2024-11-17 09:41:36 +01:00
..
2025-02-01 16:05:04 +01:00
2025-01-23 08:58:02 +01:00
2025-02-01 23:05:47 +01:00

navigate

This repository implements a custom shell command for changing directories. I implemented this program to learn rust (because I was put on a rust project at work) and because I have two major problems with bashs builtin pushd/popd/dirs:

  • no option to suppress output on pushd/popd
  • rotates stack when pushing to stack entry (with +/-)

features

  • push - save path to the stack and change to specified directory
  • pop - pop one, or the specified amount of entries from the stack and move to the oldest one
  • stack - display the stack
  • book - move to, or add, remove and display bookmarks

Every shell has its own stack, save in the file /tmp/navigate/<process-id>. navigate checks for and deletes orphaned stack files on execution.

setup

navigate requires a setup

  1. clone the repository
  2. build crate
  3. add path to executable to shell environment
  4. source setup script navigate_bash_setup

configuration

The behaviour of navigate can be configured in the file $XDG_CONFIG_HOME/navigate/navigate.toml. It has the toml extension, but might not implement the full toml specification.

navigate will check for the file default.toml in the configuration directory and create it if not found. It contains all settings with default values and a short explanation. After an update one can delete the file and call any subcommand of navigate to get an updated default configuration.

The lines without type and value are categories and need to be defined as toml table ([table]) in the configuration file. Options are written as value = key. Style settings accept styles and one color in the following formats:

  • styles: bold, dim, italic, underlined, blinking, reversed, invisible, strikethrough
  • named color: black, red, green, yellow, blue, magenta, cyan, white
  • numbered color: 16..255
  • rgb color: #rrggbb

Note

: The styles and colors are applied as ansi escape sequences and I do not know a terminal which implements all sequences.

S
Description
custom implementation of pushd/popd/dirs
Readme GPL-3.0 165 KiB
Languages
Rust 97.9%
Shell 2.1%