Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [async]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
206 views

How to async run vimscript system calls

I have a vimscript function which uses a combination of vimscript functions and also some calls to :call system(). The vimscript and the system() calls can be 5-10 seconds slow, during which time, Vim ...
user avatar
2 votes
0 answers
47 views

Neovim rplugin: why does vim.async_call(print, "msg") not echo?

In a traditional :python3 plugin, I can call print("msg") to echo a message. In a remote plugin function, I expect that calling vim.async_call(print, "msg") would do the same thing,...
user avatar
1 vote
1 answer
205 views

Neovim: How to start developing python plugins which run long-blocking code?

EDIT2: A user suggested that I may be going about this in a fundamentally wrong way, in particular in that I am not using remote (new-style) plugins and am trying to use async python code where it ...
user avatar
0 votes
1 answer
237 views

Simple Asynchronous function call in Neovim (defer_fn or timer_start ?)

I'm trying to create a very simple shortcut that saves the buffer and cleans the writing message after a second. nmap <silent> <leader>w :w<CR>:sleep 1<CR>:echo ""<...
user avatar
2 votes
1 answer
350 views

What is the proper way to use the async mechanism: timer_start

I just started to use Vim 8 and I'm trying to figure out how to use the async mechanism: timer_start. As my understanding, timer_start allows us to run a job asynchronously and repeatly. I have two ...
user avatar
  • 873
1 vote
1 answer
385 views

Vim Script: How to pass Varargs to a lambda in timer_start

I'm configuring my vim with Vim Script. I have set my own custom grep function as below: function! CustomGrepCore(...) if a:0 == 0 " do something else if a:0 == 1 " ...
user avatar
  • 873
4 votes
2 answers
2k views

How to start an async function in Vim 8

I've known that Vim 8 provides us an async mechanism job_start so that we can start a command asynchronously and get its return with the help of channel. However, it seems that job_start can only ...
user avatar
  • 873
6 votes
2 answers
4k views

Running a command Async in Neovim

As far as I know, neovim enables running a command async, without blocking the user. This is also enabled in vim8 I was told. But I couldn't find examples of how to run a command asyncly. Suppose ...
user avatar
  • 205
1 vote
1 answer
277 views

How to pass a string as stdin to a job?

I have a shell command which reads from stdin, processes the input, and writes to stdout. To call it synchronously from vim I can do system('mycommand', data) where data is some string my vimscript ...
user avatar
  • 1,013
3 votes
1 answer
623 views

Can't echo messages from inside async functions

CASE 1: Have your autocmd command be setup like this: autocmd User ALELintPost call SayHello() " ALELintPost is async And your SayHello function set up like this function! SayHello() abort ...
user avatar
3 votes
1 answer
360 views

How to use "FocusGained" to stop my cursor from moving

I tend to use GVim a lot. Very frequently, I'll click on some other window and then when I click on vim to regain focus, my cursor will end up in some random location depending on where I clicked. I ...
user avatar
  • 16.5k
4 votes
2 answers
668 views

How to build nvim to has_perl?

I am on macOS. My ultimate goal is to speed up dbext.vim and I found the page mentioned DBI which depends on has('perl'). So I'd like to know how to build Neovim to have Perl enabled... Now I am ...
user avatar
  • 432
3 votes
1 answer
1k views

How to get git branch information supplied by vim-fugitive asynchronously for my statusline?

I can directly use the following approach to get the git branch information: ... let l:git = "%6*%{exists('g:loaded_fugitive')?fugitive#statusline():''}%*" ... If so, it can cause a delay to the ...
user avatar
  • 140
0 votes
2 answers
152 views

How to execute global/substitution command asynchronously?

With the release of vim 8, I was wondering if there is a way to execute :s or :g asynchronously.
user avatar
  • 13
4 votes
0 answers
60 views

Is there an ideal / idiomatic way to debug running plugins?

I sometimes have plugs stop working — in my case, mostly using async lookups with Unite. When this happens, I would like to see what is happening and look into how to configure around it, or make a ...
user avatar
1 vote
1 answer
62 views

async_job patch in Kaoryia's gVim (windows)

Kaoryia's gVim builds for Win32/64 come with a number of extra, non-official patches enabled. Some of them are pretty clear: :set charspace=-1, for example, will tighten the space between characters;...
user avatar
  • 9,260