Browse Source

加入操作说明

master
Alvis Zhao 6 years ago
parent
commit
bf13cbaa50
  1. 2
      Dockerfile
  2. 121
      README.md
  3. 3
      setup.sh
  4. 31
      vim/Dockerfile
  5. 1
      vim/README.md
  6. 33
      vim/docs/README.md
  7. 2
      vim/install_super_vimrc.sh
  8. 1
      vim/vimrcs/plugins_config.vim

2
Dockerfile

@ -3,7 +3,7 @@ FROM alvisisme/docker-ubuntu-1604-163 @@ -3,7 +3,7 @@ FROM alvisisme/docker-ubuntu-1604-163
LABEL maintainer="Alvis Zhao <alvisisme@163.com>"
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

121
README.md

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
* tmux
* vim
## 使用说明
## 安装说明
1. 安装必要的软件
@ -32,6 +32,125 @@ docker build -t oh-my-terminal . @@ -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)

3
setup.sh

@ -9,8 +9,9 @@ ln -s -f ~/.oh-my-terminal/tmux/.tmux.conf ~/.tmux.conf @@ -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)
chsh -s $(which zsh)

31
vim/Dockerfile

@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
FROM alvisisme/docker-ubuntu-non-root-with-utils
LABEL maintainer="Alvis<alvisisme@gmail.com>"
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" ]

1
vim/README.md

@ -26,7 +26,6 @@ VIM命令模式下执行`:PlugInstall`完成插件安装 @@ -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)

33
vim/docs/README.md

@ -1,33 +0,0 @@ @@ -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)

2
vim/install_vimrc.sh → vim/install_super_vimrc.sh

@ -5,7 +5,7 @@ cd ~/.vim_runtime @@ -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

1
vim/vimrcs/plugins_config.vim

@ -5,7 +5,6 @@ call plug#begin('~/.vim/plugged') @@ -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'

Loading…
Cancel
Save