Answer the question
In order to leave comments, you need to log in
How to parenthesize text in vim-e
Hello.
There is this text:
NAME_1 : "Some name",
VALUE_1 : "Some value",
NAME_2 : "Some name2",
VALUE_2 : "Some value2"
1 : {
NAME: "Some name",
VALUE: "Some value"
},
2 : {
NAME : "Some name2",
VALUE: "Some value2"
}
Answer the question
In order to leave comments, you need to log in
I would do it in the form of a macro that formats two lines. for example, for example, like this (cursor in the first column of the first line):
1) switch to the recording mode of the macro "a": qa
2) format with handles, for example like this: f_xdwO^C^Cpi: {^C^CjV>jV>f_xdwA< 80>kb^M},^C^Cj0
(^C^C is , or , <80> is a key (well, or replace it with ^C^CX), ^M - )
3) finish recording the macro: q
Now, if we have 100 lines that need to be converted into 50 records, we do [email protected] and rejoice
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question