Implement smarter history navigation (#2161)

* Remove unnecessary space in history file

* Refactor history navigation

* Implement smarter history navigation

* Skip duplicate commands in history navigation

* Return to Normal mode if it started from there

* Reset history state when changing prompt

* Update documentation
This commit is contained in:
Joe Lim authored and GitHub committed 2025-09-19 19:44:43 +10:00
1 parent 5e15655539
commit 89ff7b0203
6 files changed
+96 -86

No files matched your search

+4 -2
View File
@@ -1,6 +1,6 @@
.\" Automatically generated by Pandoc 3.7.0.2
.\"
.TH "LF" "1" "2025\-09\-19" "r38" "DOCUMENTATION"
.TH "LF" "1" "2025\-09\-19" "r39" "DOCUMENTATION"
.SH NAME
lf \- terminal file manager
.SH SYNOPSIS
@@ -635,7 +635,9 @@ Execute the current line.
.SS cmd\-interrupt (default \f[CR]<c\-c>\f[R])
Interrupt the current shell\-pipe command and return to the Normal mode.
.SS cmd\-history\-next (default \f[CR]<c\-n>\f[R] and \f[CR]<down>\f[R]), cmd\-history\-prev (default \f[CR]<c\-p>\f[R] and \f[CR]<up>\f[R])
Go to the next/previous item in the history.
Go to the next/previous entry in the command history.
If part of the command is already typed, then only matching entries will
be considered, and consecutive duplicate entries are skipped.
.SS cmd\-left (default \f[CR]<c\-b>\f[R] and \f[CR]<left>\f[R]), cmd\-right (default \f[CR]<c\-f>\f[R] and \f[CR]<right>\f[R])
Move the cursor to the left/right.
.SS cmd\-home (default \f[CR]<c\-a>\f[R] and \f[CR]<home>\f[R]), cmd\-end (default \f[CR]<c\-e>\f[R] and \f[CR]<end>\f[R])