Article View: news.software.readers
Article #258639Re: configuration with slrn/vim
From: Eli the Bearded
Date: Wed, 19 Nov 2014 22:00
Date: Wed, 19 Nov 2014 22:00
66 lines
3939 bytes
3939 bytes
In news.software.readers, Dale <dale@dalekelly.org> wrote:
> I can get line wrap to 80 characters on things I cut and paste into
> slrn. with
>
> set editor_command "vim '+set tw=80' +%d '%s'
(note to readers: The missing quote issue has already been addressed
downthread)
> if I type, it wraps to 80 characters too, but when I send I have to
> force send because it says a line is above 80 characters
I'm not a slrn user, but I do use vim with my newsreader of choice.
Two things to note:
1) vim won't wrap lines that start out over the textwrap ("tw") limit,
so if you follow-up to a post with 79 character lines, and then those
get extended to 81 because of a leading "> ", you'll need to fix them on
your own somehow. (See below)
2) vim won't wrap lines longer than the textwrap limit if there is no
whitespace in the line to wrap. Typically I find that happens very
rarely unless you count web URLs pasted in.
My newsreader has a very predictable and reasonably unique naming scheme
for posts I am composing: "~/.article.PID". Instead of setting a command
line preference for how I want those articles to have a different vim
configuration, I use a line in my vimrc:
" Set up macros for Pnews
autocmd BufRead .article.* :so ~eli/.news_vimrc
(The " line is a comment and not required.)
My .news_vimrc has several map! commands to translate smart quotes into
old-fashioned ASCII, a few other commands helpful to me, plus one "set"
line for news article specific settings:
map! ’ '
map! ‘ '
map! “ "
map! ” "
map! … ...
" n-dash
map! – --
" m-dash
map! — --
" map function-5 to find non-tab, non-space to tilde (ie, non-ASCII)
map <F5> /[^ -~]<cr>
map <F6> iContent-Type: text/plain; charset="UTF-8"<cr>MIME-Version: 1.0<cr><esc>
map! <F6> Content-Type: text/plain; charset="UTF-8"<cr>MIME-Version: 1.0<cr>
set ai sw=4 tw=72
The autoindent ("ai") with vim's default setting of the "comments" means
that ">" indented text can usually be safely reformatted with the vim's
built in text reformatter: "gq{motion}". See ":help gq" in vim. The most
frequent motion command I use when reformatting quoted text is "}",
which is "from here to next blank line".
I think the reformat command may be of particular use to you, because
I'm guessing that it is existing long lines which are triggering your
over 80 columns problem.
Elijah
------
has a similar file for Rnmail's "reply by email temporary file" settings
Technical Details
Message-ID:
<eli$1411191700@qz.little-neck.ny.us>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20141227.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!newsfeed-00.mathworks.com!panix!qz!not-for-mailReferences:
<80fgrl.use.17.1@news.alt.net>Show Full Headers
Complete Article Headers
Message-ID: <eli$1411191700@qz.little-neck.ny.us> Subject: Re: configuration with slrn/vim Date: Wed, 19 Nov 2014 22:00:38 +0000 From: Eli the Bearded <*@eli.users.panix.com> References: <80fgrl.use.17.1@news.alt.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20141227.mbox.gz!border2.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!newsfeed-00.mathworks.com!panix!qz!not-for-mail Newsgroups: news.software.readers Organization: Some absurd concept Lines: 66 NNTP-Posting-Host: panix5.panix.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: reader1.panix.com 1416434438 20895 166.84.1.5 (19 Nov 2014 22:00:38 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 19 Nov 2014 22:00:38 +0000 (UTC) X-Liz: It's actually happened, the entire Internet is a massive game of Redcode X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix X-US-Congress: Moronic Fucks. X-Attribution: EtB XFrom: is a real address Encrypted: double rot-13 User-Agent: Vectrex rn 2.1 (beta) X-Comments: "'Pray that I don't alter the bargain further.' Welcome Darth Google." -- HonorableSoul