aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/keys.zsh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-12-23 23:40:35 +0530
committerAkshay Nair <phenax5@gmail.com>2020-12-23 23:40:35 +0530
commit66adff9257c0bdcf5fea357cf4afd9c5804ac9d9 (patch)
tree92b9941ed1b211594446c69e1c1a4d57240f1a0e /config/zsh/keys.zsh
parentc69a505caac996f78b7b010dcc563672cb5a6019 (diff)
downloadnixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.tar.gz
nixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.zip
Moves zsh config to config and symlinked
Diffstat (limited to 'config/zsh/keys.zsh')
-rw-r--r--config/zsh/keys.zsh51
1 files changed, 51 insertions, 0 deletions
diff --git a/config/zsh/keys.zsh b/config/zsh/keys.zsh
new file mode 100644
index 0000000..5ed993c
--- /dev/null
+++ b/config/zsh/keys.zsh
@@ -0,0 +1,51 @@
+if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
+ function zle-line-init() {
+ echoti smkx
+ }
+ function zle-line-finish() {
+ echoti rmkx
+ }
+ zle -N zle-line-init
+ zle -N zle-line-finish
+fi
+
+bindkey -e;
+
+autoload -z edit-command-line; zle -N edit-command-line;
+bindkey "^E" edit-command-line;
+
+bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
+bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
+
+# CHeck
+bindkey ' ' magic-space
+
+if [[ "${terminfo[kpp]}" != "" ]]; then
+ bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
+fi
+if [[ "${terminfo[knp]}" != "" ]]; then
+ bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
+fi
+
+bindkey '^?' backward-delete-char # [Backspace] - delete backward
+if [[ "${terminfo[kdch1]}" != "" ]]; then
+ bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
+else
+ bindkey "^[[3~" delete-char
+ bindkey "^[3;5~" delete-char
+ bindkey "\e[3~" delete-char
+fi
+
+# start typing + [Up-Arrow] - fuzzy find history forward
+if [[ "${terminfo[kcuu1]}" != "" ]]; then
+ autoload -U up-line-or-beginning-search
+ zle -N up-line-or-beginning-search
+ bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
+fi
+# start typing + [Down-Arrow] - fuzzy find history backward
+if [[ "${terminfo[kcud1]}" != "" ]]; then
+ autoload -U down-line-or-beginning-search
+ zle -N down-line-or-beginning-search
+ bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
+fi
+