Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual block mode does not select the entire line

Tags:

vim

windows

I have lines as below.

alt text

I am not able to select the all the lines in full. How do i do it?

I don't want to use visual line selection mode, because if i copy and paste in line selection maode, they won't start from the the same column

like image 957
chappar Avatar asked Aug 18 '10 08:08

chappar


People also ask

How do I select a specific line in Vim?

If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor. Finally, you can select text in columns by pressing ctrl+v and moving up or down the block.

How do you use visual block mode?

Place your cursor on the first character of the list item. Press Ctrl+v to enter visual block mode. The words VISUAL BLOCK will appear at the bottom of the screen. Use the Arrow keys to highlight the single character column.

How do I select chunks of code in Vim?

Press v to begin character-based visual selection, or V to select whole lines, or Ctrl-v or Ctrl-q to select a block. Move the cursor to the end of the text to be cut/copied. While selecting text, you can perform searches and other advanced movement. Press d (delete) to cut, or y (yank) to copy.


1 Answers

Pressing $ will select to the end of each line.

Also, if you :set virtualedit+=block you will be able to move the cursor past the end of the line when in visual block mode.

like image 104
mkarasek Avatar answered Sep 28 '22 00:09

mkarasek