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 """""""""""""""""""""""""""""" """"""""""""""""""""""""""""""Modified 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: > Hi Vi, | Best regards, -- Signature lines """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" "solution 1 "~/.vimrc au BufRead /tmp/mutt* call MuttGetName() function MuttGetName() execute 'normal ggjwlve"ny' :%s/FIRSTNAME/\=@n execute "normal A," execute "normal o" endfunction """""""""""""""""""""""""""""" "Could I do it in one execute line? "Could I leave VIM in insert mode after the MuttGetName()? """""""""""""""""""""""""""""" """""""""""""""""""""""""""""" "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. """""""""""""""""""""""""""""" Thank you. Xlii -- 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
