New doom/*-this-file commands; move doom/sudo* to new files library

This commit is contained in:
Henrik Lissner 2018-02-14 02:26:16 -05:00
parent f6039eaee3
commit 5e5d075431
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 124 additions and 93 deletions

View file

@ -1,20 +1,5 @@
;;; core/autoload/editor.el -*- lexical-binding: t; -*-
;;;###autoload
(defun doom/sudo-find-file (file)
"Open FILE as root."
(interactive
(list (read-file-name "Open as root: ")))
(find-file (if (file-writable-p file)
file
(concat "/sudo:root@localhost:" file))))
;;;###autoload
(defun doom/sudo-this-file ()
"Open the current file as root."
(interactive)
(doom/sudo-find-file (file-truename buffer-file-name)))
;;;###autoload
(defun doom/backward-to-bol-or-indent ()
"Jump between the indentation column (first non-whitespace character) and the