https://github.com/nikitaivanovv/shortbashpwd
Shorter working directory in prompt like in fish shell
https://github.com/nikitaivanovv/shortbashpwd
bash bash-prompt fish fish-prompt prompt
Last synced: 3 months ago
JSON representation
Shorter working directory in prompt like in fish shell
- Host: GitHub
- URL: https://github.com/nikitaivanovv/shortbashpwd
- Owner: NikitaIvanovV
- License: mit
- Created: 2022-09-04T19:47:28.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-05T19:05:47.000Z (about 3 years ago)
- Last Synced: 2025-04-02T02:26:59.654Z (7 months ago)
- Topics: bash, bash-prompt, fish, fish-prompt, prompt
- Language: Shell
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
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:
## Installation
### Manual
```sh
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:```sh
make bashrc
```It will add append [`bashrc.bash`](bashrc.bash) to your `.bashrc` and
replace `FILE` with a location where [`shortbashpwd.bash`](shortbashpwd.bash) was installed.Uninstall with `sudo make uninstall`.
### AUR
If you are an Arch Linux user, you can install
[`shortbashpwd-git`](https://aur.archlinux.org/packages/shortbashpwd-git)
AUR package.```sh
yay -S shortbashpwd-git
```After installing the package, you will be asked to
run one command manually to finish the installation ([read why](#manual)):```sh
cat /usr/share/shortbashpwd/bashrc.bash >> ~/.bashrc
```