In Emacs is a mode called Dired that acts as a file manager . However, in some cases you may want to open the file manager 's desktop environment in use (or an external file manager) directly to the folder where the file currently being edited (or rather, the corresponding buffer). To do what you can add the following code in your initialization file (unless this function is not already present in Emacs and I am not able to find it):
(defun open-buffer -path ()This code defines the function
"Run Nautilus on the directory of the current buffer."
(interactive)
(shell-command (concat "nautilus" default-directory)))
open-path buffer that will open the file manager Nautilus (the GNOME default) in the default folder (which normally corresponds to the folder where the file is in use, or to your home if the buffer is not an open file). If you want to use a file manager other than just replace the command as an argument to concat (and perhaps even the Nautilus line that appears in the description of the function). If you wish you can assign a keyboard shortcut to this feature by adding to your initialization file:
(global-set-key (kbd "\u0026lt;M-f3>" ) 'open-path-buffer )This code will be associated with the combination
M-f3 function open-path buffer, if you want to use a different combination just replace the occurrence of M-f3 nel codice precedente. Questo post prende spunto da http://zhangda.wordpress.com/2010/02/03/open-the-path-of-the-current-buffer-within-emacs/ in cui รจ definita una funzione per aprire il file manager Explorer in Windows. A questo proposito trovate un codice alternativo qui: http://www.factsandpeople.com/facts-mainmenu-5/2-editor-emacs/80-switching-between-windows-explorer-and-emacs .
0 comments:
Post a Comment