2009-07-10 15 views

Respuesta

19

Si agrega esto a su .emacs, podrá abrir los archivos mediante la combinación de teclas 'F'.

(eval-after-load "dired" 
    '(progn 
    (define-key dired-mode-map "F" 'my-dired-find-file) 
    (defun my-dired-find-file (&optional arg) 
     "Open each of the marked files, or the file under the point, or when prefix arg, the next N files " 
     (interactive "P") 
     (let* ((fn-list (dired-get-marked-files nil arg))) 
     (mapc 'find-file fn-list))))) 

Obviamente, puede anular la función 'f' si lo desea.

+2

¡Gracias por esto! Pequeño punto estilístico pero no necesitas usar 'let *' en este caso ('let' es suficiente). Y realmente podríamos simplificar esa última forma para '(mapc 'find-file (dired-get-marked-files nil arg))'. – camdez

6

Puede probar dired+ que ofrece muchas extensiones para dired, incluida la posibilidad de seleccionar varios archivos y buscarlos/verlos todos.

28

En Emacs 23.2 y superior, el módulo dired-x.el está disponible y le da acceso a un comando que hace exactamente lo que usted desea. Después de cargarlo (solo (load "dired-x"), normalmente), podrá invocar la función dired-do-find-marked-files. Aquí está su base de documentación:

(dired-do-find-marked-files &optional NOSELECT) 

Find all marked files displaying all of them simultaneously. 
With optional NOSELECT just find files but do not select them. 

The current window is split across all files marked, as evenly as possible. 
Remaining lines go to bottom-most window. The number of files that can be 
displayed this way is restricted by the height of the current window and 
`window-min-height'. 

To keep dired buffer displayed, type C-x 2 first. 
To display just marked files, type C-x 1 first. 

Así que después de dired-x se carga, sólo puede utilizar Mxdired-do-find-marked-filesRET y obtendrá exactamente lo que su pregunta se refiere a: todos los archivos marcados serán visitados como aunque corriste dired-find-file en todos ellos.

+0

Mi modo directo no reconoce este comando, y estoy en 23.4 – Malabarba

+1

@Bruce Connor: probablemente usted no tiene instalado dired-x. Intenta agregar '(add-hook 'dired-load-hook (function (lambda() (load" dired-x "))))' en '.emacs'. – Adobe

+2

La tecla 'F' es un atajo de teclado para dired-do-find-marked-files, al menos en Emacs 24.4. – thdox

Cuestiones relacionadas