本项目将演示如何使用Git+Vim (vim-fugitive in fact) 来实现LaTeX团队协作.
##环境的搭建
###Vim配置
- 需要安装VIM并配置
_vimrc
- 安装包管理器
vim-Plug
- 安装
vim-tex
,vim-fugitive
###项目配置
###协作流程
由于本模板仓库包含有LaTeX写作模板以及文件结构. 你可以以此为模板进行协作.
-
准备工作
-
新建一个团队协作目录(例如
TEAM
), 并在cygwin-shell
下切换到该目录$ cd /path/to/TEAM
-
Fork 模板仓库LaTeX-TEAM
-
-
克隆自己的模板仓库到本地
$git clone [email protected]:<yourname>/LaTeX-TEAM.git
-
编辑文件
gvim main.tex subs/test.tex
-
提交编辑
最好使用
Gstatus
来可视化-
查看状态:
:Gstatus
, 可以输入g?
来获得快捷帮助 -
加入文件:
-
, 将光标定位到文件所在行(ctrl+p
,ctrl+n
), 然后按-
即可加入该文件(会自动保存文件),Gstatus
状态会自动更新> 加入文件也可使用`:Gwrite`
-
提交文件:
:Gcommit
, 此时会在Gstatus
窗口顶部要求输入提交的_注释_(不能为空, 我在windows上的gvim不能输入, cygwin下正常). 输入完毕后用:x
保存并退出, 此时会自动提交
-
-
推送本地到Git
推送到Git:
Gpush
, 如果有密码, 此时会要求输入密码. 成功后可以在Git仓库中查看.
###参考链接