Giter Club home page Giter Club logo

zippy.nvim's Introduction

zippy.nvim

nvim plugin written in lua to help with debugging. this is inspired by the popular vscode extension turbo console log, for javascript, lua and python.

the main functionality is to insert meaningful print statements automatically.

image

image

the print statement is formatted as

- file name -> line number -> variable

if you have nvim navic installed, breadcrumbs to your function are additionally added:

- file name -> line number -> breadcrumbs -> variable

Installation

Packer:

use 'PatschD/zippy.nvim'

Keymap

vim.keymap.set("n", "<leader>lg", "<cmd>lua require('zippy').insert_print()<CR>")

Setup

Tree-sitter is required

if you are happy with the defaults, nothing has to be configured.

otherwise two options can be configured:

  • formatting:

as lua, javascript and python are quite different (indentations, newlines), zippy.nvim focuses on creating valid code, then calls the lsp to format. this can be disabled, performed only on the affected rows or perfomed globally. Not all formatters can format only a certain range (such as black for python)

  • print function: if you have a custom print function you can pass that instead.
require("zippy").setup({
  ["lua"] = {
    language_format_behaviour = "none", 
    print_function = "print",
  },
  ["typescriptreact] = {
    print_function = "console.warn",
  }
)

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.