dired

Emacs — dired-mode test to determine remote server name / address

末鹿安然 提交于 2019-12-07 12:35:33
问题 Is there a test to obtain the remote server name (e.g., localhost ) or address (e.g., 12.34.56.789 ) in the current-buffer with dired-mode active? I suppose I could use string-match or split-string and then equal , but I thought there might be a handy function like get server name. iphone -- dired-directory /ssh:root@localhost#2222:/var/mobile/Applications/F30B1574-5979-4764-8742-7F9DB2863094/Documents/.0.data: shared server -- dired-directory /ssh:lawlist@12.34.56.789:/home/lawlist/public

Emacs Dired rename with alternative tool

前提是你 提交于 2019-12-07 11:11:02
问题 In dired you can rename files just by editing the directory listing and then saving it. Is it possible to use use an alternative method for renaming when using dired for renaming? I want to use "svn mv", "bzr mv" or "git mv" instead of just renaming, so that I can register the extra metadata in the source control system. 回答1: Looking at the functions in dired-aux.el , it seems like the built-in rename-file is what is ultimately called by dired-rename-file (which is the function bound to 'R'

Get ido in dired buffers

。_饼干妹妹 提交于 2019-12-07 04:46:54
问题 I frequently use dired-mode and I recently started using ido : (ido-mode 1); enable ido-mode (setq ido-enable-flex-matching t); flexibly match names via fuzzy matching (setq ido-everywhere t); use ido-mode everywhere, in buffers and for finding files (setq ido-use-filename-at-point 'guess); for find-file-at-point (setq ido-use-url-at-point t); look for URLs at point (setq ffap-require-prefix t); get find-file-at-point with C-u C-x C-f When I copy a file (with C ) in a dired buffer, I still

Emacs Dired Behavior

血红的双手。 提交于 2019-12-06 08:27:26
问题 I have used emacs for years and am accustomed to having emacs open a selected file in the same window that dired is executed in. In recent revisions, when dired is executed with say 2 windows open, the file selected will be displayed in the alternate window from dired. How can I set up emacs to use the same window to display the file as died (allowing me to look at two files simultaneously--the way emacs used to work)? 回答1: As per the comments above, check C-h k RET when in dired to see what

How do I hide number of links in dired?

匆匆过客 提交于 2019-12-06 06:07:50
99.9% of the time, I don't care how many links are pointing to a file. How do I get dired (or alternatively, ls) to not display the number of links? For reference, the output of ls -l is something like: -rw-rw-rw- 1 root dir 104 Dec 25 19:32 file The number of links, in this case, is 1. ls has a flag to remove the group number (104) but not one to remove the number of links, from what I can tell. I'm afraid editing the format will screw up dired's parsing, as ls has a special flag for producing output to dired. To control how things are displayed in dired, you can customize the variable dired

Get ido in dired buffers

北慕城南 提交于 2019-12-05 09:42:18
I frequently use dired-mode and I recently started using ido : (ido-mode 1); enable ido-mode (setq ido-enable-flex-matching t); flexibly match names via fuzzy matching (setq ido-everywhere t); use ido-mode everywhere, in buffers and for finding files (setq ido-use-filename-at-point 'guess); for find-file-at-point (setq ido-use-url-at-point t); look for URLs at point (setq ffap-require-prefix t); get find-file-at-point with C-u C-x C-f When I copy a file (with C ) in a dired buffer, I still have to use the "standard way" of giving the new location where the file is copied to. That means, I have

How to create new file from dired mode?

荒凉一梦 提交于 2019-12-05 08:20:56
问题 I want to create a new file in dired mode. Is there "create new file" command in dired mode ? For example, When I type "c" in dired mode, it creates "untitled.txt". It's very simple , but I can't find it. 回答1: Just press C-x C-f. This will prompt for a filename, using the current directory of the current buffer as the directory to put it in. For a dired buffer, its current directory is simply the directory you are looking at. 回答2: If you want c in Dired mode to do what C-x C-f does, the

Open dired and select the file associated with the previous buffer?

被刻印的时光 ゝ 提交于 2019-12-05 05:42:39
Let's say I am editing blah.txt with Emacs and I decide to open dired to rename the file blah.txt. When I press C-x d RET (or C-x C-f RET ), a dired buffer will show up to display the content of the directory containing blah.txt , but the cursor will not be on blah.txt . So I need to search my file first ( C-s blah.txt ) to place my cursor on it and then I can rename it ( R ). How do I automate or remove the step C-s blah.txt ? dired-jump is exactly what you want. (autoload 'dired-jump "dired-x" "Jump to dired corresponding current buffer.") (autoload 'dired-jump-other-window "dired-x" "jump

How to [tar and] compress marked files in Emacs

末鹿安然 提交于 2019-12-04 20:33:20
问题 In dired+ in Emacs 23.2.1 on a Debian Squeeze variant I selected four files with * and then pressed Z to compress them. I answered y to the prompt and saw some status updates in the mini-buffer. Where do I find the compressed file? I tested on one file ( C-u Z ) and Emacs ran gzip on the one file and made it a .gz file. How do I [tar and] compress marked files in Emacs? (To preempt any philosophical or methodological discussions about tar, gzip, other formats and archives in general, all I

error in dired sorting on OS X

一笑奈何 提交于 2019-12-04 17:35:29
问题 On OS X 10.5 Emacs 23.2, in dired-mode, if I try to sort by dired-sort-toggle-or-edit with prefix argument --sort=extension or -X , I get: insert-directory: Listing directory failed but `access-file' worked and the dired buffer becomes empty. I tried setting (setq dired-use-ls-dired nil) but this had no effect. dired-sort-toggle-or-edit and sorting by extension seems to work okay on my Ubuntu box. Anyone have a clue what's going on? 回答1: The ls that's installed on OS X doesn't support -X or