On Jul 7, 8:39 pm, pansz <pan.shi...@gmail.com> wrote: > For debug reason we often need to print the current script name, > function name and line number. > > suppose vim script is a program, is it possible to get the current > script name and the current execution line in vim script? is there any > functions of macros to get them?
<sfile> and <slnum> will give you __FILE__ and __LINE__. I don't think there's a __FUNCTION__ but I could be wrong. IIUC you use them inside expand(), like: echomsg expand("<sfile>") "on line" expand("<slnum>") -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php