Code Monkey home page Code Monkey logo

node-vim-debugger's Introduction

Flattr this git repo

node-vim-debugger

![Gitter](https://badges.gitter.im/Join Chat.svg)

Node.js debugger client and vim driver. Step-by-step debugging from vim.

vimdebug

install

npm install -g vimdebug

usage

A debugger, agent and vim session will have to be launched. These can either all be started individually:

  1. start your program with debugger enabled
node --debug-brk yourprogram.js
  1. start agent
node-vim-inspector
  1. connect vim to agent:
vim -nb
# or if you have vim already running, type `:nbs` in command mode

Alternatively, launch node-vim-inspector with a path to your script to do step 1&2 at once:

node-vim-inspector yourprogram.js

Or even give it the name of the window manager you're using for it to also launch a new vim session. Currently supported WMs are tmux and i3.

node-vim-inspector --windowmanager=tmux yourprogram.js
# or:
node --debug-brk yourprogram.js
node-vim-inspector --windowmanager=tmux

to run all inside vim using ConqueShell (+coffeescript support) see here

keys

  • CTRL+c - continue
  • CTRL+i - step in
  • CTRL+o - step over
  • CTRL+n - step next
  • CTRL+u - move one stack frame up
  • CTRL+d - move one stack frame down
  • CTRL+p - set breakpoint at current location

configuration

The default configuration is as follows:

{
  "vim": {
    "keys": {
      "break"    : "C-p",
      "continue" : "C-c",
      "down"     : "C-d",
      "in"       : "C-i",
      "next"     : "C-n",
      "out"      : "C-o",
      "up"       : "C-u"
    }
  },
  "agent": {
    "port": 3219
  },
  "debugger": {
    "port": 5858
  },
  "windowmanager": ""
}

Any of these settings can be overridden either from the command line, e.g. --vim.keys.break="C-b", a .vimdebugrc json file selectively overriding properties or environment variables in the form of export vimdebug_vim__keys__break="C-a".

The .vimdebugrc can be placed either in the current working directory, any directory above the current or the current user's home directory. In case there are multiple they will override each other in this order.

agent

Settings for the vim-debug netbeans agent.

agent.port

Port the agent uses to establish a connection.

debugger

Settings for the spawn debugger. Only relevant when the debugger spawn from the node-vim-inspector client, e.g. it is called with the path of a NodeJS program to debug.

debugger.port

Port to spawn the debugger on.

vim

Settings used by the vim client.

vim.keys

Key mappings inside vim to manipulate the debugger.

vim.keys.break

Add a breakpoint at current line and column.

vim.keys.continue

Resume program execution until the next breakpoint is encountered, or the program terminates.

vim.keys.down

Move down one stack frame.

vim.keys.in

Step inside the current statement's execution.

vim.keys.next

Step to the next statement.

vim.keys.out

Step out of the current statement.

vim.keys.up

Move up one stack frame.

Links

node-vim-debugger's People

Contributors

sidorares avatar baopham avatar bitdeli-chef avatar coderofsalvation avatar mynameiscoffey avatar gitter-badger avatar

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.