Questions tagged [selection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
72 views

How to multi select for the purpose of copy operation?

I can do a search to highlight multiple unrelated words that exist with: /word1\|word2\|word3 But this is only search, it is not "select" (for copy and paste operation) How to highlight ...
1
vote
2answers
22 views

How to move selected lines up and down? [duplicate]

Is it possible to move selected lines up and down? c = 3 a = 1 b = 2 I would like to select second and third lines and move them one line up, so that result be: a = 1 b = 2 c = 3 I know that > ...
2
votes
1answer
54 views

Can you do a jagged visual selection or jagged yank?

given some text like sadf_blahbalh_sdf sadf_abc_zzz asdf_yx_sdf and I want to block select from the 'b' of blah down to the 'y' of yx and then, for every line extend the select to the _ using ...
-1
votes
2answers
43 views

How to grow/shrink a selection per tab?

How to have a selection grow/shrink as we tabulate, regardless of cursor position ? The selection can span more than one line. Kind of like this: For the tabbing I've got this part so far: xnoremap &...
0
votes
0answers
20 views

Key combination to delete without copying to clipboard/register ? (General) [duplicate]

What's the command/option/keys/function that performs a delete on a selection (in visual mode) without copying the selection to clipboard/register? I.e I don't want to use d or x as they will delete ...
3
votes
3answers
1k views

Select multiple words, one at a time, then replace them all

Goal: Select multiple words, one at a time, then replace them all. I'm new to Vim; I come from Visual Studio. I would like to achieve one important feature that helped me a lot in my productivity: ...
0
votes
0answers
58 views

Remapping Esc + A and Esc + D to Alt + A and Alt + D?

I'm using xfce4-terminal version 0.8.9.2. I have installed FZF.vim plugin and whenever I do either an :FZF search or an :Rg search in vim, I cannot select all the matches with Alt + a or deselect all ...
1
vote
1answer
89 views

How to perform an action on search matches?

How can I visually select all text highlighted by a search in order to run a command on it? And if it's possible, how can I capitalize the selection?
3
votes
3answers
118 views

How can I indent selected lines in Visual mode by space granularity instead of TABs?

How can I indent lines selected in Visual mode using space granularity instead of than TABs (i.e. < or >)? Sometimes when coding Python, I need to indent lines to a level that is not a TAB ...
0
votes
1answer
68 views

gvim swaping between underline and normal visual text selection in visual mode

I'm having a weird issue running gvim 8.2.1081 on fedora 32 using kde. When selecting text in visual mode gvim keeps swapping between an underline and the expected visual text selection while moving ...
2
votes
3answers
63 views

Visually select consecutive lines with the same starting string

This is mainly for working on multiple files in vifm (log1.txt, log2.txt, etc.) so lines can be assumed to be sorted, though this should work in normal vim/nvim. Let's say we have this: test 1 test 2 ...
2
votes
1answer
51 views

Put cursor at arbitrary line and column

Normal, insert, and visual modes restrict cursor movements to locations occupied by some characters. They don't allow moving to the right from the end of line and down beyond end of file. For example:...
1
vote
1answer
42 views

Is it possible to ignore J if only one line is selected?

Today I made a macro that involved selecting a few lines to join. The problem was that sometimes I only selected parts of one line and in this case two lines was still joined with J. Is it possible to ...
0
votes
1answer
111 views

Select text in block-wise visual mode on each line asynchronously

If I have text like this: cat = "john" leopard = "frank" tiger = "josh" and I want to select the first word of each line in block-wise visual mode, I want to be able to do something like this: put ...
3
votes
1answer
26 views

How to line-select a block within a back-ticked string

I've got the following code 1 const unrelated = 3; 2 3 const XYZ = styled.div` 4 display: inline-block; 5 position: absolute; 6 7 margin: auto; 8 `; 9 10 const unrelated2 = 6; With my ...
1
vote
3answers
65 views

Selector for line of text?

To grab a full word from anywhere in the word I can do: viw And to grab an entire line from start to finish I can do: V However, is there a section that grabs all text from the first char to the ...
2
votes
3answers
41 views

How to do multiline non-rectangular deletion?

Here is a problem I am able to solve in Sublime in seconds but has me stumped in Vim: Given text like this: bob@bobshop.com Bob Potato peter@petershop.co.uk Peter Carrot thomas.cucumber@thomasstore....
2
votes
1answer
50 views

How to re-select a previously selected region in visual mode?

I often select a region in visual mode for properly indenting it. However, after pressing e.g. 3>, visual mode exists and the selection disappears. How can I re-select the previously selected ...
1
vote
0answers
54 views

Expanding region/selection for javascript

is there a way to configure https://github.com/terryma/vim-expand-region (or any other plugin) to work with js,jsx,ts,tsx files? I'm new to vim, I'm not sure what to do. The mentioned plugin is not ...
0
votes
1answer
106 views

Gradient color background for visual selections

In this video from Bisqwit, the selected line is colored by a gradient according to column number. Image is below. He implemented the gradient in a custom terminal emulator. Is there any way to ...
1
vote
4answers
47 views

How to end selection at an occurrence of a word?

Let's say I have this text with | as my cursor: <<<<<<< HEAD hi ======= hello ====== >>>>>> XXXX GGg| Now, I'd like to select from >>>> to say second=== or ...
1
vote
1answer
84 views

vim - how do I cut some lines of file-1 to file-2 in 1 step?

When I need to cut some lines from one file to another file, I always do the following steps: Select the lines in file-1 :w >> file-2 Re-select the lines d This is super annoying if you need ...
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 ...
1
vote
2answers
535 views

How to vertically-block-select words of different length?

With other editors we can select vertical-blocks where each line has the same start column but not the same end-column. For example: print("", s.field1); print("", s.field_long); print("", s.f); ...