NNYJ Tweaks
Quality-of-life bundle for VS Code. Each feature toggles independently in the Settings UI and reacts live, no reload.
Features
- Policy toggle: status bar item to grant timed allow overrides for AI CLI policy ask groups, reads group names from
policy.json, writes overrides.json consumed by external policy guards
- Open left: when a file opens in a new group to the right of a webview-only group (chat, preview), swaps the two groups so the webview stays rightmost, if the webview group is active it moves right instead so focus stays in it
- Close empty: when the last tab in any group closes, closes the group, VS Code otherwise leaves an empty locked canvas that
closeEmptyGroups skips
- Open external: opening a matching file,
.pdf by default, hands it to the OS default app and closes the VS Code tab
- Line highlight: toggle a background highlight on selected lines, single color, tracks line moves during edits, in-session only (cleared on window reload)
- Markdown tables:
- Tab and Shift+Tab navigate cells and pad columns
- Tab past the last cell adds a row
- Insert, move and align columns from the editor context menu
- Convert selected CSV or TSV, including quoted fields
- Hover a header cell to sort rows by that column, sort B then A to order ties in A by B
- Format all tables through a command or optional format-on-save
- Formula cells
[](#sum), avg, min, max, count recalc on Tab, format and save
Usage
Policy toggle: click the $(lock) policy status bar item, pick a group (or all groups), pick a duration (30m to 7d, custom 90m/6h/2d). Active overrides show remaining time in the status bar and expire on their own.
Commands:
| Command |
Description |
Policy Toggle: Allow Group Temporarily |
Pick group and duration |
Policy Toggle: Clear All Overrides |
Remove every override |
Line Highlight: Toggle on Selected Lines |
Toggle highlight on selection |
Line Highlight: Clear All |
Remove all highlights |
Suggested keybinding:
{ "key": "alt+q", "command": "nnyjTweaks.lineHighlight.toggle", "when": "editorTextFocus" }
Open left, close empty and open external run automatically, no commands.
Table commands use the Table: prefix in the Command Palette and the Markdown Table editor context menu.
- Table editing supports Markdown, MDX and Quarto
- Code fences are skipped
- Formula cells cover every other numeric body cell in their column, sorting keeps their rows last
- CSV and TSV use the first row as headers and convert embedded newlines to
<br>
- Unicode padding counts emoji graphemes as two columns
- NNYJ Syntax Highlight supplies fixed emoji display widths and table borders
- Disable other table extensions that bind Tab to prevent conflicts
Settings
| Property |
Default |
Description |
nnyjTweaks.policyToggle.enabled |
true |
Enable the policy status bar toggle |
nnyjTweaks.openLeft.enabled |
true |
Enable locked-group placement fix |
nnyjTweaks.closeEmpty.enabled |
true |
Enable locked empty group close |
nnyjTweaks.openExternal.enabled |
true |
Enable external open of matching files |
nnyjTweaks.openExternal.extensions |
[".pdf"] |
Lowercase extensions with leading dot |
nnyjTweaks.lineHighlight.enabled |
true |
Enable line highlight commands |
nnyjTweaks.lineHighlight.color |
#ffe60030 |
Highlight background, hex with alpha |
nnyjTweaks.table.enabled |
true |
Enable table editing |
nnyjTweaks.table.format_on_save |
false |
Format tables before saving |
nnyjTweaks.policyToggle.policyPath |
C:/N/scripts/ai/policy/policy.json |
Source of ask group names |
nnyjTweaks.policyToggle.overridesPath |
C:/N/scripts/ai/policy/overrides.json |
Overrides file read by the policy guards |
nnyjTweaks.policyToggle.durations |
["30m", "2h", "8h", "1d", "3d", "7d"] |
Durations offered in the picker |
[!NOTE]
Policy toggle only writes the overrides file, enforcement happens in the external guard scripts that read it. Without those, the feature does nothing useful.
How it works
Policy toggle watches the overrides directory (a directory watch, since guards delete and recreate the file, which kills file-level watches) and refreshes the status bar every 30s so expiry shows without an event. Overrides are written atomically via temp file rename; an empty override set deletes the file.
Open left listens to tab group changes. A single-file group whose left neighbor has tabs but no file tabs is treated as an auto-split beside a locked webview. The API exposes no lock state, so any webview-only neighbor matches. The check waits 100ms, since the tab open event arrives before the group activation update. If the webview group is then active, as with a background open, the webview group moves one group right and keeps focus, else the file group moves one group left.
Close empty listens to tab close events. After a short settle delay, a group left with zero tabs is closed via the tab groups API (no focus change, safe across auxiliary windows). A sole active group is only unlocked, so the next editor reuses it instead of splitting beside it.
Open external listens to tab open events. A file tab whose extension matches is passed to vscode.env.openExternal, then closed.
Install
From the VS Code Marketplace, or sideload a release vsix:
gh release download -R nnyj/vscode-nnyj-tweaks -p '*.vsix'
code --install-extension nnyj-tweaks-*.vsix
Or build locally:
npm run install:local
License
MIT