On Nov 15, 2:52 pm, "John Beckett" <[email protected]> wrote: > Sapfeer wrote: > > Thanks a lot! Your solution works great! I suppose I just > > misunderstood some mapping features. Could you please explain > > why you use "i" command? AFAIK, "i" stands for "insert" - I > > don't understand how can you issue yank command, then go to > > insert mode and select a word there. Also I'm confused on how > > do you go back to normal mode to move to another split > > file. > > Please bottom post on this mailing list. > > Quote a small (relevant) part of the message you are replying to, > and put your text underneath. In this case, all you needed to > quote was: > > > So for your purpose, I would use the following sequence to map: > > nnoremap <f8> yiw<C-W><C-W>@0G > > The mapping stays in normal mode for each operation. > > The mapping assumes there are two split windows, and pressing > Ctrl-W Ctrl-W (same as Ctrl-W w) moves between them. It would be > slightly more robust to use Ctrl-W p which moves to the previous > window (would work even if more than two split windows). > > You start in one window with the cursor on a number like 123. > Pressing yiw will "yank inner word", that is, copy "123" into > the unnamed register (and into register 0). See :help iw > > Typing @0 will execute the contents of register 0. Since it is > just a number, Vim regards the number as a count for the > following G which will jump to that line number. > > John
Thanks for the explanation John! It's become much clearer for me now. Thanks a lot! -- 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
