How do I yank text from one position to another position within a line, without yanking the entire line?

You can specify a motion command with the yank operator (y) to yank text from one position to another position within a line. For example, to yank from the current cursor position till the next letter x, use yfx or Fx or tx or Tx. To yank till the nth column, use n|. To yank till the next occurrence of a ‘word’, use /word. To do a yank till the nth column on another line, first mark the position using the ‘ma’ command, go to the start of the yank position, and then yank till the mark using y`a (note the direction of the quote)

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind