diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 22:37:27 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 22:37:27 +0100 |
commit | 5f21ebc0d3539276ccee967dd510e7aba8b31c0c (patch) | |
tree | bd29c23d4031f1161e704d1d7fc5aa901c38be12 /user-profiles/zsh/zshrc | |
parent | d48742861083f37c670447ca98fb43490531be80 (diff) | |
download | nixos-5f21ebc0d3539276ccee967dd510e7aba8b31c0c.tar nixos-5f21ebc0d3539276ccee967dd510e7aba8b31c0c.tar.gz nixos-5f21ebc0d3539276ccee967dd510e7aba8b31c0c.tar.bz2 nixos-5f21ebc0d3539276ccee967dd510e7aba8b31c0c.tar.xz nixos-5f21ebc0d3539276ccee967dd510e7aba8b31c0c.zip |
zsh customization
Diffstat (limited to 'user-profiles/zsh/zshrc')
-rw-r--r-- | user-profiles/zsh/zshrc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/user-profiles/zsh/zshrc b/user-profiles/zsh/zshrc new file mode 100644 index 00000000..3660ef27 --- /dev/null +++ b/user-profiles/zsh/zshrc | |||
@@ -0,0 +1,26 @@ | |||
1 | fancy-ctrl-z () { | ||
2 | emulate -LR zsh | ||
3 | if [[ $#BUFFER -eq 0 ]]; then | ||
4 | [[ -n $(jobs -s) ]] && bg | ||
5 | zle redisplay | ||
6 | else | ||
7 | zle push-input | ||
8 | fi | ||
9 | } | ||
10 | zle -N fancy-ctrl-z | ||
11 | bindkey '^Z' fancy-ctrl-z | ||
12 | |||
13 | function fancy-ctrl-d() { | ||
14 | zle || exit 0 | ||
15 | [[ -n $BUFFER ]] && return | ||
16 | typeset -g precmd_functions=(fancy-ctrl-d) | ||
17 | zle accept-line | ||
18 | } | ||
19 | zle -N fancy-ctrl-d | ||
20 | bindkey '^D' fancy-ctrl-d | ||
21 | setopt ignore_eof | ||
22 | |||
23 | # word navigation for urxvt | ||
24 | bindkey -e | ||
25 | bindkey ';5C' emacs-forward-word | ||
26 | bindkey ';5D' emacs-backward-word \ No newline at end of file | ||