How use sleep in vimscript just for command-line bar?

mo1ein

I'm trying to write a plugin for vim with vimscript and I want to show some log for specefic time. like:

echo 'some log'
sleep 2
redraw!

When I use sleep and redraw, all of current window freezing for a while but I want sleep just for logs, not all vim window!
How can I do that?

okket

sleep will always block. With VIM version 8 you can use timer instead. Here is a stripped down example should not block VIM:

echo 'some log'
let timer = timer_start(2000, 'LogTrigger',{'repeat':-1})
func! LogTrigger(timer)
  silent! redraw!
endfunc

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How use sleep in vimscript just for command-line bar?

From Dev

How to interact with an external command in vimscript?

From Dev

How to use "\" not as a command but just as a text in a string

From Dev

How to temporarily disable sleep and hibernate from the command line

From Dev

How to temporarily disable sleep and hibernate from the command line

From Dev

vi: how to use a line as a command?

From Dev

How to use a proxy on the command line?

From Dev

How to use this command line in Ubuntu

From Dev

how to use printf on the command line?

From Dev

how to insert new line in vimscript substitiute function

From Dev

How to get JUST the Elasticsearch server version from the command line

From Dev

How can I install just security updates from the command line?

From Dev

How do you whitelist an IP address with just one line command?

From Dev

How to compute/check bash comparison expression just in command line?

From Dev

How to use a (copy) command with a (progress bar) script

From Dev

How to use the axis command with semilogy bar plots

From Dev

vimscript delete whole line or word in command mode (q:)

From Dev

How to use knitr from command line with Rscript and command line argument?

From Dev

Vimscript: How to use a parameter with a function that uses read?

From Dev

Do I have to use a Git software or it's ok to use just the command line?

From Dev

How to use "FLAGS" (command line switches) in TensorFlow?

From Dev

How to use paket from command line

From Dev

How to store command line arguments for future use?

From Dev

How to use ImageMagick command line on Windows?

From Dev

How to use environment modules in a ssh command line?

From Dev

How to use kapt from command line (with kotlinc)?

From Dev

How to use command line completion in Midnight Commander?

From Dev

How to use setvcpus from libvirt command line?

From Dev

How to use command line to change brightness and color?

Related Related

  1. 1

    How use sleep in vimscript just for command-line bar?

  2. 2

    How to interact with an external command in vimscript?

  3. 3

    How to use "\" not as a command but just as a text in a string

  4. 4

    How to temporarily disable sleep and hibernate from the command line

  5. 5

    How to temporarily disable sleep and hibernate from the command line

  6. 6

    vi: how to use a line as a command?

  7. 7

    How to use a proxy on the command line?

  8. 8

    How to use this command line in Ubuntu

  9. 9

    how to use printf on the command line?

  10. 10

    how to insert new line in vimscript substitiute function

  11. 11

    How to get JUST the Elasticsearch server version from the command line

  12. 12

    How can I install just security updates from the command line?

  13. 13

    How do you whitelist an IP address with just one line command?

  14. 14

    How to compute/check bash comparison expression just in command line?

  15. 15

    How to use a (copy) command with a (progress bar) script

  16. 16

    How to use the axis command with semilogy bar plots

  17. 17

    vimscript delete whole line or word in command mode (q:)

  18. 18

    How to use knitr from command line with Rscript and command line argument?

  19. 19

    Vimscript: How to use a parameter with a function that uses read?

  20. 20

    Do I have to use a Git software or it's ok to use just the command line?

  21. 21

    How to use "FLAGS" (command line switches) in TensorFlow?

  22. 22

    How to use paket from command line

  23. 23

    How to store command line arguments for future use?

  24. 24

    How to use ImageMagick command line on Windows?

  25. 25

    How to use environment modules in a ssh command line?

  26. 26

    How to use kapt from command line (with kotlinc)?

  27. 27

    How to use command line completion in Midnight Commander?

  28. 28

    How to use setvcpus from libvirt command line?

  29. 29

    How to use command line to change brightness and color?

HotTag

Archive