Skip to content

NikitaIvanovV/shortbashpwd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shortbashpwd

I'm kinda old fashioned and I still prefer bash. But I tried using fish one day and I liked how it printed current working directory by default.

fish prompt

The prompt doesn't take a half of a screen width if you are working in some deeply nested directory because names of all the directories (except for the last one) are abbreviated.

I wanted to have a similar thing in bash, so I made a script that does it:

bash prompt

Installation

Manual

git clone https://github.com/NikitaIvanovV/shortbashpwd
cd shortbashpwd
sudo make install

After installing the script, you have to add a few lines to your .bashrc file in order to activate the script in your shell session on startup. You can do it by running this:

make bashrc

It will add append bashrc.bash to your .bashrc and replace FILE with a location where shortbashpwd.bash was installed.

Uninstall with sudo make uninstall.

AUR

If you are an Arch Linux user, you can install shortbashpwd-git AUR package.

yay -S shortbashpwd-git

After installing the package, you will be asked to run one command manually to finish the installation (read why):

cat /usr/share/shortbashpwd/bashrc.bash >> ~/.bashrc

About

Shorter working directory in prompt like in fish shell

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published