Add Linux config (mainly for Arch)
This commit is contained in:
parent
0d1fb1132c
commit
65da0e0a9e
2 changed files with 47 additions and 15 deletions
|
@ -1,14 +1,45 @@
|
|||
;;; core-os-linux.el --- Debian-specific settings
|
||||
|
||||
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
|
||||
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
||||
|
||||
(defun doom-open-with (&optional app-name path)
|
||||
(defun doom-open-with (command &rest args)
|
||||
"Open PATH in APP-NAME, using xdg-open."
|
||||
(interactive)
|
||||
(error "Not yet implemented"))
|
||||
(unless args
|
||||
(setq args (f-full (s-replace "'" "\\'"
|
||||
(or path (if (eq major-mode 'dired-mode)
|
||||
(dired-get-file-for-visit)
|
||||
(buffer-file-name)))))))
|
||||
(let ((command (apply 'format command
|
||||
(mapcar (lambda (a) (shell-quote-argument a))
|
||||
args))))
|
||||
(message "Running: %s" command)
|
||||
(shell-command command)))
|
||||
|
||||
(defun def-docset! (&rest _)
|
||||
(message "No docset function defined!"))
|
||||
|
||||
;;
|
||||
;; OS-specific functions
|
||||
;;
|
||||
|
||||
(defun os-open-in-browser ()
|
||||
"Open the current file in the browser."
|
||||
(interactive)
|
||||
(browse-url buffer-file-name))
|
||||
|
||||
(defun os-open-in-default-program ()
|
||||
"Open the current file (or selected file in dired) with xdg-open."
|
||||
(interactive)
|
||||
(doom-open-with "xdg-open '%s'"))
|
||||
|
||||
|
||||
;;
|
||||
;; Plugins
|
||||
;;
|
||||
|
||||
(use-package openwith
|
||||
:config
|
||||
(openwith-mode t)
|
||||
(setq openwith-associations
|
||||
'(("\\.\\(pdf\\|jpe?g\\|gif\\|docx?\\|pptx?\\|xlsx?\\|zip\\|tar\\(\\.gz\\)?\\|rar\\)$"
|
||||
"xdg-open" (file)))))
|
||||
|
||||
(provide 'core-os-linux)
|
||||
;;; core-os-linux.el ends here
|
||||
|
|
|
@ -4,20 +4,21 @@
|
|||
(defconst IS-LINUX (eq system-type 'gnu/linux))
|
||||
(defconst IS-WINDOWS (eq system-type 'windows-nt))
|
||||
|
||||
(setq
|
||||
;; Use a shared clipboard
|
||||
(setq x-select-enable-clipboard t
|
||||
select-enable-clipboard t)
|
||||
x-select-enable-clipboard t
|
||||
select-enable-clipboard t
|
||||
;; Treat clipboard input as UTF-8 string first; compound text next, etc.
|
||||
x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
||||
|
||||
;; Stubs, these should be defined in all OS modules
|
||||
(noop! doom-open-with (&optional app-name path))
|
||||
(noop! os-switch-to-term)
|
||||
(noop! os-switch-to-term-and-cd)
|
||||
(noop! os-open-in-browser)
|
||||
(noop! os-open-in-default-program)
|
||||
(noop! os-reveal)
|
||||
(noop! os-reveal-project)
|
||||
(noop! os-open-in-browser)
|
||||
(noop! os-upload)
|
||||
(noop! os-upload-folder)
|
||||
(noop! os-switch-to-term)
|
||||
(noop! os-switch-to-term-and-cd)
|
||||
|
||||
(cond (IS-MAC (require 'core-os-osx))
|
||||
(IS-LINUX (require 'core-os-linux))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue