aboutsummaryrefslogtreecommitdiff
path: root/external/zsh/plugins/fzf-history.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 /external/zsh/plugins/fzf-history.zsh
parentc69a505caac996f78b7b010dcc563672cb5a6019 (diff)
downloadnixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.tar.gz
nixos-config-66adff9257c0bdcf5fea357cf4afd9c5804ac9d9.zip
Moves zsh config to config and symlinked
Diffstat (limited to 'external/zsh/plugins/fzf-history.zsh')
-rw-r--r--external/zsh/plugins/fzf-history.zsh19
1 files changed, 0 insertions, 19 deletions
diff --git a/external/zsh/plugins/fzf-history.zsh b/external/zsh/plugins/fzf-history.zsh
deleted file mode 100644
index f91cc99..0000000
--- a/external/zsh/plugins/fzf-history.zsh
+++ /dev/null
@@ -1,19 +0,0 @@
-full_history() {
- [[ ${@[-1]-} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1;
-}
-
-trim() { sed 's/^\s*//g'; }
-reverse() { sed -n '1!G;h;$p'; }
-unique() { awk '!seen[$0]++'; }
-
-search_history() {
- local result=$(full_history | trim | cut -d' ' -f 2- | reverse | unique | fzf);
-
- # Replace the buffer with the editor output.
- print -Rz - "$(echo -n "$result" | trim)";
-
- zle send-break # Force reload from the buffer stack
-}
-
-zle -N search_history;
-bindkey '^R' search_history;