ping wrote:
On 8/3/2012 11:00 AM, Charles Campbell wrote:
ping wrote:
folks:
I'm a newbie to vimL/vim script.
I'm trying to define my own functions and keep getting errors.
Especially I hope there is a way to quickly get the value of my var --
a way better than insert "echo var1|sleep 3" for every var that I want
to inspect.
(I use it a lot, and I need that sleep to make sure I can see the
output from the screen)

google search mentioned Decho from some thread, but it looks last
update is from 4 years ago. I'd like to hear advice from experts
before diving into it.

Try Decho v21m from my website:
http://www.drchip.org/astronaut/vim/index.html#DECHO  (last update was
Apr 18, 2012).

Regards,
Chip Campbell

thanks.
I got it installed, but is still wondering/learning how to use it for my script...is there a tutorial for newbie?

Have you had a chance to look at the manual for Decho yet? I've now put an extra section into the help, too.

There are three primary functions:

Dfunc("MyFunctionNameHere(...)") - put at the beginning of function(s)
Dret("MyFunctionNameHere ...")  - put just before return points in functions
Decho("...") - put into the body of functions (wherever you feel best)

Here's an example using debugging statements from netrw.vim:
---------
Decho Tab /home/cec/.vim/autoload/netrw.vim
---------
doing autoload/netrw.vim version v144b
netrw#LocalBrowseCheck: isdir</home/cec/.vim/VIMSCRIPT/TST/NETRW/Dir1>=1
LocalBrowseCheck
redir<ls!>:
redir<ls!>:   1 %a   "."                            line 1
redir<ls!>:   3u     "~/.vim/AsNeeded/ANtags"       line 1
redir<ls!>:   4u a-  "Decho Tab"                    line 0
ft<> b:netrw_curdir< doesn't exist> dirname</home/cec/.vim/VIMSCRIPT/TST/NETRW/Dir1> line($)=1 s:NetrwBrowse(islocal=1 dirname</home/cec/.vim/VIMSCRIPT/TST/NETRW/Dir1>) liststyle=2 v144b buf#1<.> win#1 {
|tab#1 win#1
|redir<ls!>: 3
3
4

|redir<ls!>:   1 %a   "."                            line 1
|redir<ls!>:   3u     "~/.vim/AsNeeded/ANtags"       line 1
|redir<ls!>:   4u a-  "Decho Tab"                    line 0
|s:NetrwBookHistRead() {
||sourcing .netrwbook
||sourcing .netrwhist
||return s:NetrwBookHistRead }
...

Note that s:NetrwBrowse(...) calls s:NetrwBookHistRead(), which then returns, etc. Consequently, one gets a trace of activity, and function calls are indented by "|"s as shown courtesty of Dfunc() and Dret().

Many of Decho.vim's commands control where the debugging trace is to go. By default, Decho opens a window at the bottom of the display. However, plugins sometimes can't handle extra windows, and so there are other options:

  DechoTabOn  -- debugging output will go to a new tab
  DechoRemOn -- debugging output will go to a remote gvim
  DechoMsgOn -- debugging output will use echomsg
DechoVarOn -- debugging output will go into a variable (by default, its called g:dechovar)

(there are also ...Off variants:  DechoTabOff, DechoRemOff, etc).

Enjoy!
Chip Campbell




--
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

Reply via email to