A Neovim plugin for fast, structured debug logging in JavaScript and TypeScript.
rocketlog.nvim helps you insert consistent console.* statements, keep embedded file/line labels fresh as code moves, and manage existing logs from a purpose-built dashboard instead of hunting through files like a raccoon in a cable drawer.
- Operator-pending log insertion for motions and text objects
- Word-under-cursor logging when you just need a quick probe
- Consistent
console.log/warn/error/infooutput - Automatic label refresh on insert and save
- Safety guardrails for unsafe insertion contexts
- Delete helpers for next, previous, or all logs in a buffer
- Project log picker via
snacks.nvim - RocketLog Dashboard for previewing, filtering, folding, toggling, refreshing, and opening logs
- Built-in dashboard footer cheatsheet plus a dedicated help modal on
?
| Doc | What it covers |
|---|---|
| Docs index | Start here for the full documentation set |
| Getting started | Install, configure, and use RocketLog in a few minutes |
| Usage guide | Motions, word logging, deletion, refresh behavior, workflows |
| Dashboard guide | Dashboard layout, keybindings, filters, folds, toggles |
| Configuration reference | Every setup option and practical examples |
| Troubleshooting | Common issues, warnings, and fixes |
| Media guide | Screenshot and GIF placeholders to replace before release |
| Contributing | Dev setup, tests, and contribution expectations |
console.log(`🚀[ROCKETLOG] ~ user.ts:42 ~ account:`, account);
console.warn(`🚀[ROCKETLOG] ~ user.ts:42 ~ account:`, account);
console.error(`🚀[ROCKETLOG] ~ user.ts:42 ~ account:`, account);
console.info(`🚀[ROCKETLOG] ~ user.ts:42 ~ account:`, account);const fullName = user.profile.name;const fullName = user.profile.name;
console.log(`🚀[ROCKETLOG] ~ user.ts:2 ~ fullName:`, fullName);Media placeholder — hero GIF
Add a short GIF here showing:
- opening a TypeScript file,
- inserting a log with
<leader>rL,- saving the file,
- opening the dashboard with
<leader>rr,- pressing
?to open the help modal.Suggested filename:
docs/assets/hero-overview.gif
This gives you the full experience, including the picker command.
{
"evanmcpheron/rocketlog.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"folke/snacks.nvim",
},
config = function()
require("rocketlog").setup()
end,
}If you do not care about the picker, snacks.nvim is not required. The plugin will still work, and :RocketLogFind will simply warn if snacks.nvim is unavailable.
{
"evanmcpheron/rocketlog.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("rocketlog").setup()
end,
}By default, plugin/rocketlog.lua calls require("rocketlog").setup() automatically.
If you want full control over when setup runs:
vim.g.rocketlog_disable_auto_setup = true
require("rocketlog").setup()- Install the plugin.
- Open a JavaScript or TypeScript file.
- Put your cursor on a variable and press
<leader>rL. - Or use
<leader>rlfollowed by a motion or text object, likeiw. - Open the dashboard with
<leader>rr. - Use
cto toggle a selected log on or off,dto delete it, or<CR>to jump to it. - Press
?inside the dashboard any time you want the full help modal.
For the full walkthrough, see Getting started.
| Keymap | Action |
|---|---|
<leader>rl |
console.log using a motion or text object |
<leader>rL |
console.log for the word under cursor |
<leader>re |
console.error using a motion or text object |
<leader>rE |
console.error for the word under cursor |
<leader>rw |
console.warn using a motion or text object |
<leader>rW |
console.warn for the word under cursor |
<leader>ri |
console.info using a motion or text object |
<leader>rI |
console.info for the word under cursor |
| Keymap | Action |
|---|---|
<leader>rf |
Open the RocketLog picker |
<leader>rr |
Toggle the RocketLog dashboard |
<leader>rd |
Delete the next RocketLog below the cursor |
<leader>rD |
Delete the nearest RocketLog above the cursor |
<leader>ra |
Delete all RocketLogs in the current buffer |
For examples using motions like iw, a{, and more, see Usage.
| Command | Action |
|---|---|
:RocketLogFind |
Open the RocketLog picker |
:RocketLogDashboard |
Open the dashboard |
The dashboard is the plugin’s command center. It groups logs by file, shows a preview pane, keeps an always-visible footer cheatsheet on screen, and opens a dedicated help modal on ? when you want the full keybinding reference without leaving the UI.
| Key | Action |
|---|---|
<CR> / o |
Open selected log in the current window and close the dashboard |
v |
Open selected log in a vertical split and close the dashboard |
c |
Toggle the selected log’s comment state |
C |
Toggle all logs in the selected file |
d |
Delete the selected log |
D |
Delete all logs in the selected file |
r |
Refresh labels in the selected file |
R |
Rescan the dashboard |
/ |
Open the live filter prompt |
x |
Clear the current filter |
<Tab> / za |
Toggle the selected file fold |
zo / zc |
Open or close the selected file fold |
zR / zM |
Expand or collapse all file groups |
t |
Toggle project scope / current-file scope |
? |
Open the dashboard help modal |
q / <Esc> |
Close the dashboard, or close the help modal if it is open |
See Dashboard guide for the full walkthrough.
require("rocketlog").setup({
keymaps = {
motions = "<leader>rl",
word = "<leader>rL",
error_motions = "<leader>re",
error_word = "<leader>rE",
warn_motions = "<leader>rw",
warn_word = "<leader>rW",
info_motions = "<leader>ri",
info_word = "<leader>rI",
delete_below = "<leader>rd",
delete_above = "<leader>rD",
delete_all_buffer = "<leader>ra",
find = "<leader>rf",
dashboard = "<leader>rr",
},
label = "ROCKETLOG",
enabled = true,
refresh_on_save = true,
refresh_on_insert = true,
prefer_treesitter = true,
fallback_to_heuristics = true,
allowed_filetypes = {
javascript = true,
javascriptreact = true,
typescript = true,
typescriptreact = true,
},
dashboard = {
width = 0.96,
height = 0.92,
preview_context = 4,
max_files = 2000,
excluded_dirs = {
".git",
"node_modules",
"dist",
"build",
"coverage",
".next",
".turbo",
},
},
})For a full option-by-option breakdown, see Configuration reference.
- JavaScript and TypeScript are the default supported target filetypes.
- Tree-sitter is strongly recommended for safer insertion behavior.
- The plugin can fall back to heuristics when Tree-sitter is unavailable.
- The dashboard prefers live buffer contents for open files and scans project files for everything else.
- If
rgis installed, the dashboard uses it to narrow project scans before parsing files. :RocketLogFinddepends onsnacks.nvim.
- Start with Troubleshooting
- Open an issue
- Read Contributing before opening a PR
