8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Emacsのhelmで簡単にroot権限でファイルを開く

Posted at

Emacsで書き込み権限のないファイルに書き込みしたい場合、

sudo emacs

すれば良いわけですが、Emacsって起動遅いし今起動してるEmacsで書き込みたいわけです。
で、ぐぐると

こんな感じの記事が出てくるんですが、わざわざ拡張入れるほどのことでもないし、/sudo::/とか忘れるし、パスを一から入力しないといけないの面倒だったりするわけです。

けど大丈夫。そう、helmならね。

やり方要約

  1. helmのファイル選択画面で編集したいファイルをフォーカスしてタブを押す
  2. find file as rootを選択

以上

やり方詳細

helm-miniとか開いたらこんな画面になるじゃないですか

スクリーンショット 2014-01-25 2.12.31.png

ここで編集したいファイル選んでタブ押すとこうなります。

スクリーンショット 2014-01-25 2.13.01.png

で、この中にfind file as rootってのがあります。rootとか入力して絞り込むと良いです。

スクリーンショット 2014-01-25 2.13.12.png

で、Enterするとパスワード入力を求められます。

スクリーンショット 2014-01-25 2.13.26.png

で、入力したら成功。

スクリーンショット 2014-01-25 2.13.40.png

編集・保存出来るようになります。

anythingでも出来るかどうかは知りません。

8
9
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
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?