Is there a way to make it so that
This is a header
=<tab>
converts into
This is a header
================
in all files who filetype is markdown?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityLikely it can be done with =TAB, but another approach is:
=
.Then You can create a macro or an imap
or nmap
for it.
Another approach is (after typing your header and getting back to normal mode is: :t.|s/./=/g
(ex mode copy line bellow and replace every character on it with =
.
:t.|s/./=/g
or your other method to the =<tab>
action?
Jun 16, 2017 at 0:26
You could do it this way:
This is a header
=
On the line with =
type:
<ESC>Vly5p
V
puts vim into visual mode.l
(letter l) moves the cursor to the left.y
copies the =
.5
is the number of =
s you want.p
inserts the =
s.