您可以使用shell命令功能.例如:
(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)))
原文地址:https://www.jb51.cc/bash/385066.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。