Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ By leveraging these plugins, you can streamline your workflow and tackle coding
| cargo | Plugin to initialize CARGO_HOME and PATH for cargo |
| colored-man-pages | Adds a few colors to `man` pages. |
| chezmoi | Dotfile management tool enabling management of user environment configuration. |
| direnv | Load and unload environments automatically when changing directory paths. |
| dotnet | This plugin provides completion and useful aliases for .NET Core CLI. |
| fasd | Utility easing filesystem navigation through shortcuts and abbreviated commands. |
| fzf | A command-line fuzzy finder. |
Expand Down
11 changes: 11 additions & 0 deletions plugins/direnv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# direnv plugin

The direnv plugin enables direnv hooks to load and unload environment variables depending on current directory.

To use it, install
[direnv](https://github.com/direnv/direnv#basic-installation) and add direnv
to the plugins array of your bashrc file:

```bash
plugins=(... direnv)
```
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
9 changes: 9 additions & 0 deletions plugins/direnv/direnv.plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! bash oh-my-bash.module

# Check if direnv is installed
if _omb_util_command_exists direnv; then
# Set up direnv shell hooks
eval -- "$(direnv hook bash)"
else
_omb_util_print '[oh-my-bash] direnv not found, please install it from https://github.com/direnv/direnv' >&2
fi