2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-16 02:23:22 +00:00
Hilbish/docs/api/hilbish/hilbish.abbr.md

1.7 KiB

title description layout menu
Module hilbish.abbr command line abbreviations doc
docs
parent
API

Introduction

The abbr module manages Hilbish abbreviations. These are words that can be replaced with longer command line strings when entered. As an example, git push can be abbreviated to gp. When the user types gp into the command line, after hitting space or enter, it will expand to git push. Abbreviations can be used as an alternative to aliases. They are saved entirely in the history Instead of the aliased form of the same command.

Functions

remove(abbr) Removes the named abbr.
add(abbr, expanded function, opts)

hilbish.abbr.add(abbr, expanded|function, opts)

Adds an abbreviation. The abbr is the abbreviation itself, while expanded is what the abbreviation should expand to. It can be either a function or a string. If it is a function, it will expand to what the function returns. opts is a table that accepts 1 key: anywhere. opts.anywhere defines whether the abbr expands anywhere in the command line or not, whereas the default behavior is only at the beginning of the line

Parameters

abbr string

expanded|function string

opts table


hilbish.abbr.remove(abbr)

Removes the named abbr.

Parameters

abbr string