I prefer to start two lines into the first big chunk of empty text (either in the main body on a new email, or after all the quoted lines on a reply), so I changed the if str == '' let cur = cur + 1 " If the first line of the body is an attribution, put " the cursor _after_ that line, otherwise the cursor is " leaved right after the headers (assuming we're writing " a new mail, and not editing a reply). " NOTE: modify the regexp to match your mail client's attribution! if strlen(matchstr(getline(cur), '^On.*wrote:.*')) > 0 let cur = cur + 1 endif execute cur :start break endif to
Attributes | Values |
---|
rdfs:label
| - Automatically position the cursor when editing email messages
|
rdfs:comment
| - I prefer to start two lines into the first big chunk of empty text (either in the main body on a new email, or after all the quoted lines on a reply), so I changed the if str == '' let cur = cur + 1 " If the first line of the body is an attribution, put " the cursor _after_ that line, otherwise the cursor is " leaved right after the headers (assuming we're writing " a new mail, and not editing a reply). " NOTE: modify the regexp to match your mail client's attribution! if strlen(matchstr(getline(cur), '^On.*wrote:.*')) > 0 let cur = cur + 1 endif execute cur :start break endif to
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Category
| |
Author
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
Rating
| |
abstract
| - I prefer to start two lines into the first big chunk of empty text (either in the main body on a new email, or after all the quoted lines on a reply), so I changed the if str == '' let cur = cur + 1 " If the first line of the body is an attribution, put " the cursor _after_ that line, otherwise the cursor is " leaved right after the headers (assuming we're writing " a new mail, and not editing a reply). " NOTE: modify the regexp to match your mail client's attribution! if strlen(matchstr(getline(cur), '^On.*wrote:.*')) > 0 let cur = cur + 1 endif execute cur :start break endif to if str == '' :start normal gg/
^M2ji break endif Note that the ^M there is entered with Ctrl-V Ctrl-M (or Ctrl-Q Ctrl-M on Windows). Here's a one-line-in-the-dot-vimrc option: autocmd BufRead mutt* execute 'normal gg/
^M2j' I prefer to still stay in normal mode in case I need to search or perform other commands before entering insert mode. Your signature will need to start with a few newlines in it for the above to work.
|