Personally I like using the tool entr a lot, which seems to be included in major Linux distributions. the inotify library, if your not using too crazy file systems. On Linux/Unix an event-driven approach can be realized by listening to file system events using e.g. However, that command could be tied to a simple loop, using Bash's for/ while, or using a hacky one-liner in Linux/Unix: watch -n 1 'vim -servername JABBERWOCKY -remote-send ":e"'Īlthough not tested, I'm certain that something like this could be realized in PowerShell, too. The command with -remote-send above requires manual reloading. For that case a decision has to be made: Leave it with that and keep changes in Vim, or discard local changes and force a reload. If the opened file was changed in Vim and externally, there will be a conflict during reload (a warning message will appear). vim -servername JABBERWOCKY -remote-send ":e" Force of Will Force of Will (Card) 84.99 71.18 16. This command will finish quickly and not spawn a new editor. When necessary, send a command to the server instance to reload the file. the cursor will be placed on the last line use gvim +1 +/pattern to force. by a echo "Curiouser and curiouser" > /tmp/alice.log. This chapter discusses some of the options you can use when starting Vim from. ![]() ![]() Let's assume the file has been changed externally, e.g. vim -servername JABBERWOCKY /tmp/alice.log First, open the file in question with Vim, while starting a server instance. With the following commands a file can be reloaded via an external command. I solved it with the Vim server/remote command line options, inspired by this answer. I had the problem of looking at contents of a file, update the file externally, display the changed file and have the option to edit it when needed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |