On Jan 15, 4:30 am, Florian Rehnisch <[email protected]> wrote: > Moin Florian! > > On Sat, Jan 15, 2011 at 09:12:36AM +0100, Florian Rehnisch wrote: > > | au BufRead /tmp/mutt* normal > > ggjwlve"ny/^Hi<cr>:s/FIRSTNAME/\=@n<cr>A,<esc>o > > Well, that won't work. Instead of stating <cr> and <esc> one has to > do it literally by doing ctrl-v ctrl-m and ctrl-v esc, respectively. > > flori
Hi flori, Thanks! Both au BufRead /tmp/mutt* normal ,n and au BufRead /tmp/mutt* normal ggjwlve"ny/^Hi^M:s/FIRSTNAME/\=@n^MA,^[o partially work. (Where ^M: ctrl-v ctrl-m and ^[: ctrl-v esc) The problem is that the last action is "o", which is supposed to begin a new line below the cursor and enter into insert mode, but the end result would be in normal mode. http://marc.info/?l=vim&m=105007711107887&w=2 mentioned :startinsert, but this command does not work from :normal. So a revised solution is: au BufRead /tmp/mutt* call MuttGetName() function MuttGetName() normal ggjwlve"ny/^Hi^M:s/FIRSTNAME/\=@n^MA,^[o startinsert endfunction 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
