5
votes
Accepted
How do I play a macro, but *slowly* (for debugging a macro)
You may be able to set the 'writedelay' option. This will delay refreshing the screen by the given number of milliseconds.
So try :set writedelay=50 and run your macro.
Note, that if you use ...
4
votes
How do I play a macro, but *slowly* (for debugging a macro)
What you could do to achieve something like this is to convert your macro into another one that introduce 1 second delay between the operation using the 1gs operation or if in insert mode ^o1gs
e.g.:
...
3
votes
Delay inside Macro - Is It Possible in Vim Macros to Create a Delay Between Commands?
You can use the gs command to introduce a delay. This command can be prefixed with a count to specify the number of seconds. Refer to the help page for more information. For example, to introduce a ...
2
votes
How to get floating result in expression register?
If instead of registers you used variables, you could make them floats directly:
:let h = 22.0
:let f = 4.0
…
=h/f
Or, you could "coerce" them:
:let h = 22
:let f = 4
…
=(h + 0.0)/f
With ...
2
votes
How to get floating result in expression register?
The content of a register is either a string or a list. In this case, both @h and @f are strings so you leave the coercion to :h expr-/, which takes the shortest path possible because there is no ...
1
vote
Macros on lines with different structures
I would have the following macro:
/\v(,|.})^Ma^M^[
And I would call it repeatedly.
Where:
^M stands for Enter and
^[ stands for Esc
1
vote
Accepted
Delay inside Macro - Is It Possible in Vim Macros to Create a Delay Between Commands?
To address your requirement of being able to read the output, I'd move the delay into the shell command:
:let @p = "0D:!ping -c1 8.8.8.8 ; sleep 1\<CR>iJust pinged a DNS Server\<Esc>&...
1
vote
Accepted
Repeat many times without macro?
I think you are confusing "macro" and "recording", here. The result of a recording is indeed a macro, but the RHS of a mapping and the argument of :normal are also macros.
:normal ...
1
vote
How to get floating result in expression register?
I would use the str2float function.
printf("%f", str2float(@h)/str2float(@f))
Vim converts string into number when doing arithmetic but assuming strings are integers. If you want Vim to ...
1
vote
in-place replacement of code in HTML documents with TOhtml?
OK, I need to think about something else than freaking Magento.
Pandoc would help with the first step but the rest can be done with pure Vim commands…
Tell :help :TOhtml to only generate fragments:
:...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
macro × 181register × 18
key-bindings × 15
repeated-commands × 14
vimscript × 13
vimrc × 11
regular-expression × 11
substitute × 9
replace × 8
neovim × 7
search × 6
command-line × 6
buffers × 6
visual-mode × 6
functions × 6
cut-copy-paste × 5
normal-mode × 5
cursor-movement × 4
ex-mode × 4
text-generation × 4
vscode × 4
terminal × 3
cursor-motions × 3
count × 3
syntax-highlighting × 2