Let's say I have a file like this
I want to yank abc and paste it in place of 123 and 456.
I would yi) on the first line. Then go down a line and paste it with vi)p.
But for the 456,...
So, I'm usually used to making (decently) complex mapping, and sometimes, I'd like to run mapping on very specific conditions. Let's take for example a simple premise:
long text ...
I asked a related but different question
I'm writing the
plugin that keeps a traversable history of previous visual selections. To
detect the selections, I'm using:
I'm writing what may become a plugin that needs to know what is currently
To do it, I'm using the autocmd CursorMoved event to detect the creation of
visual mode selections on the ...
Say I have a phrase
is later found at and what to delete a phrase later found, then what I do would be
In the normal mode, I put a cursor on l, and press vww. This will select from l to a of at.
I'm working on a server, that I can only SSH into via a browser. In there, I have to edit some files.
The problem is, that let's say I go to INSERT MODE and write some text.
If I then want to go back ...
This is related to better copy-paste multiple lines in visual mode where vim pastes after that visual chunk of code.
I need to be able to detect which way vim is going into visual mode so that I can ...
I want to select multiple lines in vim,
copy them, and paste after that chunk of code (with cursor at the beginning).
yp doesn't work because in visual chunk of code,
vim pastes after the 1st line of ...
I often need to edit huge .yaml files, where I need to delete entire maps or arrays.
My current approach is to go into visual (line-wise) mode (Shift + V) and mark the lines manually, but that feels ...
I would like to create a command that can automatically put an x inside a .
This command should work in both normal mode and visual mode.
If it is in normal mode, and the cursor is ...
In Vimwiki, a header level can be decreased, by pressing -.
Is there a native Vimwiki command to remove a level from all headers within a visual selection?
Keep in mind that Vimwiki supports a number ...
Let's say I have the following script:
sudo apt update
sudo apt upgrade
sudo apt install jq
sudo apt install jo
If I use the command :set makeprg=bash\ % | make inside Vim, the system will ask me my ...
My goal is to enhance the usage of gv with counts, in order to access older selections quickly. Such that 2gv would reselect the selection made before the last.
Vim doesn't have events for entering ...
If I type 2daW, I can delete the current Word and the next (though I can't really see that case covered in the manual).
Is there a way to visual-select around two words? I tried 2vaW, but of course (...
When I select a section of text within a line, then indicate I want to substitute on that line with :s, the result is that the entire line is affected.
In order to actually do what I intend, I have to ...
I'd like to remove the period between the 6th comma and the 9th comma for the multiple lines of the following texts.
I want to basically search for a pattern in the current file on another file, from vim, using the current visual selection.
I know doing:
:grep pattern otherfile
works, but i want the 'pattern' to be ...
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 ...