/shell-plugins

Custom shell (sh, bash, zsh) plugins

Primary LanguageShellGNU Lesser General Public License v3.0LGPL-3.0

shell-pluginsBuild Status

How to install

With antigen

  • Having antigen properly installed, just run:

      antigen bundle gmatheu/zsh-plugins *plugin-name*
    

Current Plugins

npm-scripts

Helper functions to fastly search and execute npm scripts ndy tools to create, activate and manage identities in a ssh-agent

asciicast

Usage

npm-run-scripts-find

Find and show script name

npm-run-scripts

Find script and execute selected script. If a yarn.lock is detected, uses yarn instead of npm

npm-run-scripts-show

Find script and show its content

fzf

Installs fzf (command line fuzzy finder) and provides some functions using it.

Functions

git

Git

Functions

  • git_remote_to_https: Switches git remote url from ssh to https
  • git_remote_to_ssh: Switches git remote url from https to ssh
  • git_switch_remote or alias grs: Toggles git remote url from https to ssh and backwards

profile-secrets

It allows you to securely keep sensitive variables (api tokens, passwords, etc) as part of your terminal init files. Using gpg to encrypt/decrypt the file with your secrets.

Usage

  • Define GPG_ID with gpg to encrypt data:

    export GPG_ID=my_gpg_id@gpg.org
    
  • Create secrets file (by default ~/.profile-secrets/secrets.sh) is where sensitive data is stored. Calling profile-secrets-encrypt will create it. E.g:

    export GITHUB_TOKEN=123
    export AWS_TOKEN=abc
    
  • Encrypt secrets file. It will ask for gpg keys password if required:

    profile-secrets-encrypt
    
  • Add secrets variables to current session:

    profile-secrets-source
    
Encrypt

Functions

  • profile-secrets-decrypt: Decrypts secret file.
  • profile-secrets-encrypt: Encrypts secret file. First time it is called will create secrets file
  • profile-secrets-source: Decrypts secrets file, source it and encrypts it back.

ssh-agent

Handy tools to create, activate and manage identities in a ssh-agent

asciicast

Usage

  • Create and ssh-agent
ssh-agent-create
  • Activate create ssh-agent
ssh-agent-activate-current
  • List loaded identities (requires fzf)
ssh-agent-list-identities
  • Add an indetity with fuzzy search (requires fzf)
ssh-agent-add-identity
  • Add several identities with fuzzy search (requires gum)
ssh-agent-add-identity

zplug-helper

Quickly shows markdowns documentation of zplug plugins

asciicast

Other Plugins

  • password-store: Aliases and function to work with pass (including fzf integration)
  • version-managers: Lazy loading and installation of several version managers (rvm, nvm, pyenv, sdkman!)
  • explain-shell: To open commans on explainshell.com
  • dirrc: Execute custom file (.dirrc) when entering a directory
  • docker: Docker aliases and functions
  • notify: OSD Notifier functions