added open file in external application function
This commit is contained in:
parent
a1fa06a230
commit
d719b78e93
|
@ -840,3 +840,14 @@ If ASCII si not provided then UNICODE is used instead."
|
|||
(save-excursion
|
||||
(evil-end-of-line)
|
||||
(eval-last-sexp nil)))
|
||||
|
||||
(defun spacemacs/open-in-external-app ()
|
||||
"Open current file in external application."
|
||||
(interactive)
|
||||
(let ((file-path (buffer-file-name)))
|
||||
(cond
|
||||
((system-is-mswindows) (w32-shell-execute "open" (replace-regexp-in-string "/" "\\" file-path)))
|
||||
((system-is-mac) (shell-command (format "open \"%s\"" file-path)))
|
||||
((system-is-linux) (let ((process-connection-type nil))
|
||||
(start-process "" nil "xdg-open" file-path)))
|
||||
)))
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
"fec" 'find-contrib-file
|
||||
"fed" 'find-dotfile
|
||||
"fev" 'spacemacs/display-and-copy-version
|
||||
"fo" 'spacemacs/open-in-external-app
|
||||
"fS" 'evil-write-all
|
||||
"fs" 'evil-write
|
||||
"fy" 'show-and-copy-buffer-filename)
|
||||
|
|
Loading…
Reference in a new issue