From 231ad7f9d4e397e763527bdb83e44be63c4b7483 Mon Sep 17 00:00:00 2001 From: Rufus Wong Date: Wed, 8 May 2019 09:27:44 +0800 Subject: [PATCH] Handle commands with backslash and history from other instances --- Examples.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples.md b/Examples.md index 3283a00..8abc4ee 100644 --- a/Examples.md +++ b/Examples.md @@ -252,14 +252,14 @@ ag --nobreak --nonumbers --noheading . | fzf ```sh # fh - repeat history fh() { - eval $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//') + eval $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -r 's/ *[0-9]*\*? *//' | sed -r 's/\\/\\\\/g') } ``` ```sh # fh - repeat history fh() { - print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//') + print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -r 's/ *[0-9]*\*? *//' | sed -r 's/\\/\\\\/g') } ```