Vim normally offers a pretty lightweight bit of change detection and I think Shawn was only asking how to apply that to a new filename. In that context, ":saveas" seems to work:
$ vim a
:saveas b
:! echo hello >> b
W11: Warning: File "b" has changed since editing started
John Passaro
(917) 678-8293
(917) 678-8293
On Sun, Dec 11, 2016 at 12:42 PM, <arocker@vex.net> wrote:
> Shawn, what is it you're trying to do, exactly? The two parts of your
> question ("changing which file a buffer points to" and "get notified
> when a file is externally modified") are unrelated in vim.
>
This is a vim-related list, but this does raise the question of whether
vim is even the appropriate tool? It sounds like some some sort of
monitoring effort.
Vim is wonderful for a human creating or updating a text, then going away
to do something else. Operations involving multiple files, intermittent or
unpredictable events, and other situations fit other programs better.
The programs in the *nix tool chest are all powerful and flexible. As a
result, sufficiently dedicated perversity can bend almost all of them to
do jobs wildly different from their designers' intentions. (Video games
written in sed, for example:https://github.com/aureliojargas/sokoban.sed
.) Just because it's possible doesn't make it advisable.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/d/optout .
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment