In NeoVim, I usually do something like dt; to delete from the cursor until the first ; in the line.
I want to do this but for a column of cursors in visual select mode.
How do I do that?
In NeoVim, I usually do something like dt; to delete from the cursor until the first ; in the line.
I want to do this but for a column of cursors in visual select mode.
How do I do that?
@aratinga visual block or visual line? Does the selection include the ;? Is the ; in a different column on every line?
@annika visual line, no, no
Unaligned:
hello; tgere
foo; bar
yesthatis;fine
Select the first column of every line, run a "normal mode" command on each line:
<C-v>G:norm dt;
Aligned, I would probably use visual block rather than visual line:
one;two
thr;fou
fiv;six
Enter visual block, motion to ;, move down 2 lines, delete selection
<C-v>t;2jx
@annika But would also be helpful to know what it is for unaligned ;'s
@annika I forgot to mention the cursor is middle of the line. I want to select every o and delete until the ; in each line
@aratinga i think the :norm works but I would usually line-select the range and use :s to regex-replace over that range. I'm not sure it's easy to map commands with movement over a selection :blobthinkingcool: i hope you get a better answer!
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.