aboutsummaryrefslogtreecommitdiff
path: root/fish/functions/_fzf_search_history.fish
diff options
context:
space:
mode:
authorIndrajith2024-07-03 02:03:35 +0530
committerIndrajith2024-07-03 02:03:35 +0530
commit824022cd1f633c70c4d2782934251616756f4668 (patch)
treea310eb4bf72b26c2d110838b8c487daaa3537bea /fish/functions/_fzf_search_history.fish
parent57eb70137b5bbcdabdc0f02eea5477b3e5f845a1 (diff)
downloaddots-824022cd1f633c70c4d2782934251616756f4668.tar.gz
dots-824022cd1f633c70c4d2782934251616756f4668.tar.bz2
dots-824022cd1f633c70c4d2782934251616756f4668.zip
Dots Updated
* Adds GTK Themes * Adds wlogout * Adds tmux config * Adds Pywal-16-colors * Removed unwanted gtk folders * Config Updates * Fish * Hyprland * Hyprlock * Hyprpaper * waybar
Diffstat (limited to 'fish/functions/_fzf_search_history.fish')
-rw-r--r--fish/functions/_fzf_search_history.fish39
1 files changed, 0 insertions, 39 deletions
diff --git a/fish/functions/_fzf_search_history.fish b/fish/functions/_fzf_search_history.fish
deleted file mode 100644
index cafbce989..000000000
--- a/fish/functions/_fzf_search_history.fish
+++ /dev/null
@@ -1,39 +0,0 @@
-function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
- # history merge incorporates history changes from other fish sessions
- # it errors out if called in private mode
- if test -z "$fish_private_mode"
- builtin history merge
- end
-
- if not set --query fzf_history_time_format
- # Reference https://devhints.io/strftime to understand strftime format symbols
- set -f fzf_history_time_format "%m-%d %H:%M:%S"
- end
-
- # Delinate time from command in history entries using the vertical box drawing char (U+2502).
- # Then, to get raw command from history entries, delete everything up to it. The ? on regex is
- # necessary to make regex non-greedy so it won't match into commands containing the char.
- set -f time_prefix_regex '^.*? │ '
- # Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line
- set -f commands_selected (
- builtin history --null --show-time="$fzf_history_time_format │ " |
- _fzf_wrapper --read0 \
- --print0 \
- --multi \
- --scheme=history \
- --prompt="History> " \
- --query=(commandline) \
- --preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \
- --preview-window="bottom:3:wrap" \
- $fzf_history_opts |
- string split0 |
- # remove timestamps from commands selected
- string replace --regex $time_prefix_regex ''
- )
-
- if test $status -eq 0
- commandline --replace -- $commands_selected
- end
-
- commandline --function repaint
-end