Questions tagged [dired]

Dired is a major mode that allows users to edit files and directories on a file system. It is essentially a file browser, with a wide range of features and an appearance similar to the `ls` command.

Filter by
Sorted by
Tagged with
0 votes
0 answers
1 view

Is there a way to get a toggle-able dired window?

I'd like to have dired pop up, either as a side window (like treemacs) or just to switch to its buffer (in the main window) with a keystroke. I've already changed its behavior to reuse the same buffer ...
0 votes
1 answer
20 views

How to change icon associated with a file-extension in Dired and all-the-icons?

I use dired with (all-the-icons-dired which uses all-the-icons). Current State: .m file presented with apple logo. Goal: Change (override) icon of .m file to same as icon of .matlab file extension. ...
  • 287
0 votes
0 answers
14 views

Why does this keybinding affect all buffers?

I defined a keybinded to effect the dired-mode-map: (eval-after-load 'dired '(evil-define-key 'normal 'dired-mode-map (kbd "n") 'dired-create-empty-file)) when I press n in any buffer, ...
  • 243
1 vote
1 answer
23 views

How to programmatically find buffer visiting specific directory

I'm looking for something similar to (find-buffer-visiting FILENAME &optional PREDICATE) that would find a dired-mode buffer visiting a specified directory. Something like: (find-buffer-visiting-...
  • 724
0 votes
1 answer
24 views

Compare recursive flattened/"branch view" list of files between two directories in emacs/linux

I have two folders, "old" and "new". The "new" folder includes files from "old" that have been copied into subfolders by a program. [-] Test |--[-] New | |--...
  • 33
1 vote
1 answer
97 views

How to have Dired always list only the files that have extension `.org`, for a particular directory?

I use C-x d *.org to list only files with .org extension. Is there a way to make this permanent for that directory? I have to do this every time I open that directory, it would be nice to have it ...
  • 117
0 votes
0 answers
11 views

dired-do-find-regexp-and-replace function error in dired -> emacs is looking for 'project--files-in-directory' which doesn't exist

I have a problem with dired-do-find-regexp-and-replace in dired (by default mapped to 'Q'). I mark the applicable files as required, hit 'Q', enter my search and replacement strings and then get this ...
4 votes
1 answer
34 views

Isearch + Dired fast navigation

After seeing this post and one of its comments, I am trying to implement the following convenient search pattern in dired: Press C-s to start isearch Type the substring I am looking for Possibly jump ...
0 votes
1 answer
14 views

spacemacs/dired-aux rename file to similar name without ivy/counsel trying to rename to same file name

In spacemacs I find that two ways to get a new copy of a file with a slightly different filename both suffer from the same completion problem: C-x C-w (write-file) dired-aux's dired-do-rename (bound ...
1 vote
1 answer
30 views

From the minibuffer, how can I get the file pointed to in dired?

I'd like to write elisp function with the following functionality: It can be invoked from the minibuffer, and it will then relate to the latest selected window buffer. If the selected buffer is in ...
1 vote
1 answer
90 views

Key sequence for going up in the directory tree with Dired?

When Dired is open, It would be cool if I could press one key and go up in the directory tree, to the parent directory. I have this feature in vim with netrw and I'd like to recreate it. I'd like to ...
  • 243
0 votes
0 answers
61 views

Dired: filter files in dired-subtree

Omiting files works for newly open buffer (setq dired-omit-files "^[.].*"). But it doesn't work for subtree, function 'dired-subtree-toggle'. I've tried with (setq dired-filter-stack '((omit ...
  • 451
0 votes
0 answers
15 views

Issue seeing files in dired directory or shell on remote machine

This used to work fine but seems to have broken today and I have not knowingly made any explicit changes to configuration. If I use a standard terminal (mac) and ssh into my server I can visit a path ...
  • 239
1 vote
0 answers
46 views

How do I start emacs with two horizontal windows one of which is dired?

How do I write a function and call it in my init script so that when I open a file, I have two horizontal windows, the left one being dired mode and about 25% of the total emacs screen, while the ...
  • 111
0 votes
0 answers
25 views

Turn directory to file in dired

I often make the mistake of creating a directory instead of a file in Dired (by hitting +). I then have to delete it and recreate the file, with the same name. Sometimes, I tried to edit the d file ...
  • 1,535
2 votes
1 answer
120 views

Failed to trash remote directories over tramp

With (setq delete-by-moving-to-trash t), deleting a non-empty directory in a remote dired buffer fails with message file-error: Couldn’t delete /ssh:server:/home/user/Downloads/some_directory. I tried ...
1 vote
1 answer
31 views

Using `ls' Switches Instead of Omit Mode

As per this page An alternative to using Omit mode: Use C-u s to change the ls switches and immediately refresh. (C-u s refreshes also, so there is very little typing involved.) You can remove -a ...
  • 117
1 vote
1 answer
65 views

How can I get the name of the file on the current Dired line?

I'm running emacs on WSL. The following function launches the binary file marked in dired: (defun wsl/execute () "execute file at point in dired" (interactive) (dired-do-shell-command ...
  • 145
0 votes
1 answer
81 views

How can I recursively find and replace text in case sensetive?

I am using combination of following solutions in order to find-and-replace matched text in all Python files: Using Emacs to recursively find and replace in text files not already open How can I ...
  • 1,114
2 votes
4 answers
117 views

find-name-dired : save selection of files for reuse?

I try to use find-name-dired, everything works out as expected. Is there a way to save the selection of files for reuse?
  • 21
1 vote
1 answer
34 views

Why does counsel-find-file use the current Dired directory when I specify argument INITIAL-DIRECTORY?

I am trying to use counsel-find-file to open the folder containing my Emacs configuration through a call such as the following: (counsel-find-file 'nil "~/Documents/test-emacs/.emacs.d/") ...
3 votes
1 answer
250 views

Tramp mode - Copying files

when copying files in tramp mode via ssh with Dired I am not able to do anything else in Emacs. Emacs is just not usable till this process has finished. Is there any way to use Emacs while it copies ...
  • 131
1 vote
2 answers
51 views

Read-only mode gets in the way when query-replacing text in multiple files

I am searching and replacing text within all marked files in a Dired buffer, as per this post: https://emacs.stackexchange.com/a/9497/37866 I am successful until the point where it finds the first ...
  • 11
1 vote
1 answer
529 views

all-the-icons are all white in dired

I recently setup all-the-icons with dired (all-the-icons-dired) and the appropriate icons do appear but they're all white for some reason. I tried reducing my ~/.emacs down to just the dired settings ...
  • 211
2 votes
1 answer
242 views

How to show current directory in Dired with symlinks resolved

I have ~/bin -> ~/some/long/path/bin. When I open ~/bin in Dired, it tells me at the top that it is looking at /Users/username/bin, i.e. it expands '~' in the current directory printed on the ...
  • 21
0 votes
0 answers
14 views

Error in dired-find-file-place when saving

I've been an Emacs user for 30 years. This week I'm switching to a new machine with Ubuntu 21.10 installed. Now when I save a file, it always errors out with the error message: "Error in dired-...
  • 101
3 votes
1 answer
79 views

How to not hide Dired details initially, with Dired+?

I have GNU Emacs 27.2 (of 2021-11-18; on macOS 12.1) and updated dired+.el from dired+ just now (to fix a bug, so I can't go back to the old version of dired+.el I had). Before the update, dired-mode ...
2 votes
1 answer
82 views

Save excursion not working for dired-find-file-other-window

I wrote this function to basically bring my cursor back to the dired buffer, after opening the file in another window. This is so that I can scroll down the buffer, pressing o to keep previewing the ...
  • 288
2 votes
1 answer
162 views

Deleting a file to ~/.Trash produces "File already exists..." if a file of that name is there [duplicate]

I have (setq trash-directory "~/.Trash") and (setq delete-by-moving-to-trash t) in .emacs to be able to have files moved to ~/.Trash via d and then x in dired-mode. (This is in macOS.) But ...
0 votes
1 answer
55 views

Problems saving files and creating directory

I have recently set-up a new Emacs on my OSx 10.15. Every time I try to create a directory in Dired with + I got a warning telling the files already exist. Another strange result I got when I try to ...
-1 votes
2 answers
38 views

Not correct reverse sort in dired mode

Linux Mint 20.2 Emacs 27.2 Installed packages: dired+ dired-hacks-utils-20201005.2318 dired-k-20200322.2035 dired-narrow-20181114.1723 dired-quick-sort-20201221.403 dired-recent-20211004.1924 dired-...
  • 3,649
0 votes
0 answers
14 views

dired: read/write access to local folder contents (root/wheel), similar to "sudo -s" [duplicate]

The local folder /private/var/root (owner: root / group: wheel) on OSX (El Capitan) contains certain data that I would like to have "read/write" access; e.g., /private/var/root/Library/...
  • 18.3k
1 vote
2 answers
69 views

Exotic dired-based window-splitting mode

NOTE: I added more info to this query. Initially, I didn't mention dired, but after experimenting, I see that it needs to be explicitly discussed here, because of how it manages buffers. I'm using ...
  • 562
2 votes
1 answer
82 views

How to create independent Dired buffers for the same directory?

I'm trying to programmatically define the windows in my frame. I have 4 windows, two with dired buffers in them so that I can select the file I want to visit. (delete-other-windows) (split-window-...
  • 4,127
0 votes
2 answers
370 views

How to debug error in process sentinel?

I've recently switched to doom emacs, and for the most part it's working great. However, when I'm looking at a folder in dired-mode, if I copy a file using C the file is copied but *Messages* contains ...
2 votes
1 answer
80 views

gzip: stdin: unexpected end of file

Linux Mint 20.1 Emacs 27.1 I connect to remote Linux host by tramp mode. Success connect. Nice. But when in dired mode I try to open log file (press Enter) I get the next message: gzip: stdin: ...
  • 3,649
1 vote
1 answer
99 views

dired-do-delete fails to delete file

In Dired, with point on a file name, I invoke dired-do-delete and confirm. The line disappears, as it normally does when a file is deleted. But the file is not in fact deleted, as I can see by e.g. ...
  • 188
0 votes
2 answers
49 views

Unable to remap mouse under dired in macos emacs

I'm not sure whether this should be considered an appropriate post for emacs.stackexchange, or whether this should go to some sort of macos forum. Please let me know if I need to ask the following ...
  • 562
1 vote
1 answer
68 views

How do you target the present directory, once in a while, with do-what-I-mean enabled?

After setting Dired do-what-I-mean (setq dired-dwim-target t) which, quoting the man pages If non-nil, Dired tries to guess a default target directory. This means: if there is a Dired buffer ...
  • 483
1 vote
1 answer
42 views

How can I prevent ` running timer: (void-function vc-git-root)` error

vc-git-root walks up the tree until it finds the directory that contains the .git subdir and declares that to be the root of the repo. But if there is not .git folder in the root directory, (vc-git-...
  • 1,114
0 votes
0 answers
73 views

`void-variable: Symbol’s value as variable is void: v` when deleting remote directory in dired

This recently started happening. Whenever I try to recursively delete any remote directory from dired (i.e. D over the dired entry), I get this after Emacs asks me for confirmation: void-variable: ...
  • 123
0 votes
1 answer
120 views

Search and Replace for a block on many lines in a dozen files

I have a a bunch of HTML files and in each of them I want to replace a fixed block of approx 30 lines with a one liner. Is there an Emacs command or package which makes this easier? Using e.g. dired-...
  • 1,135
0 votes
3 answers
234 views

How can I recursively find and replace in the current git repository

I am working inside a git-repo. Here I want to apply my search operation based on the root directory of the git repo that current buffer is open. Here I do: find-dired "~/my_project" ... in ...
  • 1,114
1 vote
4 answers
97 views

How to programmatically mark files in dired based on file modification time?

I'd like to write a bit of elisp to mark all files in a dired buffer that are "old": the files were last modified more than 10 days ago, say. What would be a good way to do that? It seems ...
  • 369
1 vote
0 answers
72 views

dired-icon not show icons in dired-subtree

Linux Mint 20 Emacs 27.1 package: dired, dired+, dired-icon dired-icon In folder Temp has: Folder: MyFolder Files: someFile.txt someFile2.txt In folder MyFolder has: Folders: mySubFolder_1 ...
  • 3,649
1 vote
1 answer
43 views

How not select dot and double dots in dired mode

Linux Mint 20 Emacs 27 package dired, dired+ In folder Downloads I has: one folder and two files. I want to delete all content of folder Downloads So as result on Dired mode I press t. Here result: ...
  • 3,649
0 votes
1 answer
17 views

How to show recent directories on separate lines in echo area?

Linux Mint 20, Emacs 27.2 Install package dired, dired+ I want to show recent directories visited in the minibuffer. Something like this: I tried this: (defun my-recent-dir () (interactive) ...
  • 3,649
0 votes
1 answer
79 views

How to see all recent directories?

Linux Mint 20 Emacs 27 package: dired, diredp (https://www.emacswiki.org/emacs/dired%2b.el) Jump to bookmark. Input Temp Press ENTER. As result open folder MyFolder Press ENTER. As result open ...
  • 3,649
1 vote
1 answer
55 views

dired-recent - not show correct recent visited directories

Linux Mint 20 Emacs 27 dired, dired-recent Steps: 1. "recentf-mode" is turn on 2. Go to directory "Download". Use "Jump to bookmark" (C-x r b). Input "Download"...
  • 3,649
1 vote
2 answers
1k views

Dired mode: Toggle show hidden files/folders by keyboard shortcut

I am using Emacs 27.1 (GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-03-28, modified by Debian) with "default" dired mode. There are no ...
  • 639

1
2 3 4 5
10