I personally hate the use of octal numbers for rights, as that is so easy to make a mistake. And Never Use 7 Except in the first group. Because you should NEVER give OTHERS write access to files or directories. That is a security threats, and only experience users should use that right.
Your videos are doing a great job at making the capabilites of Emacs acessible for users coming from a non-technical background. Thank you very much! 0:00 Introduction 1:00 The 'find-file' command; Navigating and opening directories and files 10:17 Accessing and navigating history of prior searches 12:10 Navigating by using an absolute file system path 15:02 The 'vertico' and the 'marginalia' package 17:28 Finding files and directories by typing just abbreviations 19:14 Configure dired to hide details (dired-hide-details-mode) 20:11 'dired-jump' (C-x C-j): command for jumping to parent directory 21:29 'dired-directory-up (^) 22:20 'dired-find-file-other-window' (o) 24:07 Moving and renaming files 25:38 How to delete a file (D) 26:45 How to rename a file (R) 29:13 Operating on multiple files at once 32:22 Making dired buffer editable (C-x C-q), save changes with C-C C-c 33:32 Recording a keyboard macro 36:26 Using dired as a dual pane file manager 39:00 Create an empty file by visiting a file that doesn't exist with C-x C-f 39:58 Mark files that match a given regexp (% m) 41:54 Remove marked items from the current listing without deleting (k) 44:40 Remove everything except marked items from the current listing by toggling the mark (t) and (k) 46:34 Introduction to file permissions 48:17 How to modify file permissions 51:11 A few more commands 51:45 project-find-file 53:32 Introducing the 'consult' package 54:07 Searching with 'consult-find' 56:25 Use dired to open files externally 1:00:37 How to populate the minibuffer with the file at point in a buffer 1:01:34 The 'dired' command for opening directories
Thank you for the introduction. It's a little long, but skipping forward (and backward) I managed to find the "gold" for getting started with dired. It's an awesome product, will try to remove the system file manager and see how it goes 🙂
what I find useful for quickly searching a dir full of files is to just use n and p to move point up and down in dired and then visit a file with letter v and exiting it with q. that is blazingly fast and as it does not require the kill buffer shortcut
Very nice. It is always good to see you mastering Emacs and being so understandable in showcasing everything. Also, I noticed along your life trajectory, you master (or have good knowledge) about a wide range of things. Emacs, linux in general (wms scripts), philosophy, politics, and just recently the construction area. ` How do you learn things? Learning is a wide area discussed in psychology, pedagogy, and philosophy. Although we have a variety of yt content on the subject, it is not quite rich in content and is just "show off quick methods" in order to "hack your brain". Just a curiosity and a way to compliment your intelligence. Thanks for taking the time to record this video. Much appreciated.
Thank you! I will have to do a video about this topic in particular. Hints of how I approach it are provided in the talk about "Productivity, honesty, and accountability structures": protesilaos.com/books/2023-02-21-productivity-honesty-accountability-structures/
Just wow, I think I just stumbled on my favorite Emacs channel, very well done! I love the pace and you keep it interesting at all times, no meaningless chatting about irrelevant stuff. I have a kind of unrelated question which you may have a separate video about (sorry, haven't explored all your content yet): I couldn't help by noticing your very clean environment. I assume you're using a tiling window manager, and I see no panels or chrome around the windows. Could you share what setup you're using when it comes window management? Thanks again!
Could you please clarify how to get the icons next to the files and directories in the buffer ? I'm unable to see it in my dired installation of emacs.
Hi, Prot! I think in one of your videos you have a dired view that shows full file paths for each file, unlikely the normal view that is the heading for the folder the files are in then their names listed. Can you shed some light how I can have full file name lists instead of the default view? I know this sounds kinda dumb, but I want to have a dired buffer that lists all files under a directory and mark some files comparing to a another dired buffer containing symlinks. If I want to edit or delete or add these symlinks, I will make a macro so Emacs will mark them all, comparing the two buffers, so I can keep track and not mark all the musics again and eventually forget some. I am pretty sure I have some duplicates filenames, so path+filename is the safer way to do it. That's how I am planning to sync music across my phone and computer (local music gang + syncthing + emacs shenanigans).
I don't remember. There is an option to consolidate arbitrary file paths into a single Dired buffer, though I am not sure this is what you have in mind. Otherwise, you may be referring to Dired's ability to insert the contents of a subdirectory in the current buffer (I use that frequently). Please let me know and I am happy to help.
I love your videos, you are an excelent teacher! I have a question: How do you see the icons next to the names in dired? Mine only shows the name, not the pretty icons you have next. Thank you!
Thank you! You need to install and set up the 'nerd-icons-dired' package: github.com/rainstormstudio/nerd-icons-dired. This will pull in the 'nerd-icons' dependency. Once you have these, do 'M-x nerd-icons-install-fonts' and then restart Emacs. You should now see icons in Dired buffers.
;; I can't do without those dired configurations ;; I find dired-jump very useful, jump to current directory of the current buffer (define-key global-map (kbd "C-x C-") 'dired-jump) ;; Makes the dired buffer uncluttered and more clear (add-hook 'dired-mode-hook 'dired-hide-details-mode) ; hide ls information, show only file names (add-hook 'dired-mode-hook 'hl-line-mode) ; highlight current line on dired buffers ;; using double paned midnight commander's like workflow (setq dired-dwim-target t) ;; Delete files by trashing, it is safer than just deleting (setq delete-by-moving-to-trash t) ;;; optional stuff (setq dired-recursive-copies 'always) (setq dired-recursive-deletes 'top) (setq dired-create-destination-dirs 'ask)
amazing as always Prot! Do you have any code handy so that 'RET' runs the default program suggested after calling '(dired-do-async-shell-command'? E.g hitting 'RET' on video opens it with mpv etc
Here is the first idea that comes to mind: ;; NOTE 2023-06-27: This user option is quick-and-dirty. I prefer not ;; to have an option at all and simply do the right thing based on ;; `dired-guess-shell-alist-user'. (defcustom prot-dired-always-external-regexp "\\(mkv\\|mp4\\|mp4\\|ogg\\|m4a\\|webm\\)" "Regular expression of file extensions to open externally. The test is performed by `prot-dired-open-dwim', which then defers to the `dired-guess-shell-alist-user'." :group 'prot-dired :type 'string) ;; NOTE 2023-06-27: This is a proof-of-concept. See the previous ;; note. (defun prot-dired-open-dwim (files) "Open FILES using the appropriate program." (interactive (list (dired-get-marked-files))) (if-let* ((extension (file-name-extension (car files))) ((string-match-p extension prot-dired-always-external-regexp)) (guess (dired-guess-default files)) (program (if (listp guess) (car guess) guess))) (dired-do-async-shell-command program nil files) (find-file (car files))))
Sorry, I'm really late to the party here, but, 'W' says browse URL, but, it actually leaves it up to the system to open the file in the system default viewer. It only works "async" from what I can see, but, probably that's what you want here.
I don't think its default behaviour for emacs to read as you type and update the displayed files. Maybe you have some setting enabled that I'm not aware of
@@protesilaos I apologize for commenting before finishing the video and seeing the vertico section. May I ask now how you are getting icons in dired? Also, do you ever use dark themes?
@jakeh.8754 The icons are done with the 'all-the-icons-dired' package. It depends on the 'all-the-icons' package. Install the latter, then do M-x all-the-icons-install-fonts. Once the fonts are installed, set up the activation of the aforementioned mode with: (add-hook 'dired-mode-hook 'all-the-icons-dired-mode) Yes, I do use light themes. Though only when the environmental light is low. I like all the dark themes in the packages 'modus-themes' and 'ef-themes' (developed by me).
Four months later, I ditched everything else and now use Emacs full-time. Your videos are amazing! I wouldn't have found the motivation if I hadn't come across them.
Your Emacs videos should come with a NSFT (Not Safe For Tinkerers) warning! I just know before even watching this, that I'm going to pick up some 'Oh, that's neat' trick, and want to `C-x b` my init.el This time I shall resist.
Thank you!! Excellent presentation
You are welcome!
12:08 "File name shadow mode" - this is a great hidden feature I didn't know
One of the best and efficient video/instructions for find-file and dired.
Thanks a lot!
I personally hate the use of octal numbers for rights, as that is so easy to make a mistake.
And Never Use 7 Except in the first group. Because you should NEVER give OTHERS write access to files or directories. That is a security threats, and only experience users should use that right.
You are welcome!
Indeed, 7 for everybody is a bad idea.
Excellent presentation at showing many of the capabilities of dired that are really useful! Thank you Protesilaos!
You are welcome!
Your videos are showing me just how much of a powerhouse Emacs really is. Thanks a lot!
You are welcome!
this video was filmed on my birthday. i remember exactly what i was doing while you were filming this video
Your videos are doing a great job at making the capabilites of Emacs acessible for users coming from a non-technical background. Thank you very much!
0:00 Introduction
1:00 The 'find-file' command; Navigating and opening directories and files
10:17 Accessing and navigating history of prior searches
12:10 Navigating by using an absolute file system path
15:02 The 'vertico' and the 'marginalia' package
17:28 Finding files and directories by typing just abbreviations
19:14 Configure dired to hide details (dired-hide-details-mode)
20:11 'dired-jump' (C-x C-j): command for jumping to parent directory
21:29 'dired-directory-up (^)
22:20 'dired-find-file-other-window' (o)
24:07 Moving and renaming files
25:38 How to delete a file (D)
26:45 How to rename a file (R)
29:13 Operating on multiple files at once
32:22 Making dired buffer editable (C-x C-q), save changes with C-C C-c
33:32 Recording a keyboard macro
36:26 Using dired as a dual pane file manager
39:00 Create an empty file by visiting a file that doesn't exist with C-x C-f
39:58 Mark files that match a given regexp (% m)
41:54 Remove marked items from the current listing without deleting (k)
44:40 Remove everything except marked items from the current listing by toggling the mark (t) and (k)
46:34 Introduction to file permissions
48:17 How to modify file permissions
51:11 A few more commands
51:45 project-find-file
53:32 Introducing the 'consult' package
54:07 Searching with 'consult-find'
56:25 Use dired to open files externally
1:00:37 How to populate the minibuffer with the file at point in a buffer
1:01:34 The 'dired' command for opening directories
Thank you!
Prot, happy to see you back on Emacs track and full of energy as it seems. Have a great Sunday, greetings from Germany
Thank you! Best regards from the mountains of Cyprus.
Cool und very usefull video, thank you very much!
You are welcome!
Thank you for the introduction. It's a little long, but skipping forward (and backward) I managed to find the "gold" for getting started with dired. It's an awesome product, will try to remove the system file manager and see how it goes 🙂
You are welcome and good luck!
what I find useful for quickly searching a dir full of files is to just use n and p to move point up and down in dired and then visit a file with letter v and exiting it with q. that is blazingly fast and as it does not require the kill buffer shortcut
Yes, this is nice.
thank you for the detailed information.
You are welcome!
Very nice. It is always good to see you mastering Emacs and being so understandable in showcasing everything. Also, I noticed along your life trajectory, you master (or have good knowledge) about a wide range of things. Emacs, linux in general (wms scripts), philosophy, politics, and just recently the construction area. ` How do you learn things? Learning is a wide area discussed in psychology, pedagogy, and philosophy. Although we have a variety of yt content on the subject, it is not quite rich in content and is just "show off quick methods" in order to "hack your brain". Just a curiosity and a way to compliment your intelligence. Thanks for taking the time to record this video. Much appreciated.
Thank you! I will have to do a video about this topic in particular. Hints of how I approach it are provided in the talk about "Productivity, honesty, and accountability structures": protesilaos.com/books/2023-02-21-productivity-honesty-accountability-structures/
Thanks, the set header and auto align features are pretty spiffy!
You are welcome!
excellent recap of the basics. Brothers of the true church make no proselytes! :)
Haha, thanks!
These are beautiful
Thank you!
Just wow, I think I just stumbled on my favorite Emacs channel, very well done! I love the pace and you keep it interesting at all times, no meaningless chatting about irrelevant stuff.
I have a kind of unrelated question which you may have a separate video about (sorry, haven't explored all your content yet): I couldn't help by noticing your very clean environment. I assume you're using a tiling window manager, and I see no panels or chrome around the windows. Could you share what setup you're using when it comes window management?
Thanks again!
Yes, it is a tiling window manager. I have all the configurations in my dotfiles: github.com/protesilaos/dotfiles
Could you please clarify how to get the icons next to the files and directories in the buffer ? I'm unable to see it in my dired installation of emacs.
Hi, Prot! I think in one of your videos you have a dired view that shows full file paths for each file, unlikely the normal view that is the heading for the folder the files are in then their names listed. Can you shed some light how I can have full file name lists instead of the default view? I know this sounds kinda dumb, but I want to have a dired buffer that lists all files under a directory and mark some files comparing to a another dired buffer containing symlinks. If I want to edit or delete or add these symlinks, I will make a macro so Emacs will mark them all, comparing the two buffers, so I can keep track and not mark all the musics again and eventually forget some. I am pretty sure I have some duplicates filenames, so path+filename is the safer way to do it. That's how I am planning to sync music across my phone and computer (local music gang + syncthing + emacs shenanigans).
I don't remember. There is an option to consolidate arbitrary file paths into a single Dired buffer, though I am not sure this is what you have in mind. Otherwise, you may be referring to Dired's ability to insert the contents of a subdirectory in the current buffer (I use that frequently). Please let me know and I am happy to help.
I love your videos, you are an excelent teacher! I have a question: How do you see the icons next to the names in dired? Mine only shows the name, not the pretty icons you have next.
Thank you!
Thank you! You need to install and set up the 'nerd-icons-dired' package: github.com/rainstormstudio/nerd-icons-dired. This will pull in the 'nerd-icons' dependency. Once you have these, do 'M-x nerd-icons-install-fonts' and then restart Emacs. You should now see icons in Dired buffers.
@@protesilaos Thank you! It worked like a charm
I love your theme! please tell me what theme this is! i've been looking for something bright and colorful that looks good
This is the ef-elea-light theme from my package ef-themes.
;; I can't do without those dired configurations
;; I find dired-jump very useful, jump to current directory of the current buffer
(define-key global-map (kbd "C-x C-") 'dired-jump)
;; Makes the dired buffer uncluttered and more clear
(add-hook 'dired-mode-hook 'dired-hide-details-mode) ; hide ls information, show only file names
(add-hook 'dired-mode-hook 'hl-line-mode) ; highlight current line on dired buffers
;; using double paned midnight commander's like workflow
(setq dired-dwim-target t)
;; Delete files by trashing, it is safer than just deleting
(setq delete-by-moving-to-trash t)
;;; optional stuff
(setq dired-recursive-copies 'always)
(setq dired-recursive-deletes 'top)
(setq dired-create-destination-dirs 'ask)
Nice! I also set most of these.
no 1 best man
Thanks!
amazing as always Prot!
Do you have any code handy so that 'RET' runs the default program suggested after calling '(dired-do-async-shell-command'?
E.g hitting 'RET' on video opens it with mpv etc
Here is the first idea that comes to mind:
;; NOTE 2023-06-27: This user option is quick-and-dirty. I prefer not
;; to have an option at all and simply do the right thing based on
;; `dired-guess-shell-alist-user'.
(defcustom prot-dired-always-external-regexp
"\\(mkv\\|mp4\\|mp4\\|ogg\\|m4a\\|webm\\)"
"Regular expression of file extensions to open externally.
The test is performed by `prot-dired-open-dwim', which then
defers to the `dired-guess-shell-alist-user'."
:group 'prot-dired
:type 'string)
;; NOTE 2023-06-27: This is a proof-of-concept. See the previous
;; note.
(defun prot-dired-open-dwim (files)
"Open FILES using the appropriate program."
(interactive (list (dired-get-marked-files)))
(if-let* ((extension (file-name-extension (car files)))
((string-match-p extension prot-dired-always-external-regexp))
(guess (dired-guess-default files))
(program (if (listp guess) (car guess) guess)))
(dired-do-async-shell-command program nil files)
(find-file (car files))))
@@protesilaos It works! thanks very much!
Sorry, I'm really late to the party here, but, 'W' says browse URL, but, it actually leaves it up to the system to open the file in the system default viewer. It only works "async" from what I can see, but, probably that's what you want here.
Hi Prot,
Do you know how to always use short version on a folder? Right now I have to press ( to toggle short mode.
(add-hook 'dired-mode-hook 'dired-hide-details-mode)
Exactly what @joseluis_io wrote.
Thanks a lot!
I don't think its default behaviour for emacs to read as you type and update the displayed files. Maybe you have some setting enabled that I'm not aware of
The default minibuffer requires that you type TAB to update what it displays in the "Completions" buffer. Whereas Vertico displays the matches live.
@@protesilaos I apologize for commenting before finishing the video and seeing the vertico section. May I ask now how you are getting icons in dired? Also, do you ever use dark themes?
@jakeh.8754 The icons are done with the 'all-the-icons-dired' package. It depends on the 'all-the-icons' package. Install the latter, then do M-x all-the-icons-install-fonts. Once the fonts are installed, set up the activation of the aforementioned mode with: (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
Yes, I do use light themes. Though only when the environmental light is low. I like all the dark themes in the packages 'modus-themes' and 'ef-themes' (developed by me).
1:01:25 oh, i didn't know that!
That's basically the story of every Emacs user: always learning something new.
The more I watch these videos the more it's harder for me to use other editors. Emacs ruined everything else for me
I guess you have to use those other editors? If not, then using Emacs full time is the way to go.
Four months later, I ditched everything else and now use Emacs full-time. Your videos are amazing! I wouldn't have found the motivation if I hadn't come across them.
Your Emacs videos should come with a NSFT (Not Safe For Tinkerers) warning! I just know before even watching this, that I'm going to pick up some 'Oh, that's neat' trick, and want to `C-x b` my init.el
This time I shall resist.
Good point! I guess this warning should go with every Emacs-related publication. There is just so much to learn and experiment with!