You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a vim anti-pattern, but I think it could still be very useful:
Imagine writing a bullet-list in a Markdown-document. You write a few bullet-points. When going to a new line by hitting enter the document looks like this:
- Some previous text
- | # <- this is my cursor now
Now you jump to a different location in the document, jump back to the bullet-list and (still in normal-mode) insert a new line to add another bullet point. In regular vim-fashion you hit o to insert a new line. The Markdown-document now looks like this:
- Some previous text
| # <- this is my cursor now
Wouldn't it be great, if o also inserted the dash? Basically o should be equivalent to A<CR> (go to end of line, enter insert mode, add new line). When I manually execute the sequence I get the desired behavior. However mapping the sequence to o just behaves as before.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This might be a vim anti-pattern, but I think it could still be very useful:
Imagine writing a bullet-list in a Markdown-document. You write a few bullet-points. When going to a new line by hitting enter the document looks like this:
Now you jump to a different location in the document, jump back to the bullet-list and (still in normal-mode) insert a new line to add another bullet point. In regular vim-fashion you hit
o
to insert a new line. The Markdown-document now looks like this:- Some previous text | # <- this is my cursor now
Wouldn't it be great, if
o
also inserted the dash? Basicallyo
should be equivalent toA<CR>
(go to end of line, enter insert mode, add new line). When I manually execute the sequence I get the desired behavior. However mapping the sequence too
just behaves as before.Why does that not work as expected?
Beta Was this translation helpful? Give feedback.
All reactions