On Fri, Jan 14, 2011 at 02:23:57PM -0800, xlii vim wrote: > Hi Vimers, > > I want to use VIM to > 1) copy the receiver's first name, > 2) paste it at the greeting line, > 3) open a new line, > 4) and leave vim in insert mode > in a /tmp/mutt* file at vim startup. > > """"""""""""""""""""""""""""""Original file > From: > To: Vi Improved <[email protected]> > Cc: > Bcc: > Subject: > Reply-To: > In-Reply-To: > X-Operating-System: GNU/Linux > > On Fri, Jan 14, 2011 at 11:52:15AM -0400, Vi Improved wrote: > > > HiFIRSTNAME > Best regards, > -- > Signature lines > """"""""""""""""""""""""""""""
> """""""""""""""""""""""""""""" > "solution 2 > let mapleader = "," > nmap <Leader>n ggjwlve"ny/^Hi<cr>:s/FIRSTNAME/\=@n<cr>A,<esc>o > """""""""""""""""""""""""""""" > "How to invoke the key mapping ",n" at the VIM startup? > "I have to manually type in ",n" after the file being loaded. > "This will leave me in the insert mode. > """""""""""""""""""""""""""""" Does this line help? | au BufRead /tmp/mutt* normal ,n Or without a mapping | au BufRead /tmp/mutt* normal ggjwlve"ny/^Hi<cr>:s/FIRSTNAME/\=@n<cr>A,<esc>o -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
