If you use the open-with plugin to open node text in Vim and your Vim's "tag" file refers to derived files then there is a risk that a derived file that is initially displayed via the "tag" command" in Vim is accidentally edited and saved from the external Vim editor while your Leo session still contains the derived file's original text that may later recreate the original derived file during a Leo save operation (overwriting the changes saved from the Vim editor).
To prevent this problem, modifications to derived files can be avoided by using Vim's "modeline" feature to disable editing of derived files. Vim's "modeline" feature scans each loaded buffer for text at the top or bottom of the file containing " vim:" followed by a series of Vim options. The text is usually embedded within a comment. The following example prevents modifications to a buffer in a Python file: # vim:noma (Note: a space is required between the '#' and "vim:noma") If this line is placed in a separate Leo node at the top or bottom of the list of nodes under a derived file node (ex: @thin) then any derived file saved and then later loaded into Vim will, by default, not be modifiable. If a derived file does need to be edited then modifications can be re-enabled on a file-by-file basis by issuing Vim's ":ma" command while viewing the derived file. The number of lines that Vim checks at the top and bottom of the buffer is configurable. The following Vim command must be placed in the vimrc file to allow for Leo's trailing sentinel lines. set modelines=8 Issue the ":help modeline" command within Vim for the more information about modelines. Regards, TL --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
