Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example for updating and adding cscope

Linwei edited this pageOct 26, 2016 ·1 revision

Modify the code below to fit your need:

function!g:CscopeDone()exec"cs add".fnameescape(g:asyncrun_text)endfuncfunction!g:CscopeUpdate(workdir, cscopeout)letl:cscopeout=fnamemodify(a:cscopeout,":p")letl:cscopeout=fnameescape(l:cscopeout)letl:workdir= (a:workdir=='')?'.' :a:workdirtry |exec"cs kill".l:cscopeout |catch |endtryexec"AsyncRun -post=call\\ g:CscopeDone()".\"-text=".l:cscopeout.""\"-cwd=".fnameescape(l:workdir)."".\"cscope -b -R -f".l:cscopeoutendfuncnoremap<F11>:call g:CscopeUpdate(".", "cscope.out")<cr>

And then you can have your F11 to update cscope files in background.

key points:

  • use-post to define a piece of vimscript which will be executed after job is finished
  • use-text to pass a text object tog:asyncrun_text when job is finished.
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp