Window 7, Emacs 25.1, Dired+ mode.
Path: d:\temp\test\test2\test3\
In folder test3 has 3 files: file1.txt, file2.txt, file3.txt.
When I am in folder test3 and click on two dots I'm up to one level (go to folder test2). OK.
But when I click on one dot (see picture) the cursor go to on file file1.txt.
1.Is this a correct behavior?
2.What mean one dot in dired mode?
I would say this is correct behavior. In directory listings the single dot usually represents the current directory. You can also see it if you open a command window and run dir.
And that the first real file gets selected when clicking the single dot entry might also be a 'default' behavior of the dired module.
Related
I'm trying to create a file in dired mode in emacs. I am in the right directory and when I press C-x C-f as suggested elsewhere on SO and type 'img' (that's the name of the file I want to create), it tries to find existing files from other directories including the pattern 'img'. Then I'm stuck as if I press enter, it'll open the first suggested file containing the pattern 'img' from other directories, TAB will just go over the suggestions.
Please advise.
You are probably using ido-find-file with which you can interactively select a file by typing a substring of that file name.
If you want to temporarily disable this feature (i.e. for your current search only) just press C-f before typing the name of your new file (i.e. immediatly after C-x C-f).
In total command, Ctrl+B will display ALL files in current directory, which will list the files in sub-directorys recursively in the current window.
-- I know in emacs dired, we can hit 'i' which runs 'dired-maybe-insert-subdir' to insert the file list from ONE sub-directory to current dired buffer, so questions is, how to write a function imitate behavior of total command 'insert-all-subdir'?
Another good one from total command is, Ctrl+f10 and Ctrl+f12 will enable us the ability to switch from displaying all and only some files with certain extension (such as 'only show me all the *.mp3 files!')
-- My feeling is that maybe we can tweak dired-omit to imitate this one?
Also in total command, one can set a rule to hightlight files (such as show it in red color) which are modified/accessed in 1 day (the date is set by users), which make them easy to be distinguished from those old, long-time-no-touched files.
-- I'm not sure how to implement this, my guessing is writing a function somehow connecting the access/modified time with 'ls' options?
Dired+ can help.
For insert-all-subdir: Use M-+ M-i (command diredp-insert-subdirs-recursive - menu Multiple > Marked Here and Below > Insert Subdirs).
If no files or subdirs are marked (and likewise, for any Dired buffers showing any descendent directories), then all subdirectories and their descendents are inserted.
To show only the files with a given extension, use * . (menu Mark > Mark Extension) to mark the files with the given extension. Then use diredp-omit-unmarked, to show only the files with that extension. (This is not bound to a key, but is in menu Mark > Omit Unmarked.)
To highlight files modified later than some date, you can modify the value of variable diredp-font-lock-keywords-1. Remember too that you can easily sort by date etc. That is usually what people do, to easily see the most recently modified files.
Imagine you have these files in your project:
a/b/first.png
a/first.png
If I trigger projectile with C-c p f and write first.png, and I write first.png , it will show me both files. Is there a way to select the next file?
Example:
In the image below, the first file in the list is .document. Without writing any other letter, is it possible to switch through the list provided by projectile? Is there a combination that will cycle through those file names, like , press some key combination and then .gitignore is selected?
If I correctly understand, the projectile uses the ido package for file name completions, and other things. The ido (and many other packages) uses the C-s to switch to next file name, and C-r to switch to previous file. See "Using IDO" section in previous link
The keyboard arrow keys will toggle through options as well, and you can then hit enter when the file you want is highlighted next to the text you typed.
I am using Windows 7, EmacsW32 and Emacs23
I am trying to navigate inside a directory whose name has spaces with within Emacs. So, I try to navigate to it in Dired mode by:
C-x d
And then navigate to the directory name with spaces (e.g. My Documents) and the suggestion and auto-complete feature (upon pressing TAB) does not work. How can I navigate to folders and files within such directories without removing spaces?
UPDATE: I tried few other paths with spaces in some directories, and it works. i don't know in which situations it works and fails. It works for Program Files but fails for My Documents.
I am taking a shot in the dark, but unix's case escapes are "\ " and I believe windows does the same.
This may not solve your problem directly.
As you described, I think you may not use ido-mode now. The default tab complete in emacs is weak. Try ido-mode, it is fantastic.
I can't replicate this particular issue, however:
To enter a literal space, type C-qSPC
C-q runs the command quoted-insert which ensures that the next character typed is inserted into the current buffer, which can be useful when the key in question is bound to some function.
The problem is not with folders with spaces in it. The problem is only with My Documents, My Videos and similarly named folders.
When I go in the windows file browser and check the path of the folder My Documents, it appears as C:/..../Documents/...
So, I tried to open Documents instead of My Documents in Emacs and it works. Now I am able to access my files under Documents.
This is in accordance to question Using Emacs to recursively find and replace in text files not already open. I already tried using find-name-dired and also package findr.el. It did open a file where the matching text found, but... how can I go to another file, not this automatically opened file????
Thank you!
This seems like more than one question.
find-name-dired will create a results buffer listing all the files with matching filenames. Use C-h m to see dired-mode's help, and all its key-bindings. RET will open the file at point, o will open the file at point in another window, and C-o will do the same, but leaves you in the Find window (which is convenient if you want to quickly visit several of those files).
findr-search (which is what it sounds like you're using) appears to work more like a tags mechanism. C-h f findr-search RET says that you can navigate to the next match with M-,. This will cycle through the matches in the current file, and then on to the next file as necessary.