summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2019-11-14 22:39:25 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2019-11-14 22:39:35 +0900
commit168453da71af199a76279b9d4017ad1f72ba1f26 (patch)
tree4f90c733c9e53c0c3f99640172d656acbc65681c
parent23a06d63ac63352206b7f6d1ca6973cb1cc5dac3 (diff)
More key chords for --bind
Close #1752
-rw-r--r--CHANGELOG.md1
-rw-r--r--man/man1/fzf.18
-rw-r--r--src/options.go8
-rw-r--r--src/tui/light.go8
-rw-r--r--src/tui/tcell.go6
-rw-r--r--src/tui/tui.go6
6 files changed, 37 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c18a6eae..d33a181b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ CHANGELOG
```
- When you transform the input with `--with-nth`, the trailing white spaces
are removed.
+- `ctrl-\`, `ctrl-]`, `ctrl-^`, and `ctrl-/` can now be used with `--bind`
- See https://github.com/junegunn/fzf/milestone/15?closed=1 for more details
[argmax]: https://unix.stackexchange.com/questions/120642/what-defines-the-maximum-size-for-a-command-single-argument
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1
index 906fbe61..bd18fb81 100644
--- a/man/man1/fzf.1
+++ b/man/man1/fzf.1
@@ -521,6 +521,14 @@ e.g.
.br
\fIctrl-space\fR
.br
+\fIctrl-\\\fR
+.br
+\fIctrl-]\fR
+.br
+\fIctrl-^\fR (\fIctrl-6\fR)
+.br
+\fIctrl-/\fR (\fIctrl-_\fR)
+.br
\fIctrl-alt-[a-z]\fR
.br
\fIalt-[a-z]\fR
diff --git a/src/options.go b/src/options.go
index 848ce3d9..fb432a6f 100644
--- a/src/options.go
+++ b/src/options.go
@@ -417,6 +417,14 @@ func parseKeyChords(str string, message string) map[int]string {
chord = tui.BSpace
case "ctrl-space":
chord = tui.CtrlSpace
+ case "ctrl-^", "ctrl-6":
+ chord = tui.CtrlCaret
+ case "ctrl-/", "ctrl-_":
+ chord = tui.CtrlSlash
+ case "ctrl-\\":
+ chord = tui.CtrlBackSlash
+ case "ctrl-]":
+ chord = tui.CtrlRightBracket
case "change":
chord = tui.Change
case "alt-enter", "alt-return":
diff --git a/src/tui/light.go b/src/tui/light.go
index 43d7efee..d1020a99 100644
--- a/src/tui/light.go
+++ b/src/tui/light.go
@@ -345,6 +345,14 @@ func (r *LightRenderer) GetChar() Event {
return Event{BSpace, 0, nil}
case 0:
return Event{CtrlSpace, 0, nil}
+ case 28:
+ return Event{CtrlBackSlash, 0, nil}
+ case 29:
+ return Event{CtrlRightBracket, 0, nil}
+ case 30:
+ return Event{CtrlCaret, 0, nil}
+ case 31:
+ return Event{CtrlSlash, 0, nil}
case ESC:
ev := r.escSequence(&sz)
// Second chance
diff --git a/src/tui/tcell.go b/src/tui/tcell.go
index 098e8a18..4bd7c812 100644
--- a/src/tui/tcell.go
+++ b/src/tui/tcell.go
@@ -284,6 +284,12 @@ func (r *FullscreenRenderer) GetChar() Event {
return Event{keyfn('z'), 0, nil}
case tcell.KeyCtrlSpace:
return Event{CtrlSpace, 0, nil}
+ case tcell.KeyCtrlBackslash:
+ return Event{CtrlBackSlash, 0, nil}
+ case tcell.KeyCtrlRightSq:
+ return Event{CtrlRightBracket, 0, nil}
+ case tcell.KeyCtrlUnderscore:
+ return Event{CtrlSlash, 0, nil}
case tcell.KeyBackspace2:
if alt {
return Event{AltBS, 0, nil}
diff --git a/src/tui/tui.go b/src/tui/tui.go
index 9b821940..de1d4b56 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -40,6 +40,12 @@ const (
ESC
CtrlSpace
+ // https://apple.stackexchange.com/questions/24261/how-do-i-send-c-that-is-control-slash-to-the-terminal
+ CtrlBackSlash
+ CtrlRightBracket
+ CtrlCaret
+ CtrlSlash
+
Invalid
Resize
Mouse