/
zsh.nix
53 lines (43 loc) · 1.32 KB
/
zsh.nix
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
{ pkgs, ... }:
let
extras = [
./zsh/elm.zsh
./zsh/emacs.zsh
./zsh/jetpack.zsh
./zsh/jump.zsh
./zsh/kill-process.zsh
./zsh/lorri.zsh
./zsh/nixify.sh
./zsh/rubofix.zsh
./zsh/scripts.zsh
];
extraInitExtra = builtins.foldl' (soFar: new: soFar + "\n" + builtins.readFile new) "" extras;
in
{
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableAutosuggestions = true;
enableCompletion = true;
# TODO: environment.pathsToLink (see home-configuration.nix man page)
initExtra = ''
# from https://gist.github.com/oshybystyi/2c30543cd48b2c9ecab0
EMOJI=(🐦 🚀 🎨 🍕 🐭 ☕️ 🔬 🐷 🐼 🐶 🐧 🐳 🍔 🍻 🔮 💰 💎 💾 💜 🍪 🌞 🌍 🐌 🐓 🐏 ✈️ )
function random_emoji {
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]"
}
setopt PROMPT_SUBST
PROMPT="$(random_emoji) %B%F{blue}%c%f%b %F{blue}»%f "
RPROMPT='%F{green}$(test -f .git/HEAD && sed "s|ref: refs/heads/||g" .git/HEAD)%f'
# Although I use emacs for most development, prefer to make quick edits
# (including stuff like git commit messages) in vim!
EDITOR=vim
'' + extraInitExtra;
history = {
# TODO: why do I need both save and size?
save = 10000;
size = 10000;
share = true;
};
};
}