Skip to content

This repository contains my customized zhsrc configuration, inspired by the Kali Linux terminal setup

License

Notifications You must be signed in to change notification settings

VictorFantucci/terminal-fancy_zhs_prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

FANCY ZHSRC PROMPT

This repository contains my customized zshrc configuration, inspired by the Kali Linux terminal setup.

Features

  • Customized Prompt: The prompt is designed to be visually appealing and functional.

  • Python-centric: As I primarily code in Python, this configuration includes a helpful cd() function.

    • The cd() function automates the activation and deactivation of virtual environments.

    • When navigating into a directory containing a virtual environment (./env), it automatically activates the environment.

    • If already in a virtual environment and navigating out of it, the function deactivates the environment.

      • For Python developers like me, navigating through project directories can be a frequent task. That's why I've added a handy feature to the cd() function:
      function cd() {
        builtin cd "$@"
      
        if [[ -z "$VIRTUAL_ENV" ]] ; then
          ## If env folder is found then activate the virtualenv
          if [[ -d ./env ]] ; then
            source ./env/bin/activate
          fi
        else
          ## check if the current folder belongs to an earlier VIRTUAL_ENV folder
          # if yes, do nothing
          # else, deactivate
          parentdir="$(dirname "$VIRTUAL_ENV")"
          if [[ "$PWD"/ != "$parentdir"/* ]] ; then
            deactivate
          fi
        fi
      }

    With this function, whenever you change directories, it automatically activates a virtual environment if it finds one in the env folder. This saves you the hassle of manually activating it every time you switch projects.

Usage

  1. Clone the repository to your local machine:

    git clone https://github.com/VictorFantucci/fancy_zhs-prompt.git
  2. Copy the .zshrc file to your home directory:

    cp fancy_zhs_prompt/.zshrc ~/.zshrc
  3. Source the .zshrc file to apply the changes:

    source ~/.zshrc

Contribution

Feel free to contribute to this repository by suggesting improvements or additional features. Fork the repository, make your changes, and submit a pull request. Your contributions are highly appreciated!

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Additional Resources

About

This repository contains my customized zhsrc configuration, inspired by the Kali Linux terminal setup

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages