lsx

❓ Why?

It’s a pain to cd and ls multiple times to reach desired directory in terminal. ls-Xtended (lsx) solves this problem by allowing users to smoothly navigate and search directories on the go with just one command. It also allows to create alias for paths making it easier for users to remember the path to the desired directory.

💻 Demo

Note: once you reach the desired destination, use ctr+c to exit and stay in the desired destination

Navigate through terminal and perform search:

  • use / to trigger search and start typing to search

lsx

lsx

Show hidden files as well

lsx -a

lsx

Set alias for directory paths

lsx set-alias -n somealias -p path/to/be/aliased

or

lsx set-alias --path-name somealias --path path/to/be/aliased

lsx

Updating Alias

set-alias can also be used to update any existing alias. Let’s say alias abc already exists for path a/b/c. on can update it like so:

lsx set-alias -n abc -p d/e/f

List alias created by user

lsx alias

lsx

Remove existing alias

lsx remove-alias aliasname

lsx

📋 Todo

  • make a logo
  • add icons
  • -a/--all mode
  • search
  • allow User can navigate to previous directory from the one they started (#1)

⚗️ Install

Note: make sure to have Go installed and your GOPATH is added to PATH

Step-1:

Clone the repo:

git clone https://github.com/souvikinator/lsx.git

Step-2:

cd lsx

chmod u+x install.sh

./install.sh

after installation is successful, add the following line at the end of your current running shell resource file (.zhsrc, .bashrc …)

source ~/.config/lsx/lsx.sh

and restart your terminal. Enjoy!

Note: Feel free to open an issue if any problems faced during installation.

If you liked the project, feel free to drop a star 🙂

🐜 Contribution

You can improve this project by contributing in following ways:

  • report bugs
  • fix issues
  • request features
  • asking questions (just open an issue)

and any other way if not mentioned here.

❗Known Issues

As of now the installation process is painful and the reason is a program runs as a child process in a terminal so eveything happens withing that child process. When we change the directory from go program the directory changes for that executable or to be specific “for that child process” and not of the shell. Which is why one needs to source a script in their shell resource file (.zshrc, .bashrc…).

The script contains a bash function as a wrapper around the lsx binary to make the whole cd thing work. This is what is prevent lsx to be distributed using some package manager.

If anyone can comeup with something then feel free to open issue.

GitHub

View Github