benavento / rc

Rc — The Plan 9 Shell (Standalone Unix port)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rc — The Plan 9 Shell

Standalone port of Rc shell written by Tom Duff with edit, history and completion support.

Building

In a terminal run:

cd rc
make
make install

Config

Profile

/Users/$USER/.rcrc

Completion

In .rcrc_ define a fn_complete funciton.

fn err { echo $* >[1=2] }

fn complete_history {
	history | sort -u | fzf -0 --header 'History'
}

fn complete_arg {
}

fn complete_command {
	find $path -maxdepth 1 >[2]/dev/null | sed 's/\/.*\///' | sort -u |
        fzf -q '^'^$1 -0 -1 --header 'Commands' --prompt $prompt(1)
}

fn complete {
#err complete: $#* "$"*"
	if(~ $#* 0)
		exit

	latsp=no
	if(~ $"* *^' ')
		lastsp=yes

	*=`{echo $*}
	switch($#*){
	case 0
		complete_history
	case 1
		if(~ $lastsp yes)
			complete_arg $1
		if not
			complete_command $1
	case *
		exit ''
	}
}

Documentation

About

Rc — The Plan 9 Shell (Standalone Unix port)

License:Other


Languages

Language:C 85.2%Language:Roff 9.7%Language:C++ 2.9%Language:Yacc 1.5%Language:Makefile 0.6%