Questions tagged [visual-block]

Visual block mode enables users to copy and paste rectangular text. This mode is useful whenever a particular text is pasted to be pasted in every part of a rectangular text.

Filter by
Sorted by
Tagged with
10
votes
1answer
657 views

Sorting a column without altering other columns

I was recently aware of the filtering ! technique, and I love it. Unfortunately, I am not able to use it in a visual-block mode. Hope some experts here would help me out. Basically, I want to in-...
4
votes
1answer
242 views

Is there a way in Vim to draw the visual area of the same size as the last visual selection, but at a new cursor position?

After I visually select the following area And press Esc and move this position I want to be able to select the same shape in this manner If there is no generic and direct way to do this, any tips ...
3
votes
3answers
1k views

How do you change the last n characters for a range of lines?

Generally you can select a visual block for the first n characters of a range of lines, and just press c, insert characters, and press Esc to have it apply to all. However, this method is rarely ...
0
votes
1answer
34 views

Visual block append does not seem to work with Inside Paragraph (ip)

If I select several lines in visual block mode and then append it works, for example: <C-v>jjj$A;<ESC> will append a semicolon to 4 lines. However if select a paragraph it does not work. ...
2
votes
2answers
59 views

Incrementing File Names

I'm hoping to create a .cl script to run in IRAF. I have a list of spectra on which I want to run dispcor. I was wondering if there's an easy way to paste the output file names with incrementing ...
9
votes
1answer
849 views

Paste visual block selection on its own lines

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. ...
2
votes
1answer
57 views

Edit width-limited comment blocks faster

Take any long comment in paragraph form: 1 // This is a comment that is really long because it is describing something 2 // worth being verbose about, possibly at the beginning of the program (...
8
votes
2answers
286 views

How I force [count]<C-x> to leave leading zeros?

Context I use vifm as my file manager (that's off topic here, i know, but keep reading) which allows me to edit filenames inside a vim buffer. One issue i found myself annoyed at are numbered files ...
6
votes
4answers
2k views

Add constant integer to visually selected numbers

I have a file like the following : two different files were yanked one after another, and the numbers subsequently don't match anymore. ... 46 atom 142 option 47 atom 143 ...
2
votes
3answers
227 views

Visual block yank to end of line

I found a vim tip a while back recommending swapping visual and visual block mode (http://howivim.com/2016/damian-conway/) For the most part this is really useful. I frequently find myself wanting to ...
10
votes
1answer
2k views

Visual block insert new line

I work a lot with visual block mode, which I find really useful for quick changes across a lot of lines. But something I'm struggling to do is inserting a newline like so: Selection is noted as []: ...
0
votes
1answer
692 views

How to paste a text block in visual block mode?

I want to paste text which spans across multiple lines and is rectangular. For example, a rectangular box representing a device topology diagram. +-------+ | | | | ...
4
votes
2answers
411 views

Vertically rotate visual block

How would one vertically rotate a visual block of text? For example given this: h e l l o Select those characters in visual block and rotate them once: o h e l l As you see, every character is ...
2
votes
2answers
90 views

Visual block. Some right-end selections seem impossible

I want to use visual block mode (ctl-v) to select all the comments but none of the code: a = 1 // short comment b = 2 // this one is a longer comment c = 3 // ...
3
votes
1answer
467 views

Can I select and edit specific positions in lines while in visual block mode?

say for example, I have this text: <div class="test1"></div> <span class="highlight"></span> <nav class="tester"></nav> <aside class="wrapper"></aside> ...
6
votes
2answers
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 ...
7
votes
2answers
3k views

Is there a command to enter Visual Block mode?

I've set up a bunch of key mappings that would cause many Vim users to cringe. Now I am unable to get into Visual Block mode using Ctrl-V (Ctrl-Q isn't mapped, but it doesn't work). Is there any ...
5
votes
1answer
523 views

Visual block editing: map i

How to map i to start editing on visual block mode? I want the same behavior for <shift>-i and i.