LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-03-2004, 12:52 PM   #1
mr666white
Member
 
Registered: Jun 2004
Location: Leeds, England
Distribution: Gentoo, IPCop
Posts: 54

Rep: Reputation: 15
Vim, textwidth, pine and tin


Ok I have some irritating problems with my linux account at uni. Never had these problems at home, so I'm a bit stuck.

vim is my editor of choice
tin is my newsreader of choice
pine is hte mail client imposed

every time I reply to a post i need to do
Code:
:set textwidth=72
There must be someway to do this automagicly for me when i call vim from tin

my .vimrc as it stands
Code:
filetype plugin on
filetype on
syntax on
autocmd FileType mail set textwidth=72


let TextFiles = "*.txt,/tmp/pico.*,.article.*,.followup.*,.letter.*"
execute "autocmd BufEnter " . TextFiles . " set textwidth=72"
execute "autocmd BufLeave " . TextFiles . " set textwidth=0"
unlet TextFiles

map <C-Z> :echo "Suspending `Vim' has been disabled; see .vimrc for details."<CR>
" The above line disables the normal function of <Ctrl>+Z and displays a
" message instead.  <Ctrl>+Z in generally Unix suspends jobs.  This is a useful
" feature, but can be confusing for beginners, especially if <Ctrl>+Z is
" pressed by mistake (perhaps when aiming for capital Z), so it's been
" disabled.  To enable it, simply remove the above map line from this file.
autocmd VimEnter .article if line('.') == line('$') | yank | put
autocmd VimEnter .followup if line('.') != 1 | normal gq${j

set t_kb=^?
fixdel
set tabstop=4
set background=dark
Ideally, vim should wrap text, mail and comments to 72 chars, but leave my code alone

Also, how the hell do i get pine to accept vim as my editor of choice. I hate pico with a passion
 
Old 10-03-2004, 01:07 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Here is a web page called 'pine & vim': http//www.stripey.com/vim/pine.html

The following is excepted from that web-site:


[code]
Calling Vim from Pine
By default Pine uses its own built-in editor, Pico. To have it use Vim instead requires this setting:
Code:
editor                   = vim
That much is fairly obvious. Rather less so is that these two settings are needed as well:
Code:
            [X]  enable-alternate-editor-cmd           
            [X]  enable-alternate-editor-implicitly
These settings can be found by pressing S then C at the main menu, then using the W command to search for the string editor.
Once set up headers will be edited in Pine exactly as before, but moving ‘down’ past the last header and into the message body will cause Vim to be launched to edit the body; no headers will be loaded into Vim.

Plain Text (Human Language) Files
Different formatting settings are designed for plain text files, those just containing ordinary English (or whatever) language. There isn’t a default filetype for these, so define that all files with the extension .txt should be assumed to be ‘human’ format. Mail and news articles also fall into this category; they already have a filetype, though I also want anything in my postponed directory to be considered a news article, so I have:
Code:
augroup filetype
  autocmd BufNewFile,BufRead */.Postponed/* set filetype=mail
  autocmd BufNewFile,BufRead *.txt set filetype=human
augroup END
(This clobbers the help filetype, but this doesn’t seem to prevent help from working properly.)
Then Vim can be set up so that line breaks are automatically inserted in all human text. I have these at 72 characters so that even if my mail or news article is quoted by somebody else, it still fits into an 80-column terminal:
Code:
autocmd FileType mail,human set formatoptions+=t textwidth=72

Last edited by jschiwal; 10-03-2004 at 01:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 10:00 AM
Disable Shell "!" in TIN? jonwatson Linux - Software 1 06-15-2004 09:30 AM
can you sort messages by subject with tin? amphibious Linux - Software 0 12-01-2003 10:31 PM
Pine r00tshell Slackware 3 07-15-2003 10:17 PM
Pine elist Linux - General 8 01-25-2002 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration