Loading ...
Sorry, an error occurred while loading the content.

45634Re: Calling a function from a :s command (weird results)

Expand Messages
  • Charles E. Campbell, Jr.
    Dec 1, 2003
    • 0 Attachment
      David Fishburn wrote:

      >I have this function (from a previous posting):
      Since \= doesn't nest, I thought I'd donate a couple of maps.

      They don't work with \= in a substitute, but they will mirror-reverse
      the order of characters on the current line:

      nmap <Leader>fR :set
      'p<CR>:'p+1,'q-1j!<CR>'pdd'qddk:set nolz<CR>

      vmap <Leader>fR :<C-U>set lz<CR>:let ai=&ai<CR>:set
      'a<CR>:'a,'zj!<CR>:let &ai=ai<CR>:set nolz<CR>

      The two maps should be on one line, of course.

      To use \fR on a range of lines:

      :[range]norm \fR

      will do the trick.

      Chip Campbell
    • Show all 11 messages in this topic