flesh out docs
This commit is contained in:
parent
c2a8825b21
commit
062034e147
59
README.org
59
README.org
@ -1,5 +1,6 @@
|
||||
#+TITLE: ohmyksh
|
||||
|
||||
** About
|
||||
Have your cake and eat it too!
|
||||
|
||||
~ohmyksh~ is a framework for expanding OpenBSD's [[https://man.openbsd.org/ksh][ksh]]. It offers:
|
||||
@ -33,47 +34,55 @@ Have your cake and eat it too!
|
||||
| [[file:extensions/git-prompt.org][git-prompt]] | A port of git-prompt for KSH. |
|
||||
| [[file:extensions/got.org][got]] | Adds PS1 support for got, as well as a few helper functions. |
|
||||
| [[file:extensions/k.org][k]] | A tool to quickly change directories. |
|
||||
| [[file:extensions/keychain.org][keychain]] | Wrapper for [[https://www.funtoo.org/Keychain][Funtoo's Keychain]] utility. |
|
||||
| [[file:extensions/nocolor.org][nocolor]] | Disable terminal color options for many tools. |
|
||||
| [[file:extensions/openbsd.org][openbsd]] | A set of tools for working with the OpenBSD source trees. |
|
||||
| [[file:extensions/pkgup.org][pkgup]] | Utility to speed up OpenBSD' [[https://man.openbsd.org/pkg_add][pkg_add(1)]]. |
|
||||
|
||||
|
||||
** Prompts
|
||||
|
||||
| Name | Example | Extensions used |
|
||||
|------------+--------------------------------+-----------------|
|
||||
| [[file:prompts/q.org][q]] | ~qbit@litr[0]:~$~ | git-prompt, got |
|
||||
| Name | Example | Extensions used |
|
||||
|------------+-------------------------------+-----------------|
|
||||
| [[file:prompts/q.org][q]] | ~qbit@litr[0]:~$~ | git-prompt, got |
|
||||
| [[file:prompts/plain.org][plain]] | ~litr:~/src/ohmyksh/prompts$~ | - |
|
||||
| [[file:prompts/og-openbsd.org][og-openbsd]] | ~$~ | - |
|
||||
| [[file:prompts/9.org][9]] | ~%~ | - |
|
||||
| [[file:prompts/og-openbsd.org][og-openbsd]] | ~$~ | - |
|
||||
| [[file:prompts/9.org][9]] | ~%~ | - |
|
||||
|
||||
** Example usage
|
||||
|
||||
#+begin_src shell
|
||||
OHMYKSH_DIR=${HOME}/src/ohmyksh
|
||||
. ${OHMYKSH_DIR}/ohmy.ksh
|
||||
# ohmyksh needs to know where it lives, so we tell it via this env var:
|
||||
OHMYKSH_DIR=${HOME}/src/ohmyksh
|
||||
|
||||
set -A my_paths -- \
|
||||
/usr/ports/infrastructure/bin \
|
||||
~/bin \
|
||||
~/go/bin \
|
||||
/usr/local/plan9/bin
|
||||
# Now we can load everything up!
|
||||
. ${OHMYKSH_DIR}/ohmy.ksh
|
||||
|
||||
paths "${my_paths[@]}"
|
||||
# All the paths we use (in order!)
|
||||
set -A my_paths -- \
|
||||
/usr/ports/infrastructure/bin \
|
||||
~/bin \
|
||||
~/go/bin \
|
||||
/usr/local/plan9/bin
|
||||
|
||||
load_extension fonts
|
||||
load_extension k
|
||||
load_extension nocolor
|
||||
load_extension openbsd
|
||||
paths "${my_paths[@]}"
|
||||
|
||||
load_completion ssh
|
||||
load_completion vmd
|
||||
load_completion rc
|
||||
load_completion gopass
|
||||
load_completion git
|
||||
# Load our various extensions
|
||||
load_extension fonts
|
||||
load_extension k
|
||||
load_extension nocolor
|
||||
load_extension openbsd
|
||||
|
||||
alias vi=vim
|
||||
# Load handy completions for various things
|
||||
load_completion ssh
|
||||
load_completion vmd
|
||||
load_completion rc
|
||||
load_completion gopass
|
||||
load_completion git
|
||||
|
||||
# the q prompt auto-loads the git-prompt extension
|
||||
set_prompt q
|
||||
alias vi=vim
|
||||
|
||||
# the q prompt auto-loads the git-prompt extension
|
||||
set_prompt q
|
||||
#+end_src
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
#+TITLE: Extensions: fonts
|
||||
|
||||
** Load fonts from common locations
|
||||
|
||||
If ~$DISPLAY~ is set, the ~fonts~ extension will load fonts from common
|
||||
locations.
|
||||
|
||||
Currently the locations are:
|
||||
|
||||
| Directory | Recursive |
|
||||
|--------------------------+-----------|
|
||||
| ~/.fonts | no |
|
||||
| ~/.local/share/fonts | no |
|
||||
| /usr/local/share/fonts/* | yes |
|
||||
|
@ -1,4 +1,4 @@
|
||||
* fzf
|
||||
#+TITLE: Extensions: fzf
|
||||
|
||||
** Functions
|
||||
| Name | Description |
|
||||
|
@ -1,4 +1,6 @@
|
||||
* git-prompt
|
||||
#+TITLE: Extensions: git-prompt
|
||||
|
||||
** About
|
||||
|
||||
This extension is a port of the [[https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh][packaged git-prompt]] script to OpenBSD's ksh.
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
* got
|
||||
#+TITLE: Extensions: got
|
||||
|
||||
** Helper Functions
|
||||
|
||||
This extension adds helper functions to the [[https://gameoftrees.org/][got]] tool.
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
* keychain
|
||||
#+TITLE: Extensions: keychain
|
||||
|
||||
The ~keychain~ gives you a convenient place to auto-start / load your various
|
||||
agents (ssh, gpg).
|
||||
|
||||
** Variables
|
||||
|
||||
- KEYCHAIN_OPTS :: --gpg2 --inherit any --agents ssh,gpg -q -Q
|
||||
| Option | Default |
|
||||
|---------------+---------------------------------------------|
|
||||
| KEYCHAIN_OPTS | --gpg2 --inherit any --agents ssh,gpg -q -Q |
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
* nocolor
|
||||
#+TITLE: Extensions: nocolor
|
||||
|
||||
** nocolor
|
||||
|
||||
This extension attempts to disable terminal color for known programs /
|
||||
libraries. [[https://no-color.org/][no-color]] was used as a guide!
|
||||
|
@ -1,4 +1,6 @@
|
||||
* openbsd
|
||||
#+TITLE: Extensions: openbsd
|
||||
|
||||
** About
|
||||
|
||||
This extension adds a number of useful OpenBSD specific tools.
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
* pkgup
|
||||
#+TITLE: Extensions: pkgup
|
||||
** About
|
||||
|
||||
~pkgup~ uses [[https://github.com/neutralinsomniac/obsdpkgup][obsdpkgup]] to provide [[https://man.openbsd.org/pkg_add][pkg_add]] a shortened list of packages that need
|
||||
updating. For more information on how this works, see `obsdpkgup`'s
|
||||
~pkgup~ uses [[https://github.com/neutralinsomniac/obsdpkgup][obsdpkgup]] to provide [[https://man.openbsd.org/pkg_add][~pkg_add~]] a shortened list of packages that need
|
||||
updating. For more information on how this works, see ~obsdpkgup~'s
|
||||
[[https://github.com/neutralinsomniac/obsdpkgup#rationale][documentation]].
|
||||
|
||||
| Function | Description |
|
||||
|
@ -0,0 +1,16 @@
|
||||
#+TITLE: Prompts: 9
|
||||
|
||||
** An homage to plan9
|
||||
|
||||
If you have ever used ~rc~ on plan9 or from plan9port, you will recognize this
|
||||
prompt!
|
||||
|
||||
Extremely minimal:
|
||||
|
||||
#+begin_src shell
|
||||
% uname -a
|
||||
OpenBSD tal.tapenet.org 6.9 GENERIC.MP#394 amd64
|
||||
% uptime
|
||||
1:34PM up 5:36, 1 user, load averages: 0.27, 0.21, 0.19
|
||||
%
|
||||
#+end_src
|
@ -0,0 +1,14 @@
|
||||
#+TITLE: Prompts: og-openbsd
|
||||
|
||||
** Blast from the past
|
||||
|
||||
Back in the day OpenBSD's default ksh prompt was simply: ~$ ~! For root it was
|
||||
~# ~.
|
||||
|
||||
#+begin_src shell
|
||||
$ uname -a
|
||||
OpenBSD tal.tapenet.org 6.9 GENERIC.MP#394 amd64
|
||||
$ uptime
|
||||
1:35PM up 5:38, 1 user, load averages: 0.32, 0.21, 0.19
|
||||
$
|
||||
#+end_src
|
@ -0,0 +1,11 @@
|
||||
#+TITLE: Prompts: plain
|
||||
|
||||
** OpenBSD's prompt with a cherry on top
|
||||
|
||||
#+begin_src shell
|
||||
tal:~$ uname -a
|
||||
OpenBSD tal.tapenet.org 6.9 GENERIC.MP#394 amd64
|
||||
tal:~$ uptime
|
||||
1:37PM up 5:39, 1 user, load averages: 0.08, 0.16, 0.16
|
||||
tal:~$
|
||||
#+end_src
|
@ -0,0 +1,19 @@
|
||||
#+TITLE: Prompts: q
|
||||
|
||||
** My personal daily driver
|
||||
|
||||
I have been using variations of this prompt for as long as I can remember.
|
||||
|
||||
#+begin_src shell
|
||||
qbit@tal[0]:~$ uname -a
|
||||
OpenBSD tal.tapenet.org 6.9 GENERIC.MP#394 amd64
|
||||
qbit@tal[0]:~$ uptime
|
||||
1:40PM up 5:42, 1 user, load averages: 0.14, 0.14, 0.15
|
||||
qbit@tal[0]:~$ cd src/ohmyksh
|
||||
qbit@tal[0]:~/src/ohmyksh got:(master)$ cd /usr/ports/openbsd-wip
|
||||
qbit@tal[0]:/usr/ports/openbsd-wip got:(master) git:(master)$ cd -
|
||||
/home/qbit/src/ohmyksh
|
||||
qbit@tal[0]:~/src/ohmyksh got:(master)$ invalidcommand
|
||||
ksh: invalidcommand: not found
|
||||
qbit@tal[127]:~/src/ohmyksh got:(master)$
|
||||
#+end_src
|
Loading…
Reference in New Issue
Block a user