Questions tagged [visual-mode]

Visual mode is a flexible and easy way to select a piece of text for an operator.

13 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
34 views

How to copy text to X primary selection only when visual mode is started with the mouse?

At the moment, if I use Visual mode, whenever I select a block of text using the keyboard it ends up on my X primary selection (ie the clipboard that is filled using the mouse). Even if I just select ...
3
votes
0answers
31 views

Keep function “keyword = arguments” together when reformatting across multiple lines using “gq”?

One thing I find myself doing often is using visual mode to select a block containing a long function definition containing one or more keyword arguments, and then using gq to reformat the code across ...
2
votes
0answers
33 views

Do operator ranges/movements/textobjects always overwrite the last visual selection? workaround?

In vim, when I operate on a textobject from a plugin, say the 'inner indent' typed ii from kana/vim-textobj-indent, my last visual selection ('>, '<) is reset to where the operator worked on. ...
2
votes
1answer
814 views

CTRL-A with visual mode not working

According to the Vim help, using g CTRL-A with visual mode should change several lines in A to that in B: A: 1. 1. 1. 1. B: 1. 2. 3. 4. In my Vim, the CTRL-A is working in ...
1
vote
0answers
25 views

How can I repeat a custom function mapped using `vnoremap` using something similar to the dot (`.`) operator?

I have this custom function in my ~/.vimrc mapped to Visual mode using vnoremap. After having executed the function using <leader><space>, how execute it again using something similar to ...
1
vote
0answers
130 views

How to use visual mode in python/dyn?

Vim documentation states how to run command and normal mode commands (source): vim.command(str) python-command Executes the vim (ex-mode) command str. ...
0
votes
0answers
22 views

How to read the starting/ending line number of my visual selection?

So what I would like to achieve is when I selected a block of texts using shift-v, is it possible to read the starting and ending lines' line number within command mode? (Something like we could read ...
0
votes
0answers
22 views

How can I stop vim from automatically entering visual mode when I click into the PuTTY window with my mouse?

I suspect this is the same in vim as well, but fwiw I'm actually using nvim. For a long time I've used set mouse=a so I can choose to navigate my file with the mouse, if I so wish. What I've never ...
0
votes
0answers
89 views

How to start insert-mode completion from select mode using Vimscript?

I have some text selected in select mode. I want to delete it and start insert-mode completion. When I type these keystrokes into Vim it works perfectly: gvc<C-X><C-U> gv switches to ...
0
votes
1answer
310 views

Visual block mode insert/append not working in vim on RHEL/CentOS?

I was trying to append some text to multiple lines in vi on a RHEL 6 system, however I could not get it to work. I press Control + V to get into visual block mode, select the lines I need, but when I ...
0
votes
0answers
35 views

Select characters in Visual mode (works differently than Normal mode)

I'm trying to understand the difference in character counting between Normal and Visual modes. Roses are red, Violets are blue, Sugar is sweet, And so are you. The task is to copy everything from ...
0
votes
0answers
162 views

Why doesn't select mode appear in the status line?

Regardless of the mode I select, it appears on the status line. But when I switch to select mode, it is not shown on the status line in Vim, whereas it is shown in gVim. How do I make it work?
-1
votes
1answer
47 views

how to move to the end of a string / beginning of string for a macro

i want to write a makro and need to know how i can move to the end and to the beginning of a string, respektively i want to visually select the link so that i can surround it with brackets. my line ...