Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
27e774892a | |||
1916450d90 | |||
aafbf3f101 | |||
a4957f1899 | |||
|
d27c85fbe1 | ||
fdbb432ad1 | |||
|
0515b471fd | ||
5ca81764aa | |||
458c6d5866 | |||
3afbd7ac41 | |||
434b815e34 | |||
0c31f525dd | |||
896839477f | |||
542d94193b | |||
f4b38ff89c | |||
|
bdd34b5429 | ||
|
7f2a3f3fcc | ||
|
1cd3d8ec39 | ||
|
7bea5a33d4 | ||
|
b6fb7da353 | ||
|
e332e744a1 |
23
README.org
23
README.org
@ -1,6 +1,7 @@
|
||||
#+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:
|
||||
@ -28,17 +29,17 @@ Have your cake and eat it too!
|
||||
|
||||
** Extensions
|
||||
|
||||
| Name | Description |
|
||||
|------------+--------------------------------------------------------------|
|
||||
| [[file:extensions/fonts.org][fonts]] | Load fonts from common locations. |
|
||||
| [[file:extensions/fzf.org][fzf]] | - |
|
||||
| [[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)]]. |
|
||||
| Name | Description |
|
||||
|------------+-------------------------------------------------------------------------|
|
||||
| [[file:extensions/fonts.org][fonts]] | Load fonts from common locations. |
|
||||
| [[file:extensions/fzf.org][fzf]] | Set of interactive wrappers for things like packages and shell history. |
|
||||
| [[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
|
||||
|
@ -1,17 +1,4 @@
|
||||
#: | git | add, fetch... |
|
||||
set -A complete_git_1 -- \
|
||||
add am archive \
|
||||
bisect branch bundle \
|
||||
checkout cherry-pick citool clean clone commit config \
|
||||
describe diff \
|
||||
fetch format-patch \
|
||||
gc grep gui \
|
||||
init \
|
||||
log \
|
||||
merge mv \
|
||||
notes \
|
||||
pull push \
|
||||
range-diff rebase reset restore revert rm \
|
||||
shortlog show sparse-checkout stash status submodule switch \
|
||||
tag \
|
||||
worktree
|
||||
$(git --list-cmds=main) \
|
||||
$(git config --get-regexp ^alias\. | awk -F '[\. ]' '{ print $2 }')
|
||||
|
@ -3,20 +3,11 @@
|
||||
The ~git~ completion currently supports the following arguments:
|
||||
|
||||
** Level 1
|
||||
|
||||
The completions for level one are dynamically created using the following
|
||||
commands:
|
||||
|
||||
#+begin_src ksh
|
||||
add am archive \
|
||||
bisect branch bundle \
|
||||
checkout cherry-pick citool clean clone commit config \
|
||||
describe diff \
|
||||
fetch format-patch \
|
||||
gc grep gui \
|
||||
init \
|
||||
log \
|
||||
merge mv \
|
||||
notes \
|
||||
pull push \
|
||||
range-diff rebase reset restore revert rm \
|
||||
shortlog show sparse-checkout stash status submodule switch \
|
||||
tag \
|
||||
worktree
|
||||
$(git --list-cmds=main) \
|
||||
$(git config --get-regexp ^alias\. | awk -F '[\. ]' '{ print $2 }')
|
||||
#+end_src
|
||||
|
@ -1,10 +1,11 @@
|
||||
#: | man | man pages |
|
||||
MAN_CACHE=$LOAD_PATH/cache/man
|
||||
if [ ! -f $MAN_CACHE ]; then
|
||||
MANPATH=/usr/share/man man -k Nm~. | cut -d\( -f1 | tr -d , | \
|
||||
sort | \
|
||||
uniq > $MAN_CACHE
|
||||
mkdir -p $(dirname ${MAN_CACHE})
|
||||
for i in /usr{,/X11R6,/local}{,/share}/man/{,cat,man}[1-9lnp]{,f,p}
|
||||
do
|
||||
test -d $i && ls $i
|
||||
done | rev | cut -d. -f2- | rev | sort -u > $MAN_CACHE
|
||||
fi
|
||||
|
||||
set -A complete_man_1 -- $(cat $MAN_CACHE)
|
||||
|
||||
set -A complete_man -- $(cat $MAN_CACHE)
|
||||
|
@ -5,9 +5,10 @@
|
||||
Completions for man pages are found via:
|
||||
|
||||
#+begin_src shell
|
||||
MANPATH=/usr/share/man man -k Nm~. | cut -d\( -f1 | tr -d , | \
|
||||
sort | \
|
||||
uniq > $MAN_CACH
|
||||
for i in /usr{,/X11R6,/local}{,/share}/man/{,cat,man}[1-9lnp]{,f,p}
|
||||
do
|
||||
test -d $i && ls $i
|
||||
done | rev | cut -d. -f2- | rev | sort -u > $MAN_CACHE
|
||||
#+end_src
|
||||
|
||||
Currently the cache is never re-created. Operating without a cache causes
|
||||
|
@ -20,7 +20,4 @@ set -A complete_mpc_1 -- \
|
||||
version volume \
|
||||
waitmessage
|
||||
|
||||
pgrep -fq '/usr/local/sbin/mpd'
|
||||
if [ $? = 0 ]; then
|
||||
set -A complete_mpc_2 -- $(mpc lsplaylists | sort)
|
||||
fi
|
||||
set -A complete_mpc_2 -- $(mpc lsplaylists | sort)
|
||||
|
@ -1,5 +1,15 @@
|
||||
zpatch() {
|
||||
if [ -z $OHMYPATCHES ]; then
|
||||
echo "please set OHMYPATCHES to the directory that contains your patches."
|
||||
return 1
|
||||
fi
|
||||
|
||||
local _patch_file="$(ls ${OHMYPATCHES}/* | fzf)"
|
||||
/usr/bin/patch $@ < "${_patch_file}"
|
||||
}
|
||||
|
||||
zh() {
|
||||
fc -ln | eval `fzf`
|
||||
fc -ln | eval $(fzf)
|
||||
}
|
||||
|
||||
zpkg() {
|
||||
|
@ -5,5 +5,6 @@
|
||||
|------+---------------------------------|
|
||||
| zh | Interactive shell history. |
|
||||
| zpkg | Interactive package add/remove. |
|
||||
| zpatch | Interactive function for applying patches. |
|
||||
|
||||
|
||||
|
@ -21,8 +21,8 @@ k() {
|
||||
else
|
||||
K=~/.k
|
||||
case $1 in
|
||||
clean) sort $K | uniq > ${K}.tmp && mv ${K}.tmp ${K};;
|
||||
rm) sed -i -E "\#^${PWD}\$#d" ${K};;
|
||||
clean) sort -u $K -o ${K};;
|
||||
rm) sed -i -E "\#^${2:-${PWD}}\$#d" ${K};;
|
||||
ls) cat ${K};;
|
||||
*) cd "$(grep -e "$1" ${K} | head -n 1)";;
|
||||
esac
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
pkgup() {
|
||||
local _up_url
|
||||
_up_url="https://pintobyte.com/pkgup/"
|
||||
_up_url="${OHMY_PKGUP_URL:-https://pintobyte.com/pkgup/}"
|
||||
[ ! -z $1 ] && _up_url=$1
|
||||
|
||||
if which obsdpkgup >/dev/null 2>&1; then
|
||||
|
@ -13,7 +13,7 @@ _loaded() {
|
||||
|
||||
load() {
|
||||
local _e=$1
|
||||
[[ -x $_e ]] && \
|
||||
[[ -f $_e ]] && \
|
||||
. $_e
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user