Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
30
Help us understand the problem. What is going on with this article?
@tatsuoSakurai

Vagrant 内のコードを、ローカルの SublimeText で編集したい

More than 3 years have passed since last update.

下記設定で、Mac と Vagrant 環境でファイルが共有される

synced_folder を使う(複数指定可)

  config.vm.synced_folder "[host_file_path1]", "[gust_file_path1(vagrant)]", nfs: true
  config.vm.synced_folder "[host_file_path2]", "[gust_file_path2(vagrant)]", nfs: true
  config.vm.synced_folder "[host_file_path3]", "[gust_file_path3(vagrant)]", nfs: true

以前の方法(Sublime SFTPを使ってた)

Vagrant 側の準備

  • vagrant ssh
  • git clone hoge しておく ★A

ローカルの設定

  • Sublime SFTP パッケージをインストール

    • http://wbond.net/sublime_packages/sftp
    • Trial で無料で使えるけど、有料(16$)。購入するとメールに書いてある設定をするとポップアップがでなくなるみたいです。
  • SublimeText でプロジェクトフォルダを右クリック、SFTP/FTP -> Map to Remote すると sftp-config.json が生成される。

sftp-config.json の編集

  • "upload_on_save": true, // 保存時にファイルを送信してくれる
  • 下記項目を vagrant ssh-config などを参照して設定する
    • "host": "127.0.0.1",
    • "user": "vagrant",
    • "port": "2222",
    • "remote_path": "/home/vagrant/hoge/", // ★A で指定したパス
    • "ssh_key_file": "~/.vagrant.d/insecure_private_key",
30
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
30
Help us understand the problem. What is going on with this article?