M
M
Mikhail Lebedev2020-07-15 15:09:47
vim
Mikhail Lebedev, 2020-07-15 15:09:47

Shift + i doesn't want to work in vim(terminal)?

I'm slowly moving to vim. vim is always in the terminal (so that you can do it as old school as possible and without installing an additional one)

you need to comment out the block, the manual says:
ctrl+V -> (select hjkl block) -> shift+i -> # = commented out

but I have shift+ i -> # = only the first line of the block is commented out

what am I doing wrong? (macOS catalina | vim 8.1.2229)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Linuxoid, 2020-07-23
@zaza41rus

In command mode (press Escape) I have:

  • v (small letter without shift) - select text character by character
  • V (capital letter with shift) - select text line by line
  • ctrl-v (letter v in any case with control) - select text in a block

Try it yourself first deselecting each Escape selection - you will see different effects.
To perform operations with the selected one, there are the following buttons:
  • y - copy selected text to clipboard
  • x - cut selected text to clipboard

To insert this text in the right place:
  • p (small letter without shift) - insert text after cursor
  • P (capital letter with shift) - insert text before cursor

In the same command mode (with Escape):
  • i (small letter without shift) - insert (type manually from the keyboard) text before the current character
  • I (capital letter with shift) - insert (type manually from the keyboard) text before the current line

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question