趣说北京老北京人怎么过春节?
百度 问:今年征兵的征集对象有哪些规定? 答:征集的男性公民,为高中(含职高、中专、技校)毕业以上文化程度的青年,重点做好大学生征集工作。
Question about text object motions
45 questions
3
votes
2
answers
174
views
LaTeX sentence text object
I use Neovim, and the doc says:
A sentence is defined as ending at a ., ! or ? followed by either the end of a line, or by a space or tab.
However, this does not meet my needs. I write LaTeX code ...
3
votes
4
answers
537
views
Delete text from the end of a line in one action
Let's say we wanted to delete two backslashes at the end of this line (and a few similar-looking lines) in Vim:
{Hello World}\\
Ideally we'd delete them with a single, simple, idiomatic action which ...
1
vote
2
answers
85
views
Defining custom motions to be used with operators?
For instance, I want to press an operator like yank change or delete, followed a macro that triggers :HopWord from hop.nvim which puts hints on words, I select a hint to navigate that word, then ...
1
vote
2
answers
61
views
Motions for selecting code statements?
Let's say I have a line of lua like this:
vim.keymap.set("n", "<D-BS>", function() vim.cmd(":!trash '%'") vim.cmd("bprev|bd#") end)
How could I select ...
1
vote
1
answer
44
views
Use textobject selection with nnoremap
I hope this is not an XY problem, but I need the following thing: I have parameterized markdown fences (in vimwiki), i.e:
```c
int a = 5;
printf("%d", 5 <++>)
```
So my idea is when ...
1
vote
1
answer
99
views
Setting change/visual marks with empty inner motion in custom text objects
This has been discussed on Vim’s issue tracker.
By default for the default builtin motions where the 'indside' of a text object is empty - such as double quote (say we have the following text "&...
0
votes
1
answer
71
views
Motions for moving to the middle of text objects like words, lines and paragraphs?
I can use 0 and $ to move to the start and end of the line, and w and b to move between words, but what about moving to the middle of words and lines?
1
vote
0
answers
63
views
Paragraph motions in single-line buffer
This question looks at how paragraph motions behave when the buffer consists of only two lines. But what if the buffer has just one line?
Both { and } move the cursor to the last character of the line,...
4
votes
1
answer
127
views
Why doesn't Vim recognize a pair of <\> as a single unit?
I'm kind of confused about why doesn't Vim accept di> operation on this piece of text:
<This is a random text but has a backslash at the end\>
but rather does on this:
<This is a text with ...
2
votes
1
answer
179
views
Make { ( and ) } normal mode motions skip blank lines
Normal mode ) } and ( { navigate paragraphs and lines but they don't skip blank lines. (They land on them.)
This is obviously the preferable behavior when writing code, but when writing "normal&...
3
votes
1
answer
112
views
The default behavior of "di("
As is well known, di( deletes the contents inside a () block. When the cursor is not within a group of (), the cursor jumps to the near () group and delete the contents in it.
Is there any way to ...
1
vote
2
answers
459
views
Difference between dap and dip (and inner paragraph)
I have memorized dip as the command to delete a paragraph. However, I now see that dap is also a thing.
The docs say:
"dip" delete inner paragraph
"dap" delete a paragraph
...
0
votes
2
answers
5k
views
How to create a lua function that gets called for a vim (neovim) motion
Vim has the concept of actions, which can act on text objects via motions.
For example diw will delete (the action) the inner word (the motion).
I want to create a function that can be applied/...
5
votes
1
answer
488
views
delete from current position to end of paragraph when using hard wrap
i use hard wrap (in my vimrc: setl fo+=atw).
I often want to delete from the middle of some row to the end of the paragraph. I do this as follows: d$, j (down one line), 5dd (if there are 5 subsequent ...
0
votes
1
answer
61
views
How to select a whole line except beginning tab/space and last enter?
I'm dealing with the following text and want to select "abc def":
123
abc def
456_4
I've tried viw but it can only select a whole word isolated by spaces, and v$ starting with ...