Skip to content

Commit ae12e94

Browse files
authored
Add sub-word actions (#3997)
Add `backward-subword`, `forward-subword`, `kill-subword`, `backward-kill-subword` actions.
1 parent 9ed971c commit ae12e94

File tree

5 files changed

+221
-145
lines changed

5 files changed

+221
-145
lines changed

man/man1/fzf.1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,9 @@ A key or an event can be bound to one or more of the following actions.
18071807
\fBbackward\-char\fR \fIctrl\-b left\fR
18081808
\fBbackward\-delete\-char\fR \fIctrl\-h ctrl\-bspace bspace\fR
18091809
\fBbackward\-delete\-char/eof\fR (same as \fBbackward\-delete\-char\fR except aborts fzf if query is empty)
1810+
\fBbackward\-kill\-subword\fR
18101811
\fBbackward\-kill\-word\fR \fIalt\-bs\fR
1812+
\fBbackward\-subword\fR
18111813
\fBbackward\-word\fR \fIalt\-b shift\-left\fR
18121814
\fBbecome(...)\fR (replace fzf process with the specified command; see below for the details)
18131815
\fBbeginning\-of\-line\fR \fIctrl\-a home\fR
@@ -1847,10 +1849,12 @@ A key or an event can be bound to one or more of the following actions.
18471849
\fBexecute\-silent(...)\fR (see below for the details)
18481850
\fBfirst\fR (move to the first match; same as \fBpos(1)\fR)
18491851
\fBforward\-char\fR \fIctrl\-f right\fR
1852+
\fBforward\-subword\fR
18501853
\fBforward\-word\fR \fIalt\-f shift\-right\fR
18511854
\fBignore\fR
18521855
\fBjump\fR (EasyMotion-like 2-keystroke movement)
18531856
\fBkill\-line\fR
1857+
\fBkill\-subword\fR
18541858
\fBkill\-word\fR \fIalt\-d\fR
18551859
\fBlast\fR (move to the last match; same as \fBpos(\-1)\fR)
18561860
\fBnext\-history\fR (\fIctrl\-n\fR on \fB\-\-history\fR)

src/actiontype_string.go

Lines changed: 149 additions & 145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/options.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA
16631663
appendAction(actBackwardDeleteCharEof)
16641664
case "backward-word":
16651665
appendAction(actBackwardWord)
1666+
case "backward-subword":
1667+
appendAction(actBackwardSubWord)
16661668
case "clear-screen":
16671669
appendAction(actClearScreen)
16681670
case "delete-char":
@@ -1683,6 +1685,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA
16831685
appendAction(actForwardChar)
16841686
case "forward-word":
16851687
appendAction(actForwardWord)
1688+
case "forward-subword":
1689+
appendAction(actForwardSubWord)
16861690
case "jump":
16871691
appendAction(actJump)
16881692
case "jump-accept":
@@ -1691,6 +1695,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA
16911695
appendAction(actKillLine)
16921696
case "kill-word":
16931697
appendAction(actKillWord)
1698+
case "kill-subword":
1699+
appendAction(actKillSubWord)
16941700
case "unix-line-discard", "line-discard":
16951701
appendAction(actUnixLineDiscard)
16961702
case "unix-word-rubout", "word-rubout":
@@ -1699,6 +1705,8 @@ func parseActionList(masked string, original string, prevActions []*action, putA
16991705
appendAction(actYank)
17001706
case "backward-kill-word":
17011707
appendAction(actBackwardKillWord)
1708+
case "backward-kill-subword":
1709+
appendAction(actBackwardKillSubWord)
17021710
case "toggle-down":
17031711
appendAction(actToggle, actDown)
17041712
case "toggle-up":

0 commit comments

Comments
 (0)