Acho que as macros são uma maneira incrível de fazer coisas incomuns se você estiver interessado em fazer isso mais de uma vez na lua azul. Digamos que você tenha a seguinte tabela:
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% S |
% o | So you can't just write your
% m |
% e | text and transform it into
% |
% M | the shape that you want
% s |
% g | Macros help here
% |
% V
E digamos que você deseja substituir Some Msgcom Other Message. Primeiro, vamos estender a tabela para o caractere extra (linha antes do último yy5p:
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% S |
% o | So you can't just write your
% m |
% e | text and transform it into
% |
% M | the shape that you want
% s |
% g | Macros help here
% |
% |
% |
% |
% |
% |
% V
A macro que eu vou criar cuidará da conversão do texto de horizontal para vertical enquanto substitui o texto antigo. Comece digitando o texto no primeiro local (o cursor está no final de Other Message):
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% SOther Message |
% o | So you can't just write your
% m |
% e | text and transform it into
% |
% M | the shape that you want
% s |
% g | Macros help here
% |
% |
% |
% |
% |
% |
% V
Registre a seguinte macro:
qq: inicia a gravação da macro denominada q
^: ir para o início da linha
3l: mova para a coluna onde o texto será colocado
x: excluir o caractere antigo
l: mova para a direita, deixando um caractere da mensagem no lugar do caractere antigo:
v: vá para o modo visual
f|: pule para |
2h: retroceder dois caracteres
d: seleção de corte
j: descer
P: colar antes do cursor
q: encerra a gravação da macro
Neste ponto, você tem:
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% O |
% other Message | So you can't just write your
% m |
% e | text and transform it into
% |
% M | the shape that you want
% s |
% g | Macros help here
% |
% |
% |
% |
% |
% |
% V
Repita a macro o número suficiente de vezes (ou seja, o número de caracteres, mas você não precisa conhecê-la com antecedência. Apenas subestime e continue depois de ver o quão perto sua estimativa estava). Então vamos com 10@q. Você obtém:
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% O |
% t | So you can't just write your
% h |
% e | text and transform it into
% r |
% | the shape that you want
% M |
% e | Macros help here
% s |
% s |
% a |
% ge |
% |
% |
% V
Ok, mais um ( @q):
%
% Not Important
% O ------------------------->
% | Stuff in side the table
% O |
% t | So you can't just write your
% h |
% e | text and transform it into
% r |
% | the shape that you want
% M |
% e | Macros help here
% s |
% s |
% a |
% g |
% e |
% |
% V
Seu cursor está agora no último e. A macro não funciona bem com a última letra (você pode tentar @qe udesfazer) para obter resultados insatisfatórios. Simplesmente ajuste você mesmo ( Xpara backspace).
:s/./% \0\r/adicionar as%novas linhas ... Mas não é uma ótima solução ...