-
Notifications
You must be signed in to change notification settings - Fork 0
/
zsh.nix
55 lines (46 loc) · 1.34 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
{ pkgs, config, lib, mkEnableOption, ... }:
let
inherit (lib) mkIf;
cfg = config.aquaris.zsh;
cache = "$HOME/.cache/zsh";
in
{
options.aquaris.zsh = mkEnableOption "ZSH with OMZ and some plugins";
config = mkIf cfg {
home.file.".profile".text = ''
source "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
'';
programs.zsh = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
autocd = true;
defaultKeymap = "emacs";
history.path = "${cache}/history";
initExtra = ''
# bindkey "" insert-cycledright
# bindkey "" insert-cycledleft
bindkey "[1;3C" forward-word
bindkey "[1;3D" backward-word
# https://github.com/zsh-users/zsh-syntax-highlighting/issues/295#issuecomment-214581607
zstyle ':bracketed-paste-magic' active-widgets '.self-*'
'';
plugins = with pkgs; [
(pkgs.lib.getAttrs [ "name" "src" ] zsh-fzf-history-search)
];
oh-my-zsh = {
enable = true;
extraConfig = ''
MAGIC_ENTER_GIT_COMMAND=' git status'
MAGIC_ENTER_OTHER_COMMAND=' ls -lh'
ZSH_COMPDUMP="${cache}/completion"
'';
plugins = [
"fancy-ctrl-z"
"magic-enter"
"sudo"
];
};
};
};
}