--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
-
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/
.Check below
n.conf
,bookmark
then edit for your system.Then, 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
Finding potential of fzf is one of fun time in CLI,TUI life.
Still early idea and gonna change a lot, but worth to share.
Guess this script deserve to have some repo,
but I'm too lazy for version management.
And this is a just baby step to actual useful. 😅
But I believe you can upgrade, improve this script better. (Like adding --preview)
Cause that's how FOSS world runs. 👍
UPDATE 1.
Handle symbolic link for directory.
UPDATE 2.
Add recursive search (
ctrl-/
).UPDATE 3.
Add bookmark. (
'
)UPDATE 4.
Add
remove
action forfzf_clipboard
.UPDATE 5.
Add select all (
ctrl-a
) and toggle all (v
).UPDATE 6.
Add information bar.
UPDATE 7.
Support LS_COLORS.
Support multiple instance.
UPDATE 8.
Add clipboard indicator
[n]
at the infomation bar.Add clear clipboard selection (
u
).UPDATE 9.
Add instant rename (
a
).Add instant mkdir (
f7
).UPDATE 10.
Add instant shell (
s
).Change temporary shell binding to
S
from;
.UPDATE 11.
Remember clipboard selection for each directory.
Restore right cursor position after instant or fzf_paste actions.
UPDATE 12.
Add configuration
n.conf
.Add instant compress of clipboard contents (if none, just focused item) (
C
).└
:compress archive_name
(zip only).UPDATE 13.
Now
n
restorecd in
cursor position not justcd ..
.Add display hidden toggle (
.
).Add get total size of clipboard contents (if none, just focused item) (
d
).Change paste method to chain binding (
p
).Spawn bookmark list without screen clear.
UPDATE 14.
Add sort by time (
o
).Add
fzf_n_grep_str
to handle brackets.Change substitution method (to
awk
fromsed
) to handle unique names like "f|i|l|e.txt".UPDATE 15.
Append suffix (
_
,_n
) for pastepp
pP
.Inform cd stderr through information bar.
Add invalid symlink handling.
UPDATE 16.
Add cd history navigation (
H
: prev,L
: next).UPDATE 17.
Improve cd history navigation (with cursor position).
UPDATE 18.
Supress inputs until ls ready.
Ignore some bindings at
..
(empty directory).Change paste bindings. (
pp
,po
for mv, andpP
,pO
for cp).UPDATE 19.
Use .bashrc function
n()
instead ofalias n='source n'
.Add clipboard selection for recursive search.
Fix cd history when there's only 2 logs.
Add trap return SIGINT for
:actions
.UPDATE 20.
Add
fzf_n_pseudo_ls
for less flickering.Execute
:actions
inside of fzf rather thanabort
pass.UPDATE 21.
Better
fzf_n_pseudo_ls
decorations (with pos highlight).Respect the fzf environment variables (like
FZF_POS
).Add FZF_N_BINDINGS.
UPDATE 22.
Use fzf-tmux while in tmux session.
└ (Recommend) tmux + fzf-tmux,
n
presents zero flickering experience.Change instant rename method (more like inplace rename).
UPDATE 23.
Add
fzf_n_tmux_popup
for future action update.Separate
fzf_n_opener
actions (TUI or GUI).Beta Was this translation helpful? Give feedback.
All reactions