LoginSignup
2
2

More than 5 years have passed since last update.

eshellで使えるようにsudoeditを実装してみた

Posted at

このごろeshellを使ってるんですが、root権限でファイルを開く時にめんどくさいんですよね。
zshを使ってた時はsudoeditを使ってたんですが、eshellから開くならtramp使って開きたい気分だったので、適当に関数書きました。

(defun eshell/sudoedit (file)
  (if (string-equal "/" (substring file 0 1))
      (find-file (concat "/sudo:root@localhost:" file))
    (find-file (concat "/sudo:root@localhost:" default-directory file))))

不具合あるかもしれませんので自己責任でご利用ください。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2