|
|
|||||||||||||
The Vim settings below are included in the sample .vimrc configuration file.
.slrnrc:
set editor_command "vim -c 'set titlestring=SLRN\\ Vim' -c %d %s"The
%d makes Vim jump to the appropriate line
in the file (though, somewhat curiously, this only happens the first time
editing any file; when quitting Vim back to
SLRN then editing the file again, the SLRN
always seems to suggest the first line). The %s is the name
of the file to be editied.
The titlestring changes the title of the terminal to
“SLRN Vim”, which is generally more meaningful than the name
of the file being edited. It ensures that the window can easily be
identified as being the one in which SLRN is being run, even
though SLRN isn’t currently visible.
.article is opened and the cursor is at the end
of the file.
If there is a signature SLRN will insert an appropriate
number of blank lines, but leaves the cursor on the third blank line
after the header, rather than the more useful second. This can easily be
rectified: because of the quirk mentioned above, whenever a file is being
re-edited the cursor will be on the top line, so if .article
is opened with the cursor neither on the first nor the last line then
this must be the first time of opening an article with a signature, hence
the cursor can be moved back one line. Putting all this together gives
this autocommand:
autocmd VimEnter .article if line('.') == line('$') | yank | put |
\ elseif line('.') != 1 | -
textwidth setting. This obviously must not happen if the
article is being re-edited (wrapped article header lines tend not to be
so useful!), so a check is made:
autocmd VimEnter .followup if line('.') != 1 | normal gq${j