All Projects → zpm-zsh → Autoenv

zpm-zsh / Autoenv

Licence: gpl-3.0
Autoenv for zsh

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Autoenv

Z.lua
⚡ A new cd command that helps you navigate faster by learning your habits.
Stars: ✭ 2,164 (+1551.91%)
Mutual labels:  zsh, zsh-plugin, plugin
Kube Aliases
Kubernetes Aliases and Bash Functions
Stars: ✭ 40 (-69.47%)
Mutual labels:  zsh, zsh-plugin
Zsh Lazyload
zsh plugin for lazy load commands and speed up start up time of zsh
Stars: ✭ 33 (-74.81%)
Mutual labels:  zsh, plugin
Zsh Abbrev Alias
This zsh plugin provides functionality similar to Vim's abbreviation expansion.
Stars: ✭ 84 (-35.88%)
Mutual labels:  zsh, zsh-plugin
Zsh You Should Use
📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
Stars: ✭ 659 (+403.05%)
Mutual labels:  zsh, zsh-plugin
Fzf Tab
Replace zsh's default completion selection menu with fzf!
Stars: ✭ 761 (+480.92%)
Mutual labels:  zsh, zsh-plugin
Fzf Widgets
ZLE widgets of fzf
Stars: ✭ 72 (-45.04%)
Mutual labels:  zsh, zsh-plugin
Zsh Better Npm Completion
Better completion for npm
Stars: ✭ 346 (+164.12%)
Mutual labels:  zsh, zsh-plugin
Zsh Snap
⚡️ Znap! A fast & light-weight plugin manager & Git repo manager for Zsh.
Stars: ✭ 98 (-25.19%)
Mutual labels:  zsh, zsh-plugin
Calc.plugin.zsh
zsh calculator - with support for basic math
Stars: ✭ 105 (-19.85%)
Mutual labels:  zsh, plugin
Zsh Nvm
Zsh plugin for installing, updating and loading nvm
Stars: ✭ 1,670 (+1174.81%)
Mutual labels:  zsh, zsh-plugin
Zsh Autocomplete
🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
Stars: ✭ 641 (+389.31%)
Mutual labels:  zsh, zsh-plugin
Zsh Z
Jump quickly to directories that you have visited "frecently." A native ZSH port of z.sh.
Stars: ✭ 562 (+329.01%)
Mutual labels:  zsh, zsh-plugin
Pctl
zsh plugin for proxy
Stars: ✭ 6 (-95.42%)
Mutual labels:  zsh, zsh-plugin
Fz
Cli shell plugin, the missing fuzzy tab completion feature of z jump around command.
Stars: ✭ 359 (+174.05%)
Mutual labels:  zsh, zsh-plugin
Zsh Fzy
Use the fzy fuzzy-finder in Zsh
Stars: ✭ 48 (-63.36%)
Mutual labels:  zsh, plugin
Zsh Abbr
The zsh manager for auto-expanding abbreviations, inspired by fish shell.
Stars: ✭ 109 (-16.79%)
Mutual labels:  zsh, zsh-plugin
History Search Multi Word
Multi-word, syntax highlighted history searching for Zsh
Stars: ✭ 314 (+139.69%)
Mutual labels:  zsh, zsh-plugin
Dotbare
Manage dotfiles and any git directories interactively with fzf
Stars: ✭ 327 (+149.62%)
Mutual labels:  zsh, zsh-plugin
Zui
⬢ Zsh User Interface library – CGI+DHTML-like rapid application development with Zsh
Stars: ✭ 95 (-27.48%)
Mutual labels:  zsh, zsh-plugin

Autoenv

Until recently, the default file name used by this plugin was .env, but now it is .in. This is done in order not to conflict with .env files from numerous projects.

Autoenv automatically sources (known/whitelisted) .in and .out files.

This plugin adds support for enter and leave events. By default .in files are used when entering a directory, and .out files when leaving a directory. And you can set variable CLICOLOR=1 for enabling colored output.

The environment variables $AUTOENV_IN_FILE & $AUTOENV_OUT_FILE can be used to override the default values for the file names of .in & .out respectively.

Example of use

  • If you are in the directory /home/user/dir1 and execute cd /var/www/myproject this plugin will source the following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out
/var/.in
/var/www/.in
/var/www/myproject/.in
  • If you are in the directory / and execute cd /home/user/dir1 this plugin will source the following files if they exist
/home/.in
/home/user/.in
/home/user/dir1/.in
  • If you are in the directory /home/user/dir1 and execute cd / this plugin will source the following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out

Examples of .in and .out files

Please, don't use pwd or $PWD, instead of this use $(dirname $0). Additionally, the path of the directory being entered or exited is passed as the first argument to both .in and .out scripts, should using a symlink be preferred.

For node.js developing:

.in

nvm use node
OLDPATH=$PATH
export PATH="$(dirname $0)/node_modules/.bin":$PATH

.out

nvm use system
export PATH=$OLDPATH

For projects with .env or/and .env.local

source $(dirname $0)/.env*

Prerequisites

This plugin depends on zsh-colors.

If you don't use zpm, install it manually and activate it before this plugin. If you use zpm you don’t need to do anything

Installation

Using zpm

Add zpm load zpm-zsh/autoenv into .zshrc

Using oh-my-zsh

Execute git clone https://github.com/zpm-zsh/autoenv ~/.oh-my-zsh/custom/plugins/autoenv. Add autoenv into plugins array in .zshrc

Using antigen

Add antigen bundle zpm-zsh/autoenv into .zshrc

Using zgen

Add zgen load zpm-zsh/autoenv into .zshrc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].