Skip to content

Makes debugging easy by automating the process of writing logs, for NeoVim

License

Notifications You must be signed in to change notification settings

faridsaid20/logsitter.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logsitter

A Treesitter-based, Turbo Console Log-inspired, lua-written, NeoVim plugin.

Makes debugging easier by automating the process of writting log messages.

Install

With packer:

use {"gaelph/logsitter", requires = {"nvim-treesitter/nvim-treesitter"}}

Supported Languages

* Javascript/Typescript (`console.log()`)
* Golang (`fmt.Println("... %+v\n", ...)`)
* Lua (`print()`)

Example usage

lua:

vim.api.nvim_create_augroup("LogSitter", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
	group = "Logsitter",
	pattern = "javascript,go,lua",
	callback = function()
		vim.keymap.set("n", "<localleader>lg", function()
			require("logsitter").log()
		end)
	end,
})

There is also a lua function:

require("logsitter").log()

To use Logsitter with other file types:

-- This can go in after/ftplugin/svelte.lua
local logsitter = require("logsitter")
local javascript_logger = require("logsitter.lang.javascript")

-- tell logsitter to use the javascript_logger when the filetype is svelte
logsitter.register(javascript_logger, { "svelte" })

vim.keymap.set("n", "<localleader>lg", function()
	logsitter.log()
end)

License

MIT

About

Makes debugging easy by automating the process of writing logs, for NeoVim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 98.3%
  • Vim Script 1.7%