-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.rcrc
59 lines (49 loc) · 1.19 KB
/
.rcrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
## This is the startup config for the rc shell, it's probably
## my favorite shell if a bit unweildy at first.
## In rc syntax, $* is equivalent to bash's $@
# a subshell is spawned by any command prefixed with '@'
# additonally, it's worth mentioning that rc has much more
# C-like syntax than even csh.
# Important note: for a command like `make search key=darcs -C /usr/src`
# it needs to be rewritten as: `make search 'key=darcs' -C /usr/src`
## set some environmental variables
LANG=(en_US.UTF-8)
TERM=(xterm-256color)
path=(/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin $home/bin $home/bin/c)
if (test -x `(which nvim)) {
EDITOR=(nvim)
VISUAL=(nvim)
} else {
EDITOR=(vim)
VISUAL=(vim)
}
## Define the $prompt
prompt=('
'$USER'@'`hostname':'`pwd'
; ' '')
## Function definitions
fn reload {
# simply reload the file ~/.rcrc
. $home/.rcrc
}
## Update the prompt to show the
# directory as we chdir throughout the FS
fn cd {
builtin cd $*
&& reload
}
fn vim {
$EDITOR $*
}
## get the weather forcast
fn weather {
city=$*
/usr/local/bin/curl wttr.in/$city
}
## useful shorthand for pkg_ng
fn revdeps {
/usr/sbin/pkg query %rn $*
}
fn deplist {
/usr/sbin/pkg query %rn $*
}