--no-input
advanced, Path n
avigation with fzf
#4228
fsc0
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
demo.mp4
I remember some projects with this kind of approach (use fzf like a file manager).
And also there are well-known modern TUI file managers.
But still playing with these kind of ideas gives a lot of fun to me.
I saved the main script with single name
n
.And I have below function in my
.bashrc
.Important
Before testing the script,
the configuration path is
~/.config/n/
.Save below
n.conf
,bookmark
samples to above path then edit for your system.Last, check
n
's--bind
values for each features.Like
a
for rename,F7
for mkdir,s
for instant shell,space
for toggle clipboard selection,c
for display clipboard list,p
for paste init action,r
for refresh andy
for yank (filename).n.conf
bookmark
n
UPDATES
2025-02-08
Handle symbolic link for directory.
2025-02-10
Added recursive search (
ctrl-/
).Added bookmark. (
'
)2025-02-11
Added
remove
action forfzf_clipboard
.2025-02-12
Added select all (
ctrl-a
) and toggle all (v
).Added information bar.
Support LS_COLORS.
Support multiple instance.
2025-02-16
Added clipboard indicator
[n]
at the information bar.Added clear clipboard selection (
u
).2025-02-17
Added instant rename (
a
).Added instant mkdir (
F7
).Added instant shell (
s
).Changed temporary shell binding to
S
from;
.2025-02-18
Remember clipboard selection for each directory.
Restore right cursor position after clipboard paste actions. (
p
)2025-02-19
Added user configuration file
n.conf
.Added instant compress of clipboard contents (if none, just focused item) (
C
).└
:compress archive_name
(zip only).Now
n
restorecd in
cursor position not justcd ..
.Added display hidden toggle (
.
).Added get total size of clipboard contents (if none, just focused item) (
d
).Changed paste method to chain binding (
p
).Spawn bookmark list without screen clear.
2025-02-20
Added sort by time (
o
).Added
fzf_n_grep_str
to handle brackets.Changed substitution method (to
awk
fromsed
) to handle unique names like "f|i|l|e.txt".Append suffix (
_
,_n
) for pastepp
pP
.2025-02-21
Inform cd stderr through information bar.
Added invalid symlink handling.
Added cd history navigation (
H
: prev,L
: next).Improve cd history navigation (with cursor position).
2025-02-23
Supress inputs until command ls done.
Ignore some bindings at
..
(empty directory).Changed paste bindings. (
pp
,po
for mv, andpP
,pO
for cp).Added clipboard selection for recursive search.
2025-02-24
Use .bashrc function
n()
instead ofalias n='source n'
.Fixed cd history when there's only 2 logs.
Added trap return SIGINT for
:actions
.2025-02-25
Added
fzf_n_pseudo_ls
for less flickering.Execute
:actions
inside of fzf rather thanabort
pass.Better
fzf_n_pseudo_ls
decorations (with pos highlight).Respect the fzf environment variables (like
FZF_POS
).Added
FZF_N_BINDINGS
.2025-02-26
Use fzf-tmux while in tmux session.
└ (Recommend) tmux + fzf-tmux,
n
presents zero flickering experience.Changed instant rename method (more like inplace rename).
Added
fzf_n_tmux_popup
for future action update.Separate
fzf_n_opener
actions (checkn.conf
).Escape ampersands (&) in awk substitution.
2025-02-27
Use information bar to inform unregistered file type.
Maintain cursor position when cd returns stderr.
Added
fzf_n_bulk_rename
(A
) inn.conf
.Added symbolic link
-> absolute path
to information bar.2025-03-02
Inform cd history navigation stderr through information bar.
Reset bookmark cursor position if directory changed.
Suppress
n
bindings untilfzf_n_opener
ends.2025-03-03
Added FZF_N_COLORS in
n.conf
.2025-03-25
Changed
fzf_n_clipboard
to respect the order of selection (no sort).└ Added feature that
vr
do bulk renaming with above selections.Massive rework of
--bind
to handle double quote(s) such asfile".txt
├ Added
fzf_n_show_input
,fzf_n_input_state
.├ Improved
fzf_n_rename
,fzf_n_mkdir
,fzf_n_compress
,fzf_n_sh
,fzf_n_rsearch
...└ Changed
--bind 'tab,space:'
behavior.Added
fzf_n_awk_sub_str
├ Fixed the issue that cursor position not recovers after visit root dir '/'.
└ Fixed the issue that clipboard selection not recovers in dir that contains
(),[]
.Added paste binding
pl
forln -s
.Added conditions that ignore bindings when there's no clipboard selection.
Added
'
intoFZF_N_BINDINGS
.Fixed the issue that holding
h
(fastcd ..
) breaks cursor position recovery.Fixed the issue that
fzf_n_opener
,fzf_n_sh
resets search results.Fixed the issue that couldn't cd into selected file's dir in recursive search (
ctrl-/
).2025-04-11
Added fzf_n_scope (
i
) inn.conf
.Added
FZF_N_POINTER
inn.conf
.Removed last
/
when yank the dir with fzf_n_yank (y
,Y
).Fixed the issue that
fzf_n_compress
not perform the compress with inplace target (no selection).Fixed the issue that
fzf_n_compress
not perform the compress with filename (except extension) that already exists in current dir.2025-04-20
Changed tmux session
fzf_n_rename
method (using vim).Fixed the issue that
fzf_n_rename_inline
couldn't get the properFZF_N_RENAME_ORIG
.Fixed the issue that
fzf_n_mkdir_fin
doesn't reload when the new dir has sub dir.Fixed the issue that unselect (toggle off) not working when the target has
+
character.Added
--no-scrollbar
at the# main fzf command
.2025-04-22
Fixed the issue that bottom info not updated when the target removed by
fzf_n_bulk_rename
.2025-04-23
Fixed the issue that bottom info not updated with --bind
r
.Fixed the issue that cursor position lost after rename a symbolic link with
fzf_n_rename
.Fixed the issue that cursor position lost after add/remove file/dir with
fzf_n_opener
.Added condition for
fzf_n_rename
to move cursor to the very last.
of a file.2025-04-24
Fixed the issue that
fzf_n_compress_inline
not working.2025-05-23
Added
-f
option to the commandless
.Added bootandy/dust as alternative
du
command infzf_n_du
. (d
)Fixed the issue that clipboard compression not perform at the empty directory.
Changed
fzf_n_compress_fin
to usetmux splitw
intead offzf_n_tmux_popup
.2025-07-17
Changed
fzf_n_ls
to use same pos value instead of 1 to recover cursor position when the focused file not exists while refresh. (r
)Added executable handler in
fzf_n_scope
. (i
)2025-07-26
Fixed the issue that clipboard selection couldn't recover when the target has
*
character.Added
scope_ignore
for executable handler infzf_n_scope
. (i
)2025-07-30
Changed
fzf_n_bulk_rename
to use cursor position when it called without clipboard selection. (A
)2025-08-04
Added missing
LS_TIME
,LS_SORT
check forfzf_n_bulk_rename
(A
)2025-08-12
Fixed the issue that
fzf_n_paste
skips rest of work when the variableFZF_N_PASTE_NEW_NAME
assigned.Changed
vr
patch to only proceed mv when the name changed in 'Rename with 2 lists' method.Changed
FZF_N_COLORS
handling inn.conf
.Changed
FZF_N_MKDIR
to use --ghost inside of tmux session. (F7
)2025-08-14
Fixed the issue that
name swap
feature in patchedvr
not working. (A
)2025-08-23
Fixed wrong cp command in
fzf_n_ls
.Changed
fzf_n_cd_history
to ignore navigation input when there's no available entry (H
,L
).Removed
fzf_n_post_act
.└ Renamed
TMP_FZF_N-POST-ACT
toTMP_FZF_N-POST-ABORT
.Changed hide cursor (printf '\e[?25l') position in
# main fzf command
.└ Added show cursor (printf '\e[?25h') to
fzf_n_bookmark
andn.conf
.2025-08-24
Added
--history
option infzf_n_mkdir
. (F7
)Changed inline input prompt position to top from bottom.
├ Removed
fzf_n_pseudo_ls
.├ Added
inline_print_footer
forfzf_n_*_inline
process.├ Changed
+execute(...)
actions infzf_n_*_inline
to+become(...)
.└ Added
--sync
in# main fzf command
to prevent the blink after+become(...)
action.Changed
fzf_n_du
to ignore action input when the cursor placed at the..
(empty directory). (d
)2025-08-29
Added
fzf_n_clipboard_gen
to generate clipboard list.├ Added
fzf_n_clipboard_gen_rsearch
forfzf_n_rsearch
.└ Removed
transform:fzf_n_clipboard ...
actions from--bind tab,space
.Added feature that change directory via command cd in
fzf_n_sh
.Removed information bar until find the better way to handle delay.
├ Removed
--bind focus
and--bind multi
.└ Removed
transform-header:fzf_n_print_header ...
actions from each--bind
.Added
fzf_n_bulk_rename
.└ Removed
fzf_n_bulk_rename
fromn.conf
.Added vim folds in
--bind
.└ Removed
fzf_n_show_input
,fzf_n_input_state
Added
FZF_N_POINTER_PADDING
for text positioning infzf_n_bookmark
.2025-08-30
Added feature that focus cursor to the very first pasted source after
fzf_n_paste
done. (p
)├ Added
FZF_N_PASTE_INIT
andFZF_N_PASTE_IS_DIR
for the above process.└ Added
fzf_n_paste_init_push
to push the name of very first pasted source.Added
fzf_n_cycle
for the cyclic scroll.└ Added
FZF_N_CYCLE
inn.conf
.Added
LS_ALL
infzf_n_ls_cmd
to handle conditional output.Commented out the command
ls ... > TMP_FZF_N-FINFO
infzf_n_ls_cmd
.2025-09-04
Added
VR_MAIN
invr.diff
to handle exact lines that changed.Added escaping
.
rule infzf_n_grep_str
.Renamed
LS_TIME
toLS_ARGS
for better understanding.└ Renamed
TMP_FZF_N-LS-TIME-STR
toTMP_FZF_N-LS-ARGS
for better understanding.Changed
TMP_FZF_N-POS-STR
to write position string outside of sub function.Known issue
Still finding a way to keep the query string and it's input stream without using
xdotool key Escape
.└ Check
--bind 'load:transform:...'
and--bind 'change:transform:...'
.NOTE
Bulk renaming tool in
fzf_n_bulk_rename
function is modified version of snah/vim-bulk-rename by below patch.Below patch is adding features like
recursive rename
+extension filter
+name swap
+rename with 2 lists
and
delete (rm -rf)
[WARN].vr.diff
Beta Was this translation helpful? Give feedback.
All reactions