Emacs: Convenient Command to zip File in dired
(defun 2zip () "Zip the current file/dir in `dired'. If multiple files are marked, only zip the first one. Require unix zip commandline tool." (interactive) (require 'dired) (let ( (fileName (elt (dired-get-marked-files) 0)) ) (shell-command (format "zip -r '%s.zip' '%s'" (file-relative-name fileName) (file-relative-name fileName))) ))
See also: Emacs: Convert Image Files in Dired.