Live data from Hacker News

A terminal file manager written in bash

github.com

31–40 of 44 posts

Re: A terminal file manager written in bash

#32
post #26
post #22

given that this is only 100 lines of code i am quite impressed. however, i miss one feature for which i'd use a filemanager: in-place file renaming. in most cases when i want to rename a file, i want to change a small part of it, and i don't want to have to retype the whole filename. i have yet to find a commandline utility (emacs doesn't count ;-) that offers that.

No need for a filemanager for in place file renaming. For that I'd just use curly bracket in bash or zsh. e.g. mv /path/to/file{-old-name,-new-name}.txt which expands to: mv /path/to/file-old-name.txt /path/to/file-new-name.txt So use tab completion to get your path then go back and stick your curly brackets into it as needed. Oh and it works for things like git branch renaming or anything else you do in the terminal…

thanks, but that takes more conscious effort to get right that is worth it for me. i tend to just copy the filename twice and then edit the second version to the target.

but now i'll become good friends with qmv

greetings, eMBee.

Re: A terminal file manager written in bash

#33

Earlier quoted context omitted.

Two things that I always reach for Emacs to accomplish are git and file management, via Magit and Dired(X) respectively. Here's a quick cheat sheet of the things I use Dired for: C-x C-j (jump to directory) Open the current directory in Dired (requires that you first (require 'dired-x)) from any buffer, even other directories, but usually from within files. C-x C-q (edit directory) Start editing the current directory…

Wow, I switched to Emacs earlier this year and have not encountered dired mode before. This is fantasic!

If you like dired-mode then checkout helm

https://github.com/emacs-helm/helm/wiki#helm-workflow-for-fi...

Re: A terminal file manager written in bash

#34
post #22

given that this is only 100 lines of code i am quite impressed. however, i miss one feature for which i'd use a filemanager: in-place file renaming. in most cases when i want to rename a file, i want to change a small part of it, and i don't want to have to retype the whole filename. i have yet to find a commandline utility (emacs doesn't count ;-) that offers that.

Perl has shipped with a `rename` utility for ages, that you can use like:

    rename 's/foo/bar/' *.ext
Of course you have to know Perl...

Re: A terminal file manager written in bash

#35

Earlier quoted context omitted.

Two things that I always reach for Emacs to accomplish are git and file management, via Magit and Dired(X) respectively. Here's a quick cheat sheet of the things I use Dired for: C-x C-j (jump to directory) Open the current directory in Dired (requires that you first (require 'dired-x)) from any buffer, even other directories, but usually from within files. C-x C-q (edit directory) Start editing the current directory…

Wow, I switched to Emacs earlier this year and have not encountered dired mode before. This is fantasic!

Emacs truly superb for discovering new things. I always try to learn a new Emacs feature every couple of weeks.

I even got my mother-in-law using Emacs!

Re: A terminal file manager written in bash

#36
post #22

given that this is only 100 lines of code i am quite impressed. however, i miss one feature for which i'd use a filemanager: in-place file renaming. in most cases when i want to rename a file, i want to change a small part of it, and i don't want to have to retype the whole filename. i have yet to find a commandline utility (emacs doesn't count ;-) that offers that.

Tab is your friend! At least in zsh it manages file name completion well - including cycling through options of there is more than 1 match for your partial name.

Of course, you could get more advanced with parameter tricks, eg. ${i%.ps}.pdf for changing the extension of $i from ps to pdf. (Technically: truncating the ending iff it matches ".ps" and adding ".pdf" no matter what.)

Re: A terminal file manager written in bash

#37
post #4

Ranger has taken over my world the past few years. Heck I even have it working in Windows 10 in the Linux Subsystem (OpenSUSE for me). Ranger for me is just as fast in real life and my work Windows 10 machines are not anything to write home about.

Link for anyone like me who's never heard of it before: https://github.com/ranger/ranger

it's also already packaged in most distributions if you want to install it easily.

Re: A terminal file manager written in bash

#38
post #20

Earlier quoted context omitted.

Run on a machine that doesn't have Emacs installed.

No need to install anything with "Tramp" mode ( https://www.emacswiki.org/emacs/TrampMode )

tramp is built into emacs now. Between tramp and helm the problem is solved :-P

Re: A terminal file manager written in bash

#39
post #4

Ranger has taken over my world the past few years. Heck I even have it working in Windows 10 in the Linux Subsystem (OpenSUSE for me). Ranger for me is just as fast in real life and my work Windows 10 machines are not anything to write home about.

I've used Ranger in the past but eventually went back to Midnight Commander. From a usability point of viewer nothing compares with a fixed 2 panels file list.

If you're on Windows Far manager is amazing. It's really customizable too with plugins and shortcuts. I rarely use Windows these days so I had forgotten about it, but it's like midnight commander taken to another level.
Post reply on HN