Giter Site home page Giter Site logo

decho's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=120

The Decho.vim plugin provides debugging messages in a separate window.  One puts

    Decho "some message here"
-or-
    call Decho("another message")

and Decho will split the screen with a five line debugging window on the bottom of the display where the messages will appear.  Allows one to inspect multiple error messages with the usual vim editing commands!

To better support the debugging of scripts, Decho.vim also provides:

    call Dfunc("YourFunctionName([arg1<".a:arg1."> arg2<".a:arg2.">])")
    call Dret("YourFunctionName [returnvalue]")

These two functions use Decho(), but also provide function tracking.  The .vim/syntax/Decho.vim provides special highlighting for the DBG buffer, too.  See the example below!

One may redirect the output of arbitrary vim commands to the DBG buffer with the following function:

    call Dredir("command")

For example, consider

	call Dredir("ls")

Decho.vim makes it easy to turn debugging on and off in your scripts:

    Turning Debugging On:
        vim yourscript.vim
        :DechoOn
        :wq

    Turning Debugging Off:
        vim yourscript.vim
        :DechoOff
        :wq

Some plugins use events such as WinEnter and others attempt to control window layout.  Decho supports these plugins with four methods to avoid disturbing the display:

	DechoMsgOn  -- subsequent debugging output uses :echomsg
	DechoRemOn  -- subsequent debugging output goes to a remote gvim which DechoRemOn will set up itself
        DechoTabOn  -- subsequent debugging output goes to a separate debugging tab/window
	DechoVarOn  -- subsequent debugging output goes to a variable (default value: g:dechovar)

With any of these enabled, subsequent Dfunc, Dret, Decho, and Dredir output will be directed as indicated.

 ---------------------------------------------------------------------
Example:

    LocalBrowse(dirname<.>) {
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |dirname</home>
    |Perform directory listing...
    |bufnr(dirname</home>)=1
    |dirnamenr=1 dirname</home> pre-exists
    |changed directory to</home>
    |buffer already exists, but needs listing (buf#1)
    |Setting up local browser maps
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |NetGetcwd() {
    ||return NetGetcwd /home/cec/.vim/VIMSCRIPT/ }
    |set up banner
    |directories will be sorted by name
    |LocalBrowseList(dirname</home>) {
    |(elided for brevity)
    ||return LocalBrowseList }
    |SetSort() bannercnt=8 {
    |(elided for brevity)
    ||return SetSort }
    |NetSort() {
    ||return NetSort }
    |return LocalBrowse : file</home> }

(alpha/beta version available at http://mysite.verizon.net/astronaut/vim/index.html#DECHO)

decho's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

natw zhaocai

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.