Skip to content

kot149/posh-abbr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

posh-abbr

Auto-expand abbreviations for PowerShell. Inspired by zsh-abbr.

Installation

Clone this repository to a local folder:

git clone https://github.com/kot149/posh-abbr

Then import the module and define abbrs in your PowerShell profile:

edit $profile
Import-Module 'C:\path\to\posh-abbr\posh-abbr.psd1' -Force

abbr g git
abbr 'git ch' 'git checkout'
abbr 'git cm' 'git commit -m "%"'

With the above example,

  • Type space or enter after g to expand it to git
  • Type space or enter after git ch to expand it to git checkout
  • Type space or enter after git cm to expand it to git checkout -m "" and move cursor into the quatation

Notes:

  • Expansions are applied when the cursor is at the end of the line.
  • Use % in the expansion to specify the cursor position after expansion (the % itself is removed).

About

Auto-expand abbreviations for PowerShell

Topics

Resources

License

Stars

Watchers

Forks