From f475357ddb1fd39921f6d5ebf6957d7a3f450abd Mon Sep 17 00:00:00 2001 From: ehlxr Date: Thu, 1 Nov 2018 18:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=99=E7=82=B9=E6=9B=B4=E6=96=B0=EF=BC=9A20?= =?UTF-8?q?18-11-01=2018:19:14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- Vagrantfile | 18 +++++++++--------- config/init.sh | 7 ++++--- config/my.zsh | 3 +++ 4 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 config/my.zsh diff --git a/.gitignore b/.gitignore index 2bc52b8..2656a00 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.key *.box -.vagrant \ No newline at end of file +.vagrant +vm_share \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 9dc1bcd..3a47835 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -45,17 +45,17 @@ Vagrant.configure("2") do |config| # do NOT check the correct additions version when booting this machine(插件安装:vagrant plugin install vagrant-vbguest) cfg.vbguest.auto_update = false - cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant" + cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant/vm_share", "/share" # 开机运行命令 - cfg.vm.provision "shell", run: "always", inline: <<-SHELL - echo -e "\033[1;33mInit cmd...\033[0m" - echo -e "\033[1;33mConfig ssh...\033[0m" - mkdir -p ~/.ssh && cat /vagrant/config/authorized_keys >> ~/.ssh/authorized_keys - sed -i 's/^#RSAAuthentication.*/RSAAuthentication\ yes/g' /etc/ssh/sshd_config - sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication\ yes/g' /etc/ssh/sshd_config - sed -i 's/^PasswordAuthentication.*/PasswordAuthentication\ yes/g' /etc/ssh/sshd_config - SHELL + # cfg.vm.provision "shell", run: "always", inline: <<-SHELL + # echo -e "\033[1;33mInit cmd...\033[0m" + # echo -e "\033[1;33mConfig ssh...\033[0m" + # mkdir -p ~/.ssh && cat /vagrant/config/authorized.key >> ~/.ssh/authorized_keys + # sed -i 's/^#RSAAuthentication.*/RSAAuthentication\ yes/g' /etc/ssh/sshd_config + # sed -i 's/^#PubkeyAuthentication.*/PubkeyAuthentication\ yes/g' /etc/ssh/sshd_config + # sed -i 's/^PasswordAuthentication.*/PasswordAuthentication\ yes/g' /etc/ssh/sshd_config + # SHELL # 自定义初始化执行脚本 # cfg.vm.provision "shell", path: "config/init.sh" diff --git a/config/init.sh b/config/init.sh index 1bf0c12..9080bb3 100755 --- a/config/init.sh +++ b/config/init.sh @@ -27,6 +27,7 @@ git clone https://github.com/zsh-users/zsh-history-substring-search.git /root/.o echo -e "\033[1;33mConfig oh-my-zsh...\033[0m" cp -f /vagrant/config/zshrc ~/.zshrc +cp -f /vagrant/config/my.zsh ~/.oh-my-zsh/custom/ echo -e "\033[1;33mConfig ssh...\033[0m" mkdir -p ~/.ssh && cat /vagrant/config/authorized.key >> ~/.ssh/authorized_keys @@ -51,6 +52,6 @@ echo -e "\033[1;33mStart and enable Docker...\033[0m" systemctl enable docker systemctl start docker -echo -e "\033[1;33mVboxadd setup...\033[0m" -cd /opt/VBoxGuestAdditions-*/init -./vboxadd setup \ No newline at end of file +# echo -e "\033[1;33mVboxadd setup...\033[0m" +# cd /opt/VBoxGuestAdditions-*/init +# ./vboxadd setup \ No newline at end of file diff --git a/config/my.zsh b/config/my.zsh new file mode 100644 index 0000000..bee5bce --- /dev/null +++ b/config/my.zsh @@ -0,0 +1,3 @@ +bindkey '^]' forward-word +bindkey '^f' vi-forward-blank-word +#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=blue,underline'