您可以使用shell命令功能.例如:
原文链接:https://www.f2er.com/bash/385066.html(defun ls () "Lists the contents of the current directory." (interactive) (shell-command "ls")) (global-set-key (kbd "C-x :") 'ls); Or whatever key you want...
要在单个缓冲区中定义命令,可以使用local-set-key.在dired中,您可以使用dired-file-name-at-point获取文件的名称.所以,要完全按照你的要求做:
(defun cygstart-in-dired () "Uses the cygstart command to open the file at point." (interactive) (shell-command (concat "cygstart " (dired-file-name-at-point)))) (add-hook 'dired-mode-hook '(lambda () (local-set-key (kbd "O") 'cygstart-in-dired)))