Skip to content

Commit 51a0288

Browse files
committed
added support for zsh
1 parent b6d71f9 commit 51a0288

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
It is often time-consuming to navigate your folder structure in a Bash terminal window, even with auto-complete.
44

5-
`cdf` is a simple set of utility functions that can be added to your `.bashrc` or `.bash_profile` file and will provide two quite useful new commands, `addfav` ("add to favorites") and `cdf` ("`cd` to favorite"):
5+
`cdf` is a simple set of utility functions that can be added to your `.bashrc` or `.bash_profile` file (or `~/.zshrc` for `zsh`) and will provide two quite useful new commands, `addfav` ("add to favorites") and `cdf` ("`cd` to favorite"):
66

77
## Demo
88

@@ -35,7 +35,7 @@ cdf papers
3535

3636
## Installation (UNIX/OSX only)
3737

38-
### Simple
38+
### Simple
3939

4040
1. Download the tool from Github to your computer
4141
- **Option 1:** With `git clone`:
@@ -65,16 +65,16 @@ cdf papers
6565
mkdir ~/myshortcuts
6666
```
6767
On OSX, it is better to put this somewhere under the `~/Documents` folder due to Apple's default permissions scheme.
68-
2. Depending on your system, open either `~/.bashrc` or `~/.bash_profile` with a text editor. You may need to turn on the display of hidden files (starting with a dot) in the OSX Finder with <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>.</kbd> (dot).
69-
3. At the end of the `~/.bashrc` or `~/.bash_profile` file, insert the following lines:
68+
2. Depending on your system, open either `~/.bashrc` or `~/.bash_profile` with a text editor (or `~/.zshrc` for `zsh`). You may need to turn on the display of hidden files (starting with a dot) in the OSX Finder with <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>.</kbd> (dot).
69+
3. At the end of the `~/.bashrc` or `~/.bash_profile` (or `~/.zshrc`) file, insert the following lines:
7070
```bash
7171
export CDFPATH=~/myshortcuts
7272
```
7373
Replace `~/myshortcuts` with the absolute path of your chosen directory for the shortcuts (e.g. `~/Documents/myshortcuts`; note that `~/` is a shortcut for your user directory on Unix systems; you can also use the full path.). **Save the file, but keep it open.**
74-
4. After these lines, insert the entire contents [from the `cdf.sh` file from this repository](https://raw.githubusercontent.com/mfhepp/cdf/main/cdf.sh). You can directly copy-and-paste it from the link. **Save and close the `~/.bashrc` or `~/.bash_profile` file.**
74+
4. After these lines, insert the entire contents [from the `cdf.sh` file from this repository](https://raw.githubusercontent.com/mfhepp/cdf/main/cdf.sh). You can directly copy-and-paste it from the link. **Save and close the `~/.bashrc` or `~/.bash_profile`** (or `~/.zshrc`) file.
7575
5. Open a new terminal window for the changes to take effect.
7676
77-
**Note:** Always backup your `~/.bashrc` or `~/.bash_profile` files prior to installing this tool. If not, please do not blame me if things go wrong. The install script tries to create backups automatically.
77+
**Note:** Always backup your `~/.bashrc` or `~/.bash_profile` (or `~/.zshrc` for `zsh`) files prior to installing this tool. If not, please do not blame me if things go wrong. The install script tries to create backups automatically.
7878
7979
### Installation for `zsh`
8080
@@ -206,7 +206,7 @@ Pictures/
206206
207207
This is because OSX, by default, grants at least read-access to all users on the given machine, via the `staff` usergroup.
208208
209-
If you were to use the `source` command to include the `cdf.sh` script within your `.bashrc` or `.bash_profile` file, you must make sure that the respective directory cannot be written to by other users. Otherwise, someone could inject arbitrary Bash commands into your environment. **This is why the install script instead *copies the contents of that script* to your Bash profile.**
209+
If you were to use the `source` command to include the `cdf.sh` script within your `.bashrc` or `.bash_profile` file (or `.zshrc` for `zsh`), you must make sure that the respective directory cannot be written to by other users. Otherwise, someone could inject arbitrary Bash commands into your environment. **This is why the install script instead *copies the contents of that script* to your Bash profile.**
210210
211211
## Credits and acknowledgments
212212

cdf.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# cdf.sh
4-
# Version 0.3.1
4+
# Version 0.4
55
# (C) 2024 by Martin Hepp, https://www.heppnetz.de
66
# Github repository: https://github.com/mfhepp/cdf
77
# Available under the MIT License

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# install.sh
4-
# Version 0.3.1
4+
# Version 0.4
55
# (C) 2024 by Martin Hepp, https://www.heppnetz.de
66
# Github repository: https://github.com/mfhepp/cdf
77
# Available under the MIT License

0 commit comments

Comments
 (0)