-
Notifications
You must be signed in to change notification settings - Fork 0
/
zsh.nix
62 lines (61 loc) · 1.41 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
54
55
56
57
58
59
60
61
62
{ pkgs, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
defaultKeymap = "emacs";
localVariables = {
PROMPT = "%F{green} ➜ %f";
RPROMPT = "%F{blue}%~ ";
};
initExtra = ''
# Allow Ctrl-z to toggle between suspend and resume
function Resume {
fg
zle push-input
BUFFER=""
zle accept-line
}
zle -N Resume
bindkey "^Z" Resume
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
alias -s .git="git clone"
function t() {
z "$@" && ls
}
'';
profileExtra = ''
if [[ "$(tty)" = "/dev/tty1" ]]; then
pgrep i3 || startx $(which i3)
fi
'';
plugins = [
{
name = "zsh-autopair";
src = pkgs.zsh-autopair;
file = "share/zsh/zsh-autopair/autopair.zsh";
}
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.zsh";
}
];
shellAliases = {
"bat" = "bat --style=plain";
"md" = "mkdir";
"yank" = "xclip -selection clipboard";
"r" = "trash";
"n" = "hx";
"e" = "ls --classify --human-readable";
"g" = "git";
"." = "cd .. && e";
".." = "cd ../.. && e";
"..." = "cd ../../.. && e";
"icat" = "wezterm imgcat";
};
};
}