From f9f731d5f70183edb032e58b6f24e579f4a218d8 Mon Sep 17 00:00:00 2001 From: zlzhao Date: Wed, 27 Mar 2019 14:17:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9vim=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85=E4=BD=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=8D=B8=E8=BD=BD=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 +++------- README.md | 33 ++++++++++++++++++++++++--------- setup.sh => install.sh | 7 ++----- uninstall.sh | 8 ++++++++ vim/.gitignore | 3 ++- vim/vimrcs/plugins_config.vim | 2 +- 6 files changed, 40 insertions(+), 23 deletions(-) rename setup.sh => install.sh (66%) create mode 100644 uninstall.sh diff --git a/Dockerfile b/Dockerfile index f45fa03..ceda1c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,10 @@ FROM alvisisme/docker-ubuntu-1604-163 - LABEL maintainer="Alvis Zhao " RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y vim zsh tmux + DEBIAN_FRONTEND=noninteractive apt-get install -y git vim zsh tmux -COPY zsh /root/.oh-my-terminal/zsh -COPY tmux /root/.oh-my-terminal/tmux -COPY vim /root/.oh-my-terminal/vim -COPY setup.sh /root/.oh-my-terminal/setup.sh -RUN sh /root/.oh-my-terminal/setup.sh +COPY ./ /root/.oh-my-terminal/ +RUN sh /root/.oh-my-terminal/install.sh ENTRYPOINT [ "/bin/zsh" ] \ No newline at end of file diff --git a/README.md b/README.md index a1d89e0..7ac79b0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * tmux * vim -## 安装说明 +## 如何安装 1. 安装必要的软件 @@ -18,11 +18,28 @@ 1. 备份必要的配置文件 -1. 安装使用 +1. 安装本工程 ```bash git clone https://github.com/alvisisme/oh-my-terminal.git ~/.oh-my-terminal - sh ~/.oh-my-terminal/setup.sh + sh ~/.oh-my-terminal/install.sh + ``` + +1. 切换默认shell + + ```bash + chsh -s $(which zsh) + ``` + +1. 安装vim插件 + + 进入vim,命令模式下执行`:PlugInstall`,自动联网下载插件,插件位于`~/.oh-my-terminal/vim/plugged`目录下 + +## 如何卸载 + + ```bash + sh ~/.oh-my-terminal/uninstall.sh + rm -r ~/.oh-my-terminal/ ``` ## 效果预览 @@ -146,14 +163,12 @@ docker run -it oh-my-terminal `PREFIX 空格键` -## 注意事项 - -vim插件默认安装在`~/.vim/plugged`目录下,离线安装时需要将本工程和已完成安装的`~/.vim/plugged`一起复制移动到新机器上。 - - ## 参考引用 * [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) * [on-my-tmux](https://github.com/gpakosz/.tmux) -* [super-vimer](https://github.com/alvisisme/super-vimer) +* [amix vimrc](https://github.com/amix/vimrc) +* [use vim as ide](https://github.com/yangyangwithgnu/use_vim_as_ide) +* [VIM Awesome](https://vimawesome.com/) +* [如何在 Linux 下利用 Vim 搭建 C/C++ 开发环境? - 韦易笑的回答 - 知乎](https://www.zhihu.com/question/47691414/answer/373700711) * [Linux SSH终端terminal配色更改为256色](https://www.haiyun.me/archives/linux-terminal-xterm-256color.html) diff --git a/setup.sh b/install.sh similarity index 66% rename from setup.sh rename to install.sh index 91da735..35d2a5e 100644 --- a/setup.sh +++ b/install.sh @@ -9,9 +9,6 @@ ln -s -f ~/.oh-my-terminal/tmux/.tmux.conf ~/.tmux.conf ln -s -f ~/.oh-my-terminal/tmux/.tmux.conf.local ~/.tmux.conf.local # vim -mkdir -p ~/.vim/plugged +mkdir -p ~/.oh-my-terminal/vim/plugged ln -s -f ~/.oh-my-terminal/vim ~/.vim_runtime -sh ~/.vim_runtime/install_basic_vimrc.sh - -# 切换当前用户默认shell,重新进入终端后生效 -chsh -s $(which zsh) +sh ~/.vim_runtime/install_super_vimrc.sh diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..920edb9 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +rm -f ~/.tmux.conf +rm -f ~/.tmux.conf.local +rm -f ~/.oh-my-zsh +rm -f ~/.vim_runtime +rm -f ~/.vimrc +rm -f ~/.zshrc diff --git a/vim/.gitignore b/vim/.gitignore index dbe9c82..6f61cea 100644 --- a/vim/.gitignore +++ b/vim/.gitignore @@ -1 +1,2 @@ -.vscode/ \ No newline at end of file +.vscode/ +plugged diff --git a/vim/vimrcs/plugins_config.vim b/vim/vimrcs/plugins_config.vim index 6efd15f..b38c7b8 100644 --- a/vim/vimrcs/plugins_config.vim +++ b/vim/vimrcs/plugins_config.vim @@ -1,7 +1,7 @@ " Specify a directory for plugins " - For Neovim: ~/.local/share/nvim/plugged " - Avoid using standard Vim directory names like 'plugin' -call plug#begin('~/.vim/plugged') +call plug#begin('~/.oh-my-terminal/vim/plugged') " Make sure you use single quotes Plug 'https://github.com/scrooloose/nerdtree.git'