Remote Editing The solution in VSCode is Remote SSH. VSCode runs an agent on the remote side to speed up Language Server’s access to and parsing of code files. However, for VIMER, our possible solution is SSHFS. The problem of this is that the access to files through SSHFS is very slow, which makes the LS client of Coc-Vim so slow that it can hardly be used.
We can help with lsyncd, which combines inotify and rsync for near real-time directory synchronization. We can clone a copy of the code locally and create a configuration file lsyncd.conf:
sync {
default.rsync,
source = "/home/user/intel/machine/proj",
target = "machine:/root/src/proj",
delay = 5,
delete = false,
excludeFrom = "/home/user/intel/machine/proj/lsyncd.exclude",
rsync = {
binary = "/usr/bin/rsync",
archive = true,
compress = true,
chown = "root:root"
}
}
Lsyncd. exclude files that need to be excluded, such as. Git and so on:
node_modules
.git
dist
lib
lsyncd.conf
lsyncd.exclude
lsyncd.pid
Then, all we need to do is start the lsyncd daemon and use Vim to edit it locally and sync it to the remote side in real time. Because Language Server accesses local files, the speed is unlimited.
lsyncd -pidfile lsyncd.pid lsyncd.conf