Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

dired-mode by itself is pretty excellent for navigating directories.


sort by: page size:

Dired is an abomination filling up your buffer list as you traverse directories.

I prefer Emacs dired, where pressing C-x C-q starts editing the opened directory (including any inserted subdirectories).

Emacs' `dired` mode might or might not be able to produce a directory listing by itself. However, the author admits that

> Of course, quite a number of syscalls are missing from emacs (not available as elisp primitives), so as it is, it would be hard enough to do EVERYTHING with emacs, but this is a starting point.


Yeah, and it's the simplest way to go to hidden directories.

What's wrong with dired mode? Ok, you'll get each directory in its own buffer. But, thinking of that, it shouldn't be to hard to make dired mode recurse into subdirectories inside the same buffer. (And fold/unfold like orgmode does. ;-)

Try using "mkdir" to create a couple directories and then navigating around. It's pretty cool, actually.

It's really handy if you need to jump back and forth between two directories with diverse paths.

My favorite dired feature is that if you C-x C-q (the standard Emacs binding to toggle the read-only status of a file), it makes the directory buffer writable. You can then edit the buffer like a regular file, including changing file names (or symbolic link targets, or other things, I presume), and when you're done, C-c C-c and it applies all the changes as renamed files, symbolic link retargeting, etc etc. Very handy, since you can use all the usual Emacs features like query-replace or kmacros while doing it.

Love this, but seems to me that if most directories didn't have files, you could `find` your way through...

I've also found this extremely useful. It lets you mark directories with a keyword and jump directly to them regardless of where you are. http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-f...


There's also "dirs" to view the directory stack!

Nope. That's stack based, this is frequency based. It learns what directories you visit more frequently, and jumps to the right one based on very small bits of input.

I wish it were interactive, like iswitchb ... or I guess I could just start using shell-mode inside Emacs.


console.dir is really useful. It give you variable structure in console.

One of my favourite snippets of bashrc code for navigating directories below. Whether it beats navigating with a file explorer is up to you but I drastically prefer it.

<code>

export MARKPATH=$HOME/.marks

function jump {

  cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: 
$1"

}

function mark {

mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"

}

function unmark {

rm -i "$MARKPATH/$1"

}

function marks {

ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo }

</code>

To bookmark a directory:

$/home/user/Documents> mark

To jump to it

$/tmp> jump Documents

source: https://datascienceworkshops.com/blog/quickly-navigate-your-...

I can't find the orginal HN discussion on this but it has shown up a few times with incremental improvements like tab completions added.


I see. I tend to recommend zsh, anyway, which has navigational features that superannuates pushd, popd, and dirs.

Vim is a good way to browse directories also! Run "vim ." to see. It's nice because you can search folder names to jump to them (in the same way you'd search any other file).

yeah useful, also "open `pwd`" to open the current directory

I used this for a bit, but ultimately found the non-determinism to be a problem for me. I ended up specifically aliasing a few common directories, going from there to sub-dirs was really easy.
next

Legal | privacy