1
vote
1answer
150 views

Python: select logical code blocks with VIM

How does one select logically indented code blocks with VIM? For instance, consider this bit of Python: 01:class Foo(object): 02: 03: def __init__(self, bar): 04: 05: if 'baz' in bar: 06: ...
1
vote
2answers
200 views

How to create and run a macro that runs on current visual selection?

I'd like to create a macro so that if I select a piece of text (either by a keyboard or a mouse) and invoke this macro, it adds [b] and [/b] around the text (for example). I'm familiar with recording ...
1
vote
1answer
141 views

How to make vim highlight the last character of a visual selection?

I want to use _ as my terminal cursor (konsole/gnome-terminal). However because of this, using visual block selection in Vim becomes a problem, as Vim does not highlight the character under cursor as ...
1
vote
2answers
711 views

Copy visual mode selection below selection in vi

In vim, I often find myself repeating the same steps to copy a section before making changes to it: V to start Visual mode linewise j until I have selected the section I want to copy y to yank the ...
4
votes
3answers
419 views

Vim - How to select a whole HTML block, including the tags?

Suppose I have: <div id="help"> <table> ... ... ... </table> </div> How do I select the whole block, starting from <div id="help">, in ...
6
votes
4answers
3k views

tmux copy mode - select text block

I'm using tmux with vi keys, and copy/paste works fine as long as you're selecting one line of text, or if you have only one window. When I want to select a block of text (multiple lines, but not full ...
2
votes
1answer
159 views

vim: select the current indents lines

in vim, how I can selected the lines with the same indent, example if true: line 1 line 2 ... line n if the cursor is over line 2, how I can selected from line 1 to line n?
5
votes
1answer
184 views

How do I select the comment block under the cursor in vim?

I’d like to select (or delete, or change, or …) the whole block of commentary under my cursor. If my cursor is at the beginning of the commentary block (i.e. over the opening comment character), and ...
2
votes
1answer
249 views

How to paste primary selection into Vim?

I use the middle-click, or CTRL-SHIFT-V to paste indented selection into Vim: <a> <b> <c> </a> I have tried to :set nosmartindent :set nosmarttab It's used to ...
20
votes
4answers
2k views

Vim - select text highlighted by search?

In vim, I often perform searches to hop to a word or phrase instead of navigating there with h/j/k/l. Then I hit n to hop between occurrences. Say I've got this text: Time flies like an arrow; fruit ...
8
votes
1answer
3k views

How to select a rectangular range in VIM?

Assuming I have a text like abc121313131abc abc13153545464abc abc4325435345abc abc343535353535353abc I want to select the abcs in front of the 4 lines.How can I do this?
21
votes
1answer
2k views

How can I select an html tag's content in Vim?

Is it possible to select an html tag's content in Vim? For example: <p>I am a silly butterfly</p> I would like to select "I am a silly butterfly"! I know that you can use vi" to select ...
12
votes
3answers
2k views

Vim visual mode, stay selected

I love vim's visual mode. However when I select some text then do something to it the text is then unselected. For example lets say that I select a block of code and indent it the code is then ...