Sunrise Commander

                                                    see also the Tips and Tricks page and Sunrise Commander For Noobs

The Sunrise Commander

Rationale and outstanding features

Hello, Emacs Community!

I’ve been working lately on a new OFM for GNU Emacs. (For those who may not know, OFM stands for “Orthodox File Manager” [1] - it’s the kind of interface made popular by the Norton and Midnight Commanders.)

“Another one?” you may say.

Well, yes. As a long time user of the Midnight Commander on Linux (and, long before that, of Norton Commander and Norton Navigator on DOS), one of the first things I tried after moving to Emacs was running MC in term-mode. It was no joy, so after that I tried using nc.el and mc.el, but both scripts were far away from what I was looking for.

I realized early the power of Dired (learned quite fast several nifty tricks on it), and I think the decision made by the authors of mc.el of basing their file manager on Dired was a wise one. But it lacked support for so many of the usage patterns MC got me accustomed to through all these years… it was a real pity.

So, faithful to the tradition established by mc.el and ec.el, I decided to write the Sunrise Commander.

After several months of growing it up (good programs seem to grow by themselves) I’ve managed to put together most of the functionality I wanted that was not there before:

It is quite portable. I’ve tested it on Linux and Windows 2000 using GNU Emacs versions 22 and 23 (I have also received feedback from a user reporting it works fine on GNU Emacs 22.2 on Mac OS X Leopard), though there’s some homework left one has to do in order to have everything working fine: on Linux you have to install AVFS if you want to navigate inside compressed files (who doesn’t?) and on Windows there is some work configuring ls-lisp and you must also install some diff port if you want to be able to use ediff. Unfortunately I haven’t heard of anything like AVFS for MS Windows, so you’ll have to use archive-mode, tar mode, etc. for your compressed files.

Here’s a screenshot (click to enlarge):

Sunrise Commander basic functions (click to enlarge)

You can get a copy of the Sunrise Commander at:

Enjoy ;-)


The Buttons Extension: making Sunrise a bit more like MC

I have written a small extension that may be of help to new users who want to get acquainted fast with the most frequent functions found in the Sunrise Commander and their keybindings. Once installed, it displays a panel with mouse clickable buttons that show some of the most useful actions performed by Sunrise and their respective bindings in the bottom window every time the main panels are invoked.

Have a look, here is a screenshot (click to enlarge):

Sunrise Commander: Buttons extension (click to enlarge)

You can execute any of the functions by clicking the appropriate button, but the extension was conceived more as a simple cheat sheet (a very, very limited one, as you can easily learn by pressing the last button, labeled “More…”) than as a real interface to Sunrise and Dired functions. Eventually, if you like this kind of interaction with the program you can add your own commands to the list and let this extension manage the creation and layout of the buttons for you.

To get a copy of the Sunrise Commander Buttons Extension (including installation instructions) go here:


The Mirror Extension: full read/write access to compressed archives

Unfortunately the access to compressed archives offered by AVFS is limited to read-only operations, so I have written an extension to the Sunrise Commander that provides seamless and effective manipulation of compressed archives in a virtual file system. It is called the Sunrise Mirror Extension and you can get a copy of it here:

For this extension to work you must have:

  1. FUSE + AVFS support in your Sunrise Commander. If you can navigate (read-only) inside compressed archives you already have this.
  2. One of funionfs or unionfs-fuse. Debian lenny (stable distribution) provides packages for both.
  3. Programs required for compressing – at least zip and tar.
  4. Your AVFS mount point (and the value of variable sr-avfs-root) must be in a directory where you have writing access.

All this means is that most probably this extension will work out-of-the-box on Linux (or MacOS, or other unices), but you’ll have a hard time to make it work on Windows. It was written on GNU Emacs 23 on Linux and tested on GNU Emacs 22 and 23 for Linux.


The Loop Extension: copying and renaming files in the background

Not long ago I read in some discussion board a quite nice comment regarding the Sunrise Commander, something on the lines of “beautiful stuff, but it will never be a real file manager as long as emacs remains single-threaded”. The answer any seasoned emacs user would give in such situation would be something like “you may have as many processes as you need - have you ever heard of openwith?” and, in the case of Sunrise, it is mostly right, but there was one small exception that already had had the chance to bug me a lot since I started using Sunrise as my default FM: copying and renaming files bigger than several hundred megabytes is a painful operation that can freeze your emacs for a looong time and toss you out of your flow without a good reason.

