Home » Questions » Computers [ Ask a new question ]

message-mode for VIM? (or Composing Email in VIM)

message-mode for VIM? (or Composing Email in VIM)

Emacs has something called message-mode (type M-x message-mail) that can be used to compose emails. This mode helps one to automatically wrap text to 72 columns .. keeping quoted marks properly.

Asked by: Guest | Views: 88
Total answers/comments: 2
Guest [Entry]

"Yes. Vim implements message-mode using filetypes.

Vim should be able to autodetect that you're editing a mail message. It should automatically set the filetype to mail. You can check this by displaying the current value of filetype by typing (in command mode) ...

:set filetype

You can also force Vim to use a particular filetype. In command mode, type ...

:set filetype=mail

to force Vim to set the default editing preferences for mail messages.

You can read more about filetypes in the Vim help system.

:help filetype"
Guest [Entry]

"You want this command:

:set wrapmargin=8

Assuming that your window is set for 80 characters wide. This sets the wrap margin 8 characters from the right hand side, which gives you a width of 72.

You can abbreviate wrapmargin to wm

You may also want to check the email category at this wiki about VIM"