On Aug 10, 7:58 pm, Ben Fritz <[email protected]> wrote: > On Aug 10, 7:09 am, sinbad <[email protected]> wrote: > > > hi, > > > the following statement is not working inside a vim function. > > any clue ? > > > silent normal! z<CR> > > Because you're feeding in 4 characters, '<', 'C', 'R', '>' instead of > the intent, which is doubtless to feed in an actual <CR> character. > There are at least two ways to do this in a normal command: > > 1. silent exec "normal! z\<CR>" > 2. silent normal! z^M (where the ^M is not the two characters, but > rather the result of typing CTRL-V followed by an actual <CR> to > insert the byte literally) > > The first is probably slightly cleaner. > > The special <Key> syntax pretty much only works in mappings. For use > in strings, it must be escaped as shown (and in double-quotes, not > single-quotes, which will take the '\' literally as well).
thanks Thinca and Ben, worked just perfect. -- 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