Then somewhere else I read about this emacs user that launches as many instances of emacs as needed, because memory is cheap these days, and who cares. But that didn’t look to me like something I could seriously suggest to an annoyed user.

So I wrote a new extension to the Sunrise Commander that allows to execute asynchronously this kind of tasks. Actually it does launch a separate elisp interpreter (with a limited set of functions loaded) and delegates to it the dirty work, but it also manages automatically the life cycle of this new instance and all the communication between the main and the background ones. In order to perform your copy or rename operation in the background, the only thing you have to do is add an empty prefix to the usual keystroke (e.g. C will perform a regular copy in the foreground and C-u C will do it in the background).

You can get a copy of the Sunrise Loop extension here:


The PopViewer Extension: making the viewer window float

A Sunrise Commander User had the following problem:

    I  practically  don't use the "viewer window", instead I
    use `dired-view-file' which would display  the  file  in
    the pane with convenient commands for browsing the file.
    I found a little awkward the scrolling  in  the  "viewer
    window"  (actually  for  me  there  is  another  problem
    related with my poor-sight: I use large  fonts,  so  for
    sunrise  commander  to  be  useful, I have to use a very
    wide frame. Then the "viewer window" is very  wide  with
    only a few lines(...)
    I want to get rid of the "viewer window"(...)
    Also I want to visit the selected file in a new frame.

So we worked together to redefine a few functions in Sunrise to do precisely this. The resulting code is a new extension called “popviewer”, now available at

if you have the same itch, you can scratch it too 😊


The Mode Line Extension: directory paths always in sight

Here is a new usability enhancement I’ve just released for the Sunrise Commander window manager: sunrise‐x‐modeline ‐‐ a minor mode that puts the directory path of each Sunrise pane on the mode line of its respective window, so it remains always visible. This spares the need to scroll up long sunrise buffers just to check where exactly you are in the file system.

Additionally, three small status icons are shown on the left side of the path. These icons are by default plain ASCII characters, but nicer semi-graphical versions can be used instead by customizing the sr-modeline-use-utf8-marks variable.

Here is the complete list of indicator icons (in ASCII and Unicode) and their respective meanings:

                     (ascii) (unicode)
1. Pane modes:          *        ☼     Normal mode.
                        !        ⚡     Editable Pane mode.
                        @        ☯     Virtual Directory mode.
                        T        ⚘     Tree View mode (with tree extension).
                         
2. Navigation modes:    &        ⚓     Synchronized Navigation.
                        $        ♻     Sticky Search.
                         
3. Transient states:    #        ♥     Contents snapshot available.

To get a copy of the Sunrise Mode Line extension (including installation and usage notes) go to:


The Tabs Extension

This extension brings tab‐based navigation to the Sunrise Commander. It adds to the list of optional mechanisms already available in Sunrise for moving around the file system (like regular bookmarks, checkpoints, history rings, materialized virtual buffers, navigable paths and file‐following) another way to maintain a list of selected locations one wants to return later on, or to compose “breadcrumb trails” for complex repetitive operations.

The main difference between tabs and other mechanisms is that once a buffer has been assigned to a tab, it will not be killed automatically by Sunrise, so it’s possible to keep it around as long as necessary with all its marks and state untouched. Tabs can be persisted across sessions using the DeskTop feature.

To get a copy of the Sunrise Tabs extension go to:


The Tree Extension

This extension adds to Sunrise a tree view of directories that can be used for extremely fast navigation, as well as for several basic operations on files and directories. It uses the excellent “tree-widget.el” library written by David Ponce, does work in the console as well as in graphical environments and offers three different sets of key bindings (mouse centric, arrow keys and alphanumeric keys) to easily adapt to a wide variety of usage patterns.

Navigation inside compressed archives (via AVFS) is supported in tree views (press # to toggle).

Here are two screenshots of exactly the same thing: one in graphical and the other in console mode (click to enlarge):

Sunrise Commander: Tree View (graphical mode) Sunrise Commander: Tree View (text mode)

You can get a copy of this extension from:


The Checkpoint Extension: checkpoints for Emacs 23+

Beginning with version 4 of the Sunrise Commander, checkpoints were redefined to be a special form of bookmarks. Unfortunately, the differences between the bookmarks frameworks in Emacs 22 and Emacs 23 are so big that including this code directly in the sunrise-commander script would make it incompatible with Emacs 22. For this reason both versions of checkpoints are now provided as dynamically loaded extensions, so that you can decide which of them to use. To be sure, this is the version I intend to further develop, as it has a richer set of functions and integrates more nicely to the rest of Emacs. The other one is deprecated and will eventually disappear once Emacs 23+ becomes the “stable” release.

You can get a copy of this extension at:


The Old Checkpoints Extension: checkpoints for Emacs 22

Beginning with version 4 of the Sunrise Commander, checkpoints were redefined to be a special form of bookmarks. Unfortunately, creating bookmarks with custom handlers isn’t supported in the version of bookmarks.el distributed with emacs 22, so if you use Sunrise checkpoints and you don’t want to update your bookmarks.el, just add this extension to your .emacs.el to get back the original functionality.

To get a copy of this extension go to:


The Windows Add-ons Extension

Not long ago, a user of the Sunrise Commander FM on MS Windows asked me if there are any facilities in SC that would give him easy access to the different drives and special folders in this OS. Since there weren’t any I wrote the Windows Add-ons Extension.

This extension implements a listing of all Windows drives and special folders inside the Sunrise Commander, as well as support for symbolic links (shortcuts) for all file system operations inside Sunrise.

One caveat, though: this is only for Emacs ports that run directly on the Windows file system (like e.g. EmacsW32) if yours works on top of some simulation layer that maps the file system (such as Cygwin), you don’t need this code.

You can get a copy of the Sunrise Commander Windows Addons extension (including installation and usage notes) from:


Reduce Intrusion

If you use the mouse occasionally, the defaults might be confusing. Here’s how to disable “click to visit file” and “cursor follows mouse”.

(setq sr-cursor-follows-mouse nil)
(define-key sr-mode-map [mouse-1]        nil)
(define-key sr-mode-map [mouse-movement] nil)

Perhaps Shift TAB gives you an error about ‘backtab’ being undefined? With only two windows, you can have <S-tab> or <backtab> behave like TAB:

(define-key sr-mode-map [backtab]        'sr-change-window)

Comments and Suggestions

For the loop extension, is it possible to delete a directory asynchronously?

Is there some mailing list, project page or other way to report bugs?

There is a repository on github – if you have a github account you can report any bugs you find there. You can also write to the gnu.emacs.help newsgroup or directly to me: mailto:escherdragon@gmail.com

It would be great if sunrise commander was in ELPA.

Yes! now SC is available through ELPA (you will need a recent version of Emacs with support for multiple ELPA repositories).

Just add http://joseito.republika.pl/sunrise-commander/ to your list of ELPA repositories:

    (setq package-archives '(("ELPA" . "http://tromey.com/elpa/") 
                             ("gnu" . "http://elpa.gnu.org/packages/")
                             ("SC"  . "http://joseito.republika.pl/sunrise-commander/")))

j.a.


I don’t know how much time you spent on this, but SR is just amazing. Thanks a million.

With your permission, here are a couple of things which trouble my sleep:

1) How to make dired command to call SR instead, such that it would be available to other programs (ido for instance)? (The problem is that dired’s second optional argument SWITCHES does not appear in sunrise’s arguments list and also on my system is remapped by ido-dired which makes things even more complicated. I am a lay elisper, sorry.)

2) Is there a way to hide specific columns in SR buffer? Especially owner,user columns. They bring no useful information, and take a lot of space, keeping the names of the files outside of the visible area.

Next are two things from my wish list (not vital in any way).

3) I love fuzzy matching. It’s strikingly similar to “anything” way of doing things. In “anything” buffer one can type the regexp and at the same time navigate with C-n C-p. To change regexp one needs to just start typing again. To dismiss the minibufer one presses C-g. In SR it’s slightly different, after C-c / I cannot change the string completely because by deleting the last character with Backspace will revert the buffer and once again C-c / is necessary to reenter the fuzzy mode. C-p C-n will introduce ^P ^C characters. C-g will accept the changes, which is slightly unusual😊. Would be nice to have a mini keymap for fuzzy filtering.

4a) Would it be possible to use find-grep C-c C-g and find-name C-c C-n on files and directories narrowed by previously called C-c /, C-c C-g, C-c C-n, C-c C-l ? Actually it would be even better (more consistent) to be able to perform those operations on marked files & directories. 4b) How about igrep-find instead of just grep in C-c C-f? igrep-find offers the option to limit FILES searched by specifying the pattern. Grep would search for occurences even in binary files which slows down considerably the whole process and gives long lists.

Thanks again for your work. Great job.

RedBlue

Hi RedBlue,

How much time have I spent on this? A bit, I guess – time passes way too fast when you’re in the flow ;)

1) I have slightly modified the sr-dired function in version 4R315 – you may want to try that instead (have a look at this tip).

2) Yes, try customizing variables sr-listing-switches and sr-virtual-listing-switches and read this tip.

3) That function is actually called “fuzzy narrowing”. How do you exactly imagine navigating through a listing while narrowing its contents?

4) I didn’t know igrep before - will have to have a good look at it 😊 Thanks for the tip.

Update 2010-11-05: find can be now performed in marked directories too, the implementation uses the traditional find-dired, so no need to include any other external libraries.

j.a.

Not RedBlue here, but here is my take on (3): - after C-c /, keep the currently selected file highlighted in the Sunrise active panel buffer - As user enters the pattern, if the currently selected file does not match the current pattern, select the first matching file. Perhaps center the Sunrise buffer on it. - On C-p/C-n, select and move highlighting to the next matching file - On RET, visit the currently highlighted file - On C-g, close the minibuffer, display all files (matching or nonmatching), keep the selection on the currently selected (matching) file.

As another alternative, an option would be to do the same as above, except instead of showing only matching files (as is now the case) highlight them in a different color. C-p and C-n would still move back or forward through the matching files. In this case I guess one could keep the last match highlighted, and display the match string if C-c / is pressed again in the same buffer (reset if changed directory of course).

And BTW, I just started looking at SC today, and it already looks like the file manager to use in linux…

As an altap salamander user on windows, I also found rather convenient to define were C-f3/f4/f5/f6 for name/ext/time/size sorting, luckily it was easy to do. Another thing that would be nice is to have INS toggle select/deselect, rather than just select…

--laxxy

PS. Having worked a bit more with it, I am feeling it would have been really nice to have two modes of operation: (1) “navigation mode” where hitting a letter button would start filename pattern search (as in the previous alternative), and move the current selection to the first matching file or directory if it is not matching. Highlighting matches would be nice here I guess. Commands that start with alphanumeric keys would have to be either prefixed or just ignored in this mode of course, and (2) “command mode” which could be the current default. A user could then bind some easy key like “/” to switch between the two.

The main reason is that one nice feature of this type of file managers is easy navigation through the directories/files by jumping to the first match. For example, if I have directories ~/xxx/yyy/zzz1, and ~/xxx/yyy/zzz2, and want to switch from ~ to ~/xxx/yyy/zzz2, in a typical two panel file manager (like the classic dos/windows file managers, mc, or krusader) I would do smth like “x RET y RET z C-n RET”. This is very much like completion, except the command is effectively executed in the panel as you type, which makes it more user-friendly. Having to press “C-c / x RET C-c / y RET C-c / z C-g C-n RET” is a bit too much, even if one re-binds “C-c /” to “/”… Perhaps there is a better way, but I have not found it yet 😟

If this sounds like too much work, having the active window automatically following the path typed in the minibuffer on “j” (the way the displayed file list changes on “C-c /”) would be somewhat similar…

One thing about it is that since this is smth pretty common functionality in other file managers, I suspect many people might be doing this reflexively, and then scratching their heads trying to remember what were the commands they executed (I know I do)… e.g. in mc this functionality is case-sensitive (bad idea, but that is how it is), so if some former MC user has a directory named say ~/Data, and wants to switch to it in SC in this manner, some rather unexpected things might happen 😊

Hello laxxy,

Thanks for your valuable comments ‐‐ your suggestions will definitely influence some version of Sunrise in the near future, so stay tuned.

I still don’t think that extending the current fuzzy narrow function (C‐c /) is what you really want here, since it makes no sense navigating across a buffer which contents are being refined to contain only those entries matching your pattern ‐‐ all entries in the buffer do match, so moving to the next matching entry means simply moving one entry downwards.

What I think you really want (but please correct me if I’m wrong) is rather “fuzzy search” ‐‐ something like the standard emacs search (C‐s, or C‐r for backwards, etc.) that would work for the same kind of patterns as fuzzy narrow, plus some way to keep that search mode active after pressing return for moving into the currently selected directory (if any). I’m assuming you already know about C‐s and friends in emacs and that that kind of search in Sunrise is not good enough for you.

Actually I have written something a bit similar in the Tree Extension. Why don’t you give it a try (after customizing the sr‐tree‐isearch‐always‐sticky variable to make searches always “sticky”) and let me know how that works for you? j.a.

Hi,

Good point about C-s, I feel stupid now. I certainly know about it 😊 I guess my brain goes into a “commander mode” rather than in “emacs mode” when I look at SC… It’s definitely more appropriate than C-c /. Now, if it were possible to keep the search mode on through navigation as you noted, that would be just about perfect I guess. I’m looking at the tree extension, it looks nice, but really not quite exactly what I had in mind, honestly I am not such a big fan of tree style navigation…

One other thing: would be nice to have a way to open a file in an external application – e.g. if there is a pdf file, I might want to open it in an external viewer. mc and many other commanders have a file extensions association list which is probably the way to go, but for now the following works for me. Perhaps there is already such a function, but I didnt find it and basically copied C-t x:

    (defun lx-sunrise-display-external ()
      "Open file at point in an external application."
      (interactive)
      (let ((file (dired-get-filename)))
        (call-process shell-file-name nil nil nil shell-command-switch
                  (format "%s \"%s\"" lx-sunrise-external-viewer file))))
    (setq lx-sunrise-external-viewer "xdg-open")
    (define-key sr-mode-map '[\C-return] 'lx-sunrise-display-external)

--laxxy

PS. Currently, when Sunrise exits on “q”, it restores the window positions to where they were prior to Sunrise popping up; but if I visit a file (RET), it opens full screen. It would be much more convenient if it opened in the window that was current at the time of invoking Sunrise, keeping other window positions as they were. in that case Sunrise could be used as a much improved file open dialog window.

…Looks like it was actually pretty easy to do by redefining sr-find-regular-file (below). Not sure if I have introduced any undesirable side effects…

    (defun sr-find-regular-file (filename &optional wildcards)
      "Deactivate Sunrise and visit FILENAME as a regular file with WILDCARDS (see
      find-file for more details on wildcard expansion)."
      (condition-case description
          (progn
            (sr-save-panes-width)
            (set-window-configuration sr-prior-window-configuration)
            (find-file filename wildcards)
            (setq sr-prior-window-configuration (current-window-configuration))
            (sr-quit))
        (error (message "%s" (second description)))))

Hi again, laxxy,

Actually it was not the “tree-style” navigation (whatever can be so called) in the Tree extension what I wanted to draw your attention to when I suggested to have a look at the extension. It was rather a capability implemented in it called “sticky search”. You see, if you install the extension and customize a variable called sr-tree-isearch-always-sticky to be t (instead of nil, which is the default), then whenever you hit C-s you remain in interactive search mode even after you’ve pressed Return. Then you can do “x RET y RET z RET” to arrive to directory ax1/b2y/3cz – you have to press C-g to return to command (tree) mode, or Return one more time, to get the regular (browse) mode back. I think I’ll try doing something like that directly in browse mode (update 2010-10-02: this is already done).

To open files in external applications look here for the recommended way of doing it.

Regarding the modification in function sr-find-regular-file you propose, I don’t think anything can go wrong by restoring the previous window configuration. Is there anyone against it out there? If there isn’t I’ll make this the default behavior in the next release. j.a.

Hi, thanks a lot for your help and all the good work. I’ll take another look at the tree extension.

BTW part of the behavior of C-c / feels a bit unnatural: say I have a number of files with an extension .sas and a bunch of files with extension .sas7bdat. Then on C-c / I can only enter a pattern up to .sa – after that it complains that there is nothing left to narrow, and it seems impossible to refine the filter further…

That’s because all the entries that matched .sa do also match .sas – try with further characters, e.g. .sa7, .sab, .sat – j.a.

Ok, this is absolutely delightful. For more than 15 years I’ve been pulling up dired windows side by side in order to fake it. This. Just. Works. My workmates are jealous. Really good work, thanks a bunch. After a few more days of familiarity I’ll start adding in extensions 😊 Thanks very much. --MichaelWilson

That's because all the entries that matched .sa do also match .sas – I understand 😊 I just think that if it is not essential for some reason for the matching string to be as short as possible, it might be a good idea to allow the user to enter it, even though it would not actually change the display…

Also I was stuck with this for a while: so this happened and I had the view narrowed, but it was not clear how to cancel this to see all files again (C-c / would just show an empty line) – apparently C-o C-o worked, but I would not say this was the most intuitive thing…

If it is not essential for the matching string to be as short as possible – it’s not strictly essential, but helps a lot to keep the implementation simple and robust. Never mind the message, just keep typing until you see in the pane what you’re looking for, then press Return. Besides, the current behavior has the advantage that for frequent narrowing operations you end remembering the shortest combination of keys that leads to the desired result (e.g. to narrow my ~/emacs directory to sunrise-commander.el and all its extensions, I usually type C-/ su- [RET]).

To cancel the fuzzy narrow mode and see all files again simply press g (revert-buffer), possibly preceded by Return (or C-n, or C-p) to terminate the pattern input. It may not be intuitive for you right now, but after you’ve used Emacs a bit this will make perfect sense. One of the best things about Emacs the platform is that all – or at least most of – its applications have similar keybindings for similar operations (though at times the similarity may be hard to discern). j.a.

Perhaps, after all I just started working with SC. BTW, how do I match *.sas but not *.sas7bdat?

thanks for the advice about “g”! honestly it does not sound that intuitive to me either 😊 maybe a line somewhere in documentation about C-c / would help. Personally I am not so sure about the consistency of emacs’ interface – I have actually been working in emacs pretty much daily for over 10 years now, and still there are some modes like the vanilla dired or gnus that I have pretty much given up on after multiple attempts 😊

how do I match *.sas but not *.sas7bdat? – hmm, that’s a tricky one. Try this (but do not start with C-/):

    %m sas$ [RET] tk

or this:

    *. sas [RET] tk

this is not Sunrise, but plain Dired saying hello 😊

maybe a line somewhere in documentation... – Darn right, thanks for spotting this omission. I’ve added appropriate comments in the latest revision.

j.a.

Hi J.A.

Thanks for all the tips above. Worked great! Also the sticky search is a marvelous idea! Can not wait to have it in browser mode.

Now I see more clearly what I meant by navigation during fuzzy narrowing. I just wanted to avoid hitting RET after the narrowing such that C-n or C-p would accept the changes and start the movement of the cursor in the buffer. I’ve changed the code slightly in sr-fuzzy-narrow:

      ...
      (cond ((memq next-char '(?\n  ?\r 14 16))
      ...

Worked for me 😊

I am not so sure about the consistency of C-g after C-c/ which accepts the narrowing. C-g cancels the action almost everywhere else in emacs. Would it be possible to customize C-g to revert the buffer? I could not figure it out. Thanks. – RedBlue

Hi again RedBlue,

Thanks a lot for your suggestions. I’ve implemented both of them in the latest revision. – j.a.

Thanks for the update – very nice!! One small thing: the behavior after the new C-c / is a bit unusual in the sense that the highlighted (“green”) file is separated from the regular cursor, and hence C-n/C-p don’t move the “green” cursor (not sure what the right term is) in the manner one might expect. Also, would be nice to have a variable controlling whether to automatically turn off fuzzy-narrow on directory change.

Also if you do get around to implementing the “sticky search” at some point, it would be nice to have an option to make it work starting from the beginning of line (ie. if I change to a directory with three files:a.sas, b.sas, and s.sas, and press “s” I want to selection to jump to the third file, which is what other file managers do).

It might also be a good idea to put some kind of a visible indicator to show that the directory view is narrowed, maybe change the color of the “total used…” line or directory path, or something, perhaps show the filter pattern too? for example, one might cd to a directory in which nothing matches, then it looks normal, and when you switch back you might forget that there was a fuzzy-narrow filter set…

PS. I think I just made my life easier by (define-key sr-mode-map “\C-s” ‘dired-isearch-filenames) ! Now, I think what would be necessary for complete happiness is to have it turn on when Sunrise starts, when current directory changes, and when active panel changes (is there any good place for me to try putting a “(dired-isearch-filenames)” at?). We’d be pretty close to having the “dual mode” setup this way, perhaps in some ways even more intuitive than a typical standalone two-panel manager, the navigation mode being entered on C-s and exited on C-g, with C-s/C-r for forward/backward navigation among matches which is I think actually better than what I was originally describing a few posts back.

--laxxy

I have just implemented sticky search in the latest revision Check it out, I’ve bound it to C-c s.

@laxxy: to make it work from the beginning of line, just prefix the search with a space ;-)

The green line is realized by hl-line-mode and is actually more an ornament than anything else, but I’ll have a look at that if I have a chance, just to see if anything can be done.

What do you mean by “turning off fuzzy-narrow on directory change”?

Yes, some visible indicator to show that the directory view is narrowed is indeed a good idea, but I think I’ll rather implement that in the mode line. Usually I try not to mess directly with the contents of the panes in order to minimize the chance of breaking anything in regular dired. (Update 2010-10-15: This is already done, see ModelineExt – when a buffer is narrowed, its “Contents snapshot available” flag is set to active).

Personally, I prefer dired-isearch-forward over dired-isearch-filenames, because sometimes I also search for the name of a month, or some other piece of data displayed in the pane, and not only for names of files.

is there any good place for me to try putting a (dired-isearch-filenames) at? – Maybe you could experiment with sr-start-hook (and/or sr-refresh-hook, but it may be overkill. YMMV)

j.a.

Hi. I am new to Sunrise Commander. Looks very powerful! My problem: my screen is not so wide and my file names may be long. Therefore: is there a way to list file name, time, and file size, but NOT the mode bits and number of hard links? I am aware of variable sr-listing-switches, but I can’t find the necessary parameters of the ls command. Long listing (-l) shows more information than I want, without -l I can’t get size and time. Also, but not as essential, it would be cool to have columns file name, size, and date listed in that order (like I have in midnight commander). – Sven

Update 28-03-2012: Since version 5r414, the procedure for hiding selected attributes columns has been dramatically simplified. Check out the How do I hide (or modify) selected columns in the list of attributes? section in the Tips &amp; Tricks page for more details.

Another possibility is simply to use the vertical layout by default: press C-c C-s once and see if you like it. If you do you can do:

    M-x customize-variable sr-window-split-style [RET]

choose the vertical layout and press the “Save for future sessions” button.

j.a.

j.a., thank you very much for your fast answer and great help! I would prefer a different column order though. I am everything but a lisp expert, but if I understand your code, this could be achieved inside the while loop. I might try later when I find more time to really dive into sunrise commander. Again, thank you very much! Great work! – Sven

Hello again, Sven. Thanks a lot for noticing the error (the eval-after-load was an afterthought, but fortunately you got the idea anyway). I’m not sure whether “changing” the order or the columns (again, we cannot change them underneath, but I believe overwriting them should be possible) wouldn’t end being too complex to be worth the effort. I’ll give the idea a spin tonight when I’m back home and let you know what comes out of it. Of course, if you succeed in doing it by yourself I’ll be more than happy to know ;)

j.a.

For interactively hiding/showing the attributes, I had some success with dired-details.el and Sunrise Commander. I had to modify

 (defun dired-details-hide()
   "Make an invisible, evaporable overlay for each file-line's details in this dired buffer."
   (interactive)
   (unless (memq major-mode '(dired-mode vc-dired-mode))
     (error "dired-details-hide can only be called in dired mode"))

to add sr-mode to the list of permitted modes, to stop it complaining

 (defun dired-details-hide()
   "Make an invisible, evaporable overlay for each file-line's details in this dired buffer."
   (interactive)
   (unless (memq major-mode '(dired-mode vc-dired-mode sr-mode))
     (error "dired-details-hide can only be called in dired mode"))

It doesn’t seem to have interacted badly with anything, though I’ve only just started using it.

Tom

Hello Tom. Sunrise allows out of the box to hide the details: all you have to do is press C-Backspace (or C-c Backspace, if you are running inside a text-only console.) Sven’s question was a bit different, though – what he was asking for was a way to reorder the columns that compose those details. I haven’t had much time to think about it (sorry, Sven), but I’m afraid that task wouldn’t be an easy one, as it would require a layer of indirection between SC and Dired, and the gain doesn’t look to me like being worth such a big effort.

j.a.

Hi Jose,

I am the lucky SC user from the very SCrise, but only recently started to adjust it to the ultimate “the only one” file navigator.

Must admit the only real hinder all this time was the inability to open with external applications. The solution with openwith does not work for me. Sometimes I open .pdf files externally and other times in emacs. The same for html files and images. The best thing for me would be to have a dedicated key (say “b”) for browsing files in external app. Here is a short rewrite of sr-browse-file with org-open-file:

(defun sr-browse-file (&optional file)
  "Display the selected file with `org-open-file'."
  (interactive)
  (unless (featurep 'org)
    (error "ERROR: Feature org not available!"))
  (setq file (or file (dired-get-filename)))
  (save-selected-window
    (sr-select-viewer-window)
    (let ((buff (current-buffer)))
      (org-open-file file '(16)) ;; try hard not to open in emacs
      (unless (eq buff (current-buffer))
        (sr-scrollable-viewer (current-buffer))))))

Org is part of emacs and handles all sorts of situations properly, particularly it opens urls in the default web browser. See also org-open-at-point and org-file-apps for more orgish details.

My second problem is that many times one of sunrise panes is covered, and I cannot get to the other-window (’C-x o’), Any ideas how to solve this?

Also is there a way to restore sunrise window layout if one of the panes has been covered?

[EDIT: I switched to two-panes style as suggested by Tom Short in the tips page. For laptops it’s great, and it’s more efficient in terms of navigation. Would be great to have an build in style for two-pane navigation. As an outsider, it seems to me that the 120 lines in popviewer and two-pane style could be integrated into sunrise, leaving only ‘sr-viewer-style’ for the user to customize the preferred style of navigation.

My problem still persists - “\” doesn’t restore the panes. It’s bound to sr-lock-panes. ]

Many thanks, RedBlue.

This has been addressed in the latest version of the PopViewer extension. See my latest update in the Alternative Usage Patterns section of the Tips &amp; Tricks page for more details.

j.a.

Hi,

It’s me again. In TotalCommander there is a way to compute the sizes of the directories and display then alongside each directory (alt-shift-enter as far as i can remember). In SC one can compute the total size of the marked dirs, but apparently there is no way to display this info along side each directory. On a related note, there would be nice to have sorting of directories according to their size, not only files.

Any ideas?

Thanks,

RedBlue

This is kind of hard, I’m afraid, as it would require fiddling with the way Dired displays its directory data. Give me some time to think about it, I’ll check what can be done.

j.a.

Hi, thanks a million for SC! I have a question though. When rescanning a virtual buffer, the details of the files don’t get refreshed (e.g. size, modification time etc.) Is this by design, or am I missing something?

Thanks. hajovonta

Hi hajovonta,

This is by design, because the only way to refresh the buffer would be to re-insert all the entries in it, but a virtual buffer may contain entries that don’t exist anymore (e.g. you could have saved the buffer as a file months or years ago) but you may want to keep the entries anyway - refreshing the buffer would sweep them away.

j.a.


CategoryDirectories CategoryEmulation