ホストOS(MacOS)に設定してある.vimrc
ファイルを仮想環境下のCentOS7に反映させたいのですが、やり方がわかりません。
一応centos7側にはデフォルトでviはインストールされているので、PATHなどをいじれば設定できると思うのですが、やり方がいまいちわかりません。
ホストとゲスト側でどこからしらの共通項を見つけだしてシンボリックリンクを設定するのでしょうか?
下記は$PATHの参考です。
初歩的な部分で恐縮ですが、いつも仮想環境下エディタ問題で詰まるので教えていただけると助かります。
よろしくお願いします。
bash
1#--ゲスト側 2[vagrant@localhost ~]$ echo $PATH 3/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin 4 5#--ホスト側 6~:master$echo $PATH 7/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/vscode
10月5日追記
今回の目的としてwordpressの学習で、仮想環境を少しかじったのでどうせならばcentos7でやってみようと思い、そこでより効率的にエディタ等の設定をというのが今回の目的です。
下記にvagrnatfileを記載しました。
マウント位置は/var/www/wordpress
にしました。
.vimrc
の設定を共通ディレクトリを見いだし、そこへexportするかリンクで反映させる二つのやり方があるという解釈で大丈夫でしょうか?
合ってるとしましたら、今回の場合のように、wordpressディレクトリでマウントしたい、でもviもホストのものを使いたいといった場合はどうすればいいでしょうか?
検討違いでしたらすみません。
bash
1#--Vagrantfile 2 3 1 # -*- mode: ruby -*-↲ 4 2 # vi: set ft=ruby :↲ 5 3 ↲ 6 4 # All Vagrant configuration is done below. The "2" in Vagrant.configure↲ 7 5 # configures the configuration version (we support older styles for↲ 8 6 # backwards compatibility). Please don't change it unless you know what↲ 9 7 # you're doing.↲ 10 8 Vagrant.configure("2") do |config|↲ 11 9 # The most common configuration options are documented and commented below.↲ 12 10 # For a complete reference, please see the online documentation at↲ 13 11 # https://docs.vagrantup.com.↲ 14 12 ↲ 15 13 # Every Vagrant development environment requires a box. You can search for↲ 16 14 # boxes at https://vagrantcloud.com/search.↲ 17 15 config.vm.box = "bento/centos-7.3"↲ 18 16 ↲ 19 17 # Disable automatic box update checking. If you disable this, then↲ 20 18 # boxes will only be checked for updates when the user runs↲ 21 19 # `vagrant box outdated`. This is not recommended.↲ 22 20 # config.vm.box_check_update = false↲ 23 21 ↲ 24 22 # Create a forwarded port mapping which allows access to a specific port↲ 25 23 # within the machine from a port on the host machine. In the example below,↲ 26 24 # accessing "localhost:8080" will access port 80 on the guest machine.↲ 27 25 # NOTE: This will enable public access to the opened port↲ 28 26 # config.vm.network "forwarded_port", guest: 80, host: 8080↲ 29 27 ↲ 30 28 # Create a forwarded port mapping which allows access to a specific port↲ 31 29 # within the machine from a port on the host machine and only allow access↲ 32 30 # via 127.0.0.1 to disable public access↲ 33 31 # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"↲ 34 32 ↲ 35 33 # Create a private network, which allows host-only access to the machine↲ 36 34 # using a specific IP.↲ 37 35 # config.vm.network "private_network", ip: "192.168.33.10"↲ 38 36 ↲ 39 37 # Create a public network, which generally matched to bridged network.↲ 40 38 # Bridged networks make the machine appear as another physical device on↲ 41 39 # your network.↲ 42 40 # config.vm.network "public_network"↲ 43 41 ↲ 44 42 # Share an additional folder to the guest VM. The first argument is↲ 45 43 # the path on the host to the actual folder. The second argument is↲ 46 44 # the path on the guest to mount the folder. And the optional third↲ 47 45 # argument is a set of non-required options.↲ 48 46 config.vm.synced_folder ".", "/var/www/wordpress",↲ 49 47 ▸ ▸ :nginx => "nginx",↲ 50Vagrantfile 1,1 Top 51"Vagrantfile" 73L, 3107C 52
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/10/04 23:22