Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Multiline graphical table to seperate lines

I have a (very large) variable width table, something like this: 1 ----------------- 2 | 3 | 4 | | | ---- | ...
guest4308's user avatar
  • 101
0 votes
3 answers
230 views

Paste in visual block mode

I would like to copy some text into the beginning of several lines. What I have is: line 111 222 333 444 And what I want is: line line 111 line 222 line 333 line 444 I know that I can add line at ...
jeirual's user avatar
0 votes
1 answer
56 views

Yank across multiple lines with single line breaks

I can use the following to yank text inside of quotes across multiple lines, separate that text by a single new line, and be able to paste it characterwise. let @q = '' | *g/^/exe 'norm! "Qyi&...
Rob Mosher's user avatar
0 votes
3 answers
340 views

Paste in visual block mode without deleting the character under vertically multiple cursor

When I want to paste some text after selecting vertically with <C-q> It is known that Vim/gVim will replace the character under the cursor. For example, below is shown the result after pasting ...
simzz's user avatar
  • 510
1 vote
1 answer
84 views

How to yank while in visual mode without showing message?

When I'm in visual mode and I yank the selection (which has at least 3 lines), messages like these are shown: 4 lines yanked block of 4 lines yanked How can I suppress this so it won't appear in :...
Steve Ward's user avatar
5 votes
2 answers
2k views

Replacing text with a visual block

Here is what I want to do. Consider the text abcvvxyz abcvvxyz 123456 123456 I would like to copy the v block and paste it over the 45 block to get the following: abcvvxyz abcvvxyz 123vv6 123vv6 ...
January's user avatar
  • 273
0 votes
1 answer
51 views

How to paste below, not to the right nor to the left

Question I think you see the problem... How can I paste directly below? Is there a way? Setup I have this table and I want to copy/yank the 3 × | in visual block mode and then paste it: | sign | ...
Bog's user avatar
  • 519
5 votes
6 answers
1k views

Quickest way to put a single piece of text in multiple lines

Sometimes I have a bunch of lines, where there's a column clearly indicating some commonality between them, which in general doesn't go far beyond that column; this is an example, I think general ...
Enlico's user avatar
  • 2,276
3 votes
1 answer
49 views

Need a functionality behaving like Replace on text but for Pasting Blocks

One of my vim usages is to do sketches of topologies in networking I've found the script Draw it really really useful for that So I can draw things like this by pasting these boxes +------+ |ROUTER| ...
freddie_ventura's user avatar
0 votes
1 answer
34 views

Understanding interaction between visual, autoindent, and paste option

Let's start form this faulty C++ source file #include <vector> int main() { std::vector<std::vector<int>> v{ 1,2}, 9,3}, 4,2} }; } which ...
Enlico's user avatar
  • 2,276
0 votes
1 answer
868 views

How can I make backspace work in visual block mode?

I hit Ctrl-v3jShift-ixEscape, and x is correctly inserted on the current line and in the 3 lines below it in the same column. Good. I hit Ctrl-v3jShift-iBackspaceEscape a character is deleted only on ...
Enlico's user avatar
  • 2,276
3 votes
3 answers
911 views

Paste a block-copy into a single line

I need to restructure a markdown table, and for that, I wish there was a quick way to "join" lines from a multi-line cell. So with Vim, I would have to yank the block (Ctrl-v), and then ...
PlasmaBinturong's user avatar
0 votes
1 answer
479 views

How to delete and replace a block of text with spaces?

What I want to do I want to select a block of text in Vim, delete it, and replace the selected block with spaces. Example Suppose I have the following text: Lorem ipsum dolor sit amet, ...
jvriesem's user avatar
  • 131
6 votes
1 answer
1k views

Paste a block in "replace" mode

This is best explained with an example: Start by block selecting some text: Yank and paste it somewhere else: Note that the existing x characters were pushed over to the side, rather than being ...
Jonah's user avatar
  • 753
2 votes
1 answer
85 views

How does p really works as related to content put in registers?

I've read this question and answer already, however it could not solve my doubts. As far as my understanding is correct, p always has the same effect (putting the content of a register, by default ...
Enlico's user avatar
  • 2,276
3 votes
1 answer
287 views

Pasting modified register contents into Visual Block selection

Consider this mapping: vnoremap <leader>U ygv"=toupper(@@)<cr>p It will yank the current visual selection, select it back, and then put a modified version of it. In this case, uppercase ...
filbranden's user avatar
  • 29.9k
0 votes
3 answers
2k views

Is it possible to yank a column of text in vim without visual block mode?

Consider the following text file. 1 1 3 1 1 5 One can rank row 1 with the command y$ with the cursor on row 1, column 1. However, to yank the first column, the only way I know is to <C-v>3jy. ...
merlin2011's user avatar
0 votes
0 answers
225 views

Blockwise pasting from "+ register not working

UPDATE: I run an X server (XQuartz 2.7.11) on MacOS, which I forward via ssh to any Linux machine I use. The problem seems to be that under XQuartz, the "+ register does not support blockwise yanking/...
Anders Lundstedt's user avatar
3 votes
2 answers
734 views

The meaning of "= in Vim

I was solving a problem on Vimgolf (you can take a look at this) where I stumbled upon this solution. djgJ.V"=[<C-R><C-A>]<CR>pZZ Could you please walk me through the meaning of ...
reFORtEM's user avatar
  • 133
1 vote
0 answers
42 views

Yanking a visual block with word wrap enabled is shifted

Say I have a file with the following contents (on a single line): Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed augue ligula, venenatis et orci non, convallis congue nunc. Nam eleifend ...
sudo make install's user avatar
13 votes
2 answers
2k views

How to paste visual block starting with another line

It took me very long time to realize that putting (pasting) something with p or P which visual-block selects with ctrl+v and yanked (copied) with y, preserves the manner before, so that, when the ...
Violapterin's user avatar
16 votes
1 answer
2k views

Paste visual block selection on its own lines [duplicate]

I'm not really sure how to describe what I'd like to do. Basically I'd like to use visual block mode to select a region of text and then paste it "as a collection of lines" rather than as a rectangle. ...
Greg Nisbet's user avatar
  • 1,899
6 votes
3 answers
1k views

Insert a text selected via visual block

I'm facing a behavior that I find unatural when trying to paste a block of text selected with visual block mode (<C-v>): I can't insert it between two lines without messing with the already ...
statox's user avatar
  • 50.5k