From a4351ab687e0e7517f6bc40ba7a54a52166be968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sat, 8 Jun 2019 15:01:24 +0200 Subject: [PATCH] zsh: + zsh-completions, zsh-history-substring-search --- configs/zsh.nix | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/configs/zsh.nix b/configs/zsh.nix index 94d411c..2c823b4 100644 --- a/configs/zsh.nix +++ b/configs/zsh.nix @@ -1,8 +1,22 @@ -{ config, ... }: +{ config, pkgs, ... }: { home-manager.users.me.home.file.".zshrc".text = "# nothing to see here"; - programs.zsh = { + programs.zsh = + let + zsh-completions = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-completions"; + rev = "cf565254e26bb7ce03f51889e9a29953b955b1fb"; + sha256 = "1yf4rz99acdsiy0y1v3bm65xvs2m0sl92ysz0rnnrlbd5amn283l"; + }; + zsh-history-substring-search = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-history-substring-search"; + rev = "aae3388491c2312c4efb2e86bcb999927bb2900e"; + sha256 = "0lgmq1xcccnz5cf7vl0r0qj351hwclx9p80cl0qczxry4r2g5qaz"; + }; + in { enable = true; enableCompletion = true; autosuggestions.enable = true; @@ -39,6 +53,14 @@ mkdir $1 cd $1 } + + fpath=(${zsh-completions}/src $fpath) + source ${zsh-history-substring-search}/zsh-history-substring-search.zsh + + bindkey '^[[A' history-substring-search-up + bindkey '^[[B' history-substring-search-down + bindkey -M vicmd 'k' history-substring-search-up + bindkey -M vicmd 'j' history-substring-search-down ''; promptInit = '' autoload -Uz vcs_info