LoginSignup
35
29

More than 5 years have passed since last update.

trampでリモートサーバのファイルをSSH経由で編集

Posted at

Emacsにはtrampって機能があって、SSH経由でリモートサーバのファイルを編集することができるみたい。

「え、普通にsshログインして触ればよくね?」って思ってたんだけどそうじゃない、全然そうじゃない。これの凄さはローカルのEmacsの環境のままリモートのファイルを操作できるって事。すげーまじすげー。

設定

.emacsに以下を記述

(require 'tramp)
(setq tramp-default-method "ssh")

これでファイルを開く際にリモートサーバのファイルを指定すればOK。

C-x C-f /ssh:user@hostname#port:.emacs.d/init.el

Emacsすげー。この機能で .emacs.d/ 配下をGithub管理にしてどうにか頑張ってどこでも良い感じのEmacsが使えるようにしようとしてたのが不要になった。サイコー、これサイコー。

35
29
1

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
35
29