A very simple minimalistic bash script for remote building which can be used with vim without plugins.
- Uses
rsyncto copy files to the build server andsshto invoke remote build commands. - Build server settings (address and port) are stored in a separate dot-file, and you can easily make your VCS ignore it.
- Build command arguments are also stored in a dot-file so you can type them once and then use a keyboard shortcut to start building process. Of course, new arguments given on the command line override those from the dot-file.
- It would be great to navigate build errors and highlight the corresponding code.
- Place the script into your project directory.
- Create
.buildhostfile which host information in the[rsync://]HOST[:PORT]format. - Run either from the shell:
./remote-build.sh [ARGS]or from vim::!./remote-build.sh [ARGS]. - You can specify arguments to the script, which will be passed to the build command. The arguments are stored in
.buildargsfile and are reused if no new arguments are given. - Create mappings in
vim. For example, to makeF7execute build script with default arguments (taken from.buildargsif present) and to makeShift-F7prompt for arguments:
map <F7> :!./remote-build.sh
map <S-F7> :exec "!./remote-build.sh ".input("Optional args: ")<CR>