Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polarmutex/contextprint.nvim
neovim plugin to add context aware print debug statements
https://github.com/polarmutex/contextprint.nvim
Last synced: 2 months ago
JSON representation
neovim plugin to add context aware print debug statements
- Host: GitHub
- URL: https://github.com/polarmutex/contextprint.nvim
- Owner: polarmutex
- License: mit
- Created: 2020-11-21T04:29:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-18T20:31:06.000Z (over 3 years ago)
- Last Synced: 2024-10-14T06:12:58.872Z (3 months ago)
- Language: Lua
- Size: 13.7 KB
- Stars: 42
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - polarmutex/contextprint.nvim - commit/polarmutex/contextprint.nvim) ![](https://img.shields.io/github/commit-activity/y/polarmutex/contextprint.nvim) (Coding / [Comment Out](./comment.md))
README
# contextprintf.nvim
neovim plugin to add context aware print debug statements- Uses tree-sitter to find context of your current cursor and create
a print statement in the current language that prints that context# Installation
* I only tested on Neovim 0.5
Use your favorite plugin manager to install
```
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'bryall/contextprint.nvim'
```# Supported Languages / Planned
- [x] Lua
- [x] Python
- [x] Typescript
- [ ] C/C++# Options
Call the below statment to change the defaults
```lua
require('contextprint').setup({
separator_char = "#", // Global
= {
separator = "#", // filetype specific
query = [[ ]],
log = function(contents) to return print statement to insert
type_defaults = vim.tbl_extend to change name defaults
}
})
```# to add context print statement
```lua
require('contextprint').add_statement()
```# Language Details
contextprint provides the following context for the supplied languages
## Lua
- [x] function
- [x] function_definition
- [x] for_statement
- [x] for_in_statement
- [x] repeat_statement
- [x] while_statement
- [x] if_statement## Typescript
- [x] function_declaration
- [x] class_declaration
- [x] method_definition
- [x] arrow_function
- [x] if_statement
- [x] for_statement
- [x] for_in_statement
- [x] do_statement
- [x] while_statement## Python
- [x] function_definition
- [x] class_definition
- [x] if_statement
- [x] elif_statement
- [x] else_statement
- [x] for_statement
- [x] while_statement