From bf13cbaa50114cbd01686303409fe22817b0d10a Mon Sep 17 00:00:00 2001 From: zlzhao Date: Sun, 24 Mar 2019 11:03:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=93=8D=E4=BD=9C=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- README.md | 121 +++++++++++++++++- setup.sh | 3 +- vim/Dockerfile | 31 ----- vim/README.md | 1 - vim/docs/README.md | 33 ----- ...nstall_vimrc.sh => install_super_vimrc.sh} | 2 +- vim/vimrcs/plugins_config.vim | 1 - 8 files changed, 124 insertions(+), 70 deletions(-) delete mode 100644 vim/Dockerfile delete mode 100644 vim/docs/README.md rename vim/{install_vimrc.sh => install_super_vimrc.sh} (83%) diff --git a/Dockerfile b/Dockerfile index 16a765f..f45fa03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM alvisisme/docker-ubuntu-1604-163 LABEL maintainer="Alvis Zhao " RUN apt-get update && \ - apt-get install -y vim zsh tmux + DEBIAN_FRONTEND=noninteractive apt-get install -y vim zsh tmux COPY zsh /root/.oh-my-terminal/zsh COPY tmux /root/.oh-my-terminal/tmux diff --git a/README.md b/README.md index 96d3ec8..a1d89e0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * tmux * vim -## 使用说明 +## 安装说明 1. 安装必要的软件 @@ -32,6 +32,125 @@ docker build -t oh-my-terminal . docker run -it oh-my-terminal ``` +## 操作手册 + +### tmux + +`PREFIX` 代表前置组合键,即同时按下 `Ctrl` 和 `b`,也可表示为 +`ctrl + b`, `+`代表前后键需要同时按下。 + +#### 会话session +* 查看会话列表 + + `tmux ls` + +* 创建会话 + + `tmux new [-s SESSION_NAME]` + + `PREFIX :new [-s SESSION_NAME]` + +* 关闭会话 + + `tmux kill-session [-t SESSION_NAME]` + +* 置于后台 + + `PREFIX d` + +* 挂起 + + `PREFIX ctrl + z` + +* 唤醒到前台 + + `tmux a [-t SESSION_NAME]` + +* 切换不同会话 + + `PREFIX s`,选择会话id + + `PREFIX (` 切换到前一个会话 + + `PREFIX )` 切换到后一个会话 + +* 重命名 + + `PREFIX $` + +#### 窗口window +* 创建新窗口 + + `PREFIX c` + +* 关闭当前窗口 + + `PREFIX &` + +* 重命名 + + `PREFIX ,` + +* 切换不同窗口 + + `PREFIX 窗口编号` + + `PREFIX Ctrl + h` 切换到前一个窗口 + + `PREFIX Ctrl + l` 切换到后一个窗口 + +#### 窗格panel +* 创建新窗格 + + `PREFIX -`水平切割 + + `PREFIX ——`垂直切割 + +* 关闭窗格 + + `PREFIX x` + +* 显示编号 + + `PREFIX q` + +* 切换 + + `PREFIX ;` 切换到最近一个活动的窗格 + + `PREFIX 方向键` + + `PREFIX h/j/k/l` vim的键位 + + `PREFIX q 窗格编号` + + `PREFIX o` 下一个窗格 + +* 移动 + + `PREFIX >` 当前窗格和后一个窗格互换位置 + + `PREFIX <` 当前窗格和前一个窗格互换位置 + +* 全屏 + + `PREFIX z` + +* 大小调整 + + `PREFIX + 方向键` + + `PREFIX ctrl + 方向键` + +* 布局调整 + + `PREFIX 空格键` + +## 注意事项 + +vim插件默认安装在`~/.vim/plugged`目录下,离线安装时需要将本工程和已完成安装的`~/.vim/plugged`一起复制移动到新机器上。 + + ## 参考引用 * [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) diff --git a/setup.sh b/setup.sh index bf4ee73..91da735 100644 --- a/setup.sh +++ b/setup.sh @@ -9,8 +9,9 @@ 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 ln -s -f ~/.oh-my-terminal/vim ~/.vim_runtime sh ~/.vim_runtime/install_basic_vimrc.sh # 切换当前用户默认shell,重新进入终端后生效 -chsh -s $(which zsh) \ No newline at end of file +chsh -s $(which zsh) diff --git a/vim/Dockerfile b/vim/Dockerfile deleted file mode 100644 index 11b4af6..0000000 --- a/vim/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM alvisisme/docker-ubuntu-non-root-with-utils - -LABEL maintainer="Alvis" - -ENV LANG C.UTF-8 - -RUN sudo apt-get update && \ - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y cmake g++ - -# zsh and on-my-zsh -RUN sudo DEBIAN_FRONTEND=noninteractive apt-get install -y zsh && \ - git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh && \ - cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc && \ - echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && \ - sudo chsh -s /bin/zsh - -# tmux -RUN sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tmux && \ - echo 'set-option -g default-shell /bin/zsh' > ~/.tmux.conf - -# vim C/C++ development environment -RUN git clone https://github.com/alvisisme/vimrc-cpp.git ~/.vim_runtime && \ - sh ~/.vim_runtime/install_vimrc.sh && \ - vim -N -u ~/.vimrc -c "PlugInstall" -c "qall" -U NONE -i NONE -e -s - -# python related -RUN sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python python3 python-pip && \ - pip install --upgrade pip && \ - pip install cheat - -CMD [ "/usr/bin/tmux" ] diff --git a/vim/README.md b/vim/README.md index dad0a4d..036facc 100644 --- a/vim/README.md +++ b/vim/README.md @@ -26,7 +26,6 @@ VIM命令模式下执行`:PlugInstall`完成插件安装 * [插件管理 vim-plug](https://github.com/junegunn/vim-plug) * [目录树显示 NERDTree](https://github.com/scrooloose/nerdtree) -* [代码补全 YouCompleteMe](https://github.com/valloric/youcompleteme) * [括号补全 delimitMate](https://github.com/Raimondi/delimitMate) * [自动格式化 autoformat](https://github.com/chiel92/vim-autoformat) * [括号引号等快捷处理 vim-surround](https://github.com/tpope/vim-surround) diff --git a/vim/docs/README.md b/vim/docs/README.md deleted file mode 100644 index 00f59a8..0000000 --- a/vim/docs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Super VIMER -VIM 集成开发环境 - -## 使用说明 - -下载该工程  -```shell -git clone https://github.com/alvisisme/super-vimer.git ~/.vim_runtime -``` - -安装脚本 -```shell -cd ~/.vim_runtime -sh install_vimrc.sh -``` - -VIM命令模式下执行`:PlugInstall`完成插件安装 - -插件安装于 **~/.vim/plugged/** 目录下 - -## 插件列表 - -* [插件管理 vim-plug](https://github.com/junegunn/vim-plug) -* [目录树显示 NERDTree](https://github.com/scrooloose/nerdtree) -* [代码补全 YouCompleteMe](https://github.com/valloric/youcompleteme) -* [括号补全 delimitMate](https://github.com/Raimondi/delimitMate) - -## 参考引用 - -* [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) diff --git a/vim/install_vimrc.sh b/vim/install_super_vimrc.sh similarity index 83% rename from vim/install_vimrc.sh rename to vim/install_super_vimrc.sh index a516dc4..212d971 100644 --- a/vim/install_vimrc.sh +++ b/vim/install_super_vimrc.sh @@ -5,7 +5,7 @@ cd ~/.vim_runtime echo 'set runtimepath+=~/.vim_runtime source ~/.vim_runtime/vimrcs/basic.vim -#source ~/.vim_runtime/vimrcs/plugins_config.vim +source ~/.vim_runtime/vimrcs/plugins_config.vim try source ~/.vim_runtime/my_configs.vim diff --git a/vim/vimrcs/plugins_config.vim b/vim/vimrcs/plugins_config.vim index 1504d95..6efd15f 100644 --- a/vim/vimrcs/plugins_config.vim +++ b/vim/vimrcs/plugins_config.vim @@ -5,7 +5,6 @@ call plug#begin('~/.vim/plugged') " Make sure you use single quotes Plug 'https://github.com/scrooloose/nerdtree.git' -Plug 'valloric/youcompleteme' Plug 'raimondi/delimitmate' Plug 'Chiel92/vim-autoformat' Plug 'https://github.com/tpope/vim-surround'