From 3222d62ddf0b8072e43ac2b5abd52b1d6d3f6eef Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 4 Oct 2016 02:17:36 +0900 Subject: [PATCH] 0.15.4 --- CHANGELOG.md | 13 +++++++++++++ README.md | 18 +++++++++--------- install | 4 ++-- man/man1/fzf-tmux.1 | 2 +- man/man1/fzf.1 | 24 ++++++++++++++++-------- src/constants.go | 2 +- 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b9954..7bbe4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ CHANGELOG ========= +0.15.4 +------ +- Added support for range expression in preview and execute action + - e.g. `ls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1` + - `{q}` will be replaced to the single-quoted string of the current query +- Fixed to properly handle unicode whitespace characters +- Display scroll indicator in preview window +- Inverse search term will use exact matcher by default + - This is a breaking change, but I believe it makes much more sense. It is + almost impossible to predict which entries will be filtered out due to + a fuzzy inverse term. You can still perform inverse-fuzzy-match by + prepending `!'` to the term. + 0.15.3 ------ - Added support for more ANSI attributes: dim, underline, blink, and reverse diff --git a/README.md b/README.md index 997ec7c..a5d2e95 100644 --- a/README.md +++ b/README.md @@ -113,16 +113,16 @@ vim $(fzf) Unless otherwise specified, fzf starts in "extended-search mode" where you can type in multiple search terms delimited by spaces. e.g. `^music .mp3$ sbtrkt -!rmx` +!fire` -| Token | Match type | Description | -| -------- | -------------------- | -------------------------------- | -| `sbtrkt` | fuzzy-match | Items that match `sbtrkt` | -| `^music` | prefix-exact-match | Items that start with `music` | -| `.mp3$` | suffix-exact-match | Items that end with `.mp3` | -| `'wild` | exact-match (quoted) | Items that include `wild` | -| `!rmx` | inverse-fuzzy-match | Items that do not match `rmx` | -| `!'fire` | inverse-exact-match | Items that do not include `fire` | +| Token | Match type | Description | +| -------- | -------------------------- | --------------------------------- | +| `sbtrkt` | fuzzy-match | Items that match `sbtrkt` | +| `^music` | prefix-exact-match | Items that start with `music` | +| `.mp3$` | suffix-exact-match | Items that end with `.mp3` | +| `'wild` | exact-match (quoted) | Items that include `wild` | +| `!fire` | inverse-exact-match | Items that do not include `fire` | +| `!.mp3$` | inverse-suffix-exact-match | Items that do not end with `.mp3` | If you don't prefer fuzzy matching and do not wish to "quote" every word, start fzf with `-e` or `--exact` option. Note that when `--exact` is set, diff --git a/install b/install index 3b7ca05..7a5b797 100755 --- a/install +++ b/install @@ -2,8 +2,8 @@ set -u -[[ "$@" =~ --pre ]] && version=0.15.3 pre=1 || - version=0.15.3 pre=0 +[[ "$@" =~ --pre ]] && version=0.15.4 pre=1 || + version=0.15.4 pre=0 auto_completion= key_bindings= diff --git a/man/man1/fzf-tmux.1 b/man/man1/fzf-tmux.1 index 6c2557d..b01f0b7 100644 --- a/man/man1/fzf-tmux.1 +++ b/man/man1/fzf-tmux.1 @@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .. -.TH fzf-tmux 1 "Sep 2016" "fzf 0.15.3" "fzf-tmux - open fzf in tmux split pane" +.TH fzf-tmux 1 "Oct 2016" "fzf 0.15.4" "fzf-tmux - open fzf in tmux split pane" .SH NAME fzf-tmux - open fzf in tmux split pane diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 2c399a1..9616701 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .. -.TH fzf 1 "Sep 2016" "fzf 0.15.3" "fzf - a command-line fuzzy finder" +.TH fzf 1 "Oct 2016" "fzf 0.15.4" "fzf - a command-line fuzzy finder" .SH NAME fzf - a command-line fuzzy finder @@ -232,11 +232,17 @@ automatically truncated when the number of the lines exceeds the value. .TP .BI "--preview=" "COMMAND" Execute the given command for the current line and display the result on the -preview window. \fB{}\fR is the placeholder for the quoted string of the -current line. +preview window. \fB{}\fR in the command is the placeholder that is replaced to +the single-quoted string of the current line. To transform the replacement +string, specify field index expressions between the braces (See \fBFIELD INDEX +EXPRESSION\fR for the details). Also, \fB{q}\fR is replaced to the current +query string. .RS e.g. \fBfzf --preview="head -$LINES {}"\fR + \fBls -l | fzf --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1\fR + +Note that you can escape a placeholder pattern by prepending a backslash. .RE .TP .BI "--preview-window=" "[POSITION][:SIZE[%]][:hidden]" @@ -358,7 +364,7 @@ with the given string. An anchored-match term is also an exact-match term. .SS Negation If a term is prefixed by \fB!\fR, fzf will exclude the lines that satisfy the -term from the result. +term from the result. In this case, fzf performs exact match by default. .SS Exact-match by default If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with @@ -460,9 +466,11 @@ binding \fBenter\fR key to \fBless\fR command like follows. \fBfzf --bind "enter:execute(less {})"\fR -\fB{}\fR is the placeholder for the quoted string of the current line. -If the command contains parentheses, you can use any of the following -alternative notations to avoid parse errors. +You can use the same placeholder expressions as in \fB--preview\fR. + +If the command contains parentheses, fzf may fail to parse the expression. In +that case, you can use any of the following alternative notations to avoid +parse errors. \fBexecute[...]\fR \fBexecute~...~\fR @@ -481,7 +489,7 @@ alternative notations to avoid parse errors. .RS This is the special form that frees you from parse errors as it does not expect the closing character. The catch is that it should be the last one in the -comma-separated list. +comma-separated list of key-action pairs. .RE \fBexecute-multi(...)\fR is an alternative action that executes the command diff --git a/src/constants.go b/src/constants.go index 35818cd..a96c362 100644 --- a/src/constants.go +++ b/src/constants.go @@ -8,7 +8,7 @@ import ( const ( // Current version - version = "0.15.3" + version = "0.15.4" // Core coordinatorDelayMax time.Duration = 100 * time.Millisecond