Skip to content

[pd/m/o]ksh[93] plugin. Coloring built in.

License

Notifications You must be signed in to change notification settings

DesantBucie/korny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

korny

Something like plugin manager for kornshell

Oh Korny

Requirements

  • git (avoid apple crappy one, install one from nix or brew1)
  • ksh93 (Best option), pdksh or mksh(with limitations2).
  • printf built-in to shell, or as external program

Tested OSes

  • macOS
  • SunOS
  • FreeBSD and OpenBSD
  • Linux should also work
  • even Android

Installation

  1. Change default shell to kornshell(if you have to):

    • which ksh - output will be path to ksh

    • Make sure that ksh is in /etc/shells, if there isn't, enter full path

    • chsh -s <PATH TO KSH>

  2. Run: ksh -c "$(curl -fsSL https://raw.githubusercontent.com/DesantBucie/korny/master/bin/install.ksh)"

  3. Only ksh93u+m supports autocd, so note that.

  4. Some systems may require setting export ENV=$HOME/.kshrc3 in ~/.profile or /etc/profile(don't forget to reboot).

Also mksh use .mkshrc, so you either rename .kshrc to .mkshrc, or use step above

Change prompt

Change line named PROMPT in ~/.kshrc to filename without extension i.e ibsd

alt

Load plugins

By default you will load git_aliases and android plugins(plus base plugins starting with. _). Plugins with .ksh93, are for ksh93 only. To add plugin, just edit ~/.kshrc, enter it's filename

set -A plugins_array -- \
android git_aliases #Load plugins
load_plugs 

To see all plugins, check plugin folder.

Load completion

Completion works only in oksh, it is forked from ohmyksh

You load it the same way as plugins, in ~/.kshrc but istead of plugins-array load it in completion_array just below

Note that not all completions are crossplatform(i.e openbsd)

Update

Type: korn u or korn update

Uninstall

Type: korn rm or korn remove

Footnotes

  1. This is why.

  2. As I tested it on NetBSD, there were problems with prompt loading if there were too many lines in PS1 variable. It cannot be fixed from this level most likely.

  3. You can set any path(and copy .kshrc there), for example i have it under export ENV="$HOME/.config/ksh/rc"