Commands
Query execution, editing, and session management commands (:TD, :TDO, :TDE, :TDV, :TDM, :TDMV, :TDF, :TDFF, :TDCodeAction, :TDSession) are buffer-local to buffers with filetype teradata.
Result buffer commands (:TDCalc, :TDCol, :TDCol!, :TDColEdit, :TDCols, :TDColPush, :TDMaterialize, :TDMaterialize!, :TDVQuery, :TDEditTarget) are buffer-local to result buffers.
Global utilities (:TDH, :TDR, :TDHelp, :TDU, :TDS, :TDB, :TDJ, :TDSync, :TDRerun, :TDSessions, :TDExport) are available across any buffer.
Several commands accept an optional count [N] (defaults to 1). For example, :3TDO runs the statement under the cursor plus the next 2 statements.
Query execution
| Command |
Description |
:[N]TD |
Syntax-check the current statement plus the next N-1 statements using Tree-sitter node boundaries. No execution. |
:[range]TDE |
Syntax-check the visual selection (split on ;). |
:[N]TDO |
Run the current statement plus the next N-1 statements via BTEQ and display results in a split. Respects retlimit. |
:[range]TDV |
Run statements of the visual selection (split on ;) and display results. Visual equivalent of :TDO. |
:[N]TDM |
Multistatement execution: send current statement plus next N-1 statements as a single BTEQ job. Useful for transactions. |
:[range]TDMV |
Multistatement run for the visual selection submitted as one BTEQ job. |
:TDRerun |
Re-run the most recent query exactly as sent. Creates a new BTEQ job and updates or re-opens the result grid. Queries from a persistent session re-run in that session. Bound to g. in SQL buffers and . in result buffers. |
:TDExport [id] |
Export full query results of the latest query or history entry {id} to a delimited CSV file via TPT (tbuild) in the background. See Full exports (TPT). |
History & search
| Command |
Description |
:TDH |
Open the query history buffer. Browse past runs; press <CR> to open a query and its results side-by-side. |
:TDR |
Search through past queries by content. Requires ripgrep, bat, and a supported picker (fzf-lua, snacks, telescope, fzf.vim, or native). |
Bookmarks
| Command |
Description |
:TDB |
Open the bookmark manager to browse and run saved snippets (global and per-user). |
:[range]TDBAdd |
Save the visual selection as a new bookmark. Prompts for name and scope. |
Jobs
| Command |
Description |
:TDJ |
Open the Jobs Manager: a live view of in-flight and completed BTEQ jobs. Press <CR> to jump to job output/log. |
| Command |
Description |
:[N]TDF |
Reformat the current statement plus next N-1 statements using the built-in Tree-sitter formatter (experimental). |
:TDFF |
Reformat every statement in the current buffer (experimental). |
:TDCodeAction |
Open code actions at cursor position (e.g. rename alias, expand *, toggle column qualification). |
Virtual answersets
Commands buffer-local to result buffers. See Virtual answersets.
| Command |
Description |
:[range]TDCalc |
Compute descriptive statistics (count, nulls, sum, avg, min, max, distinct) for selected cells or lines in a floating window. |
:TDCol [{name} =] {expr} |
Add a computed virtual column (named EXPR1, EXPR2, etc. if name is omitted). |
:TDCol! {name} |
Remove an existing computed virtual column. |
:TDColEdit [{name}] |
Interactively edit the expression for virtual column {name} (or column under cursor). |
:TDCols |
List all active virtual columns and their expressions in a scratch split. |
:TDColPush |
Push virtual columns to Teradata by rewriting into a derived table query and opening results in a new split. |
:TDMaterialize [{name}] |
Materialize the answerset into a volatile table (VAS_<id>) inside an open persistent session (:TDSession). |
:TDMaterialize! |
Drop the materialized volatile table. |
:TDVQuery |
Jump to the session SQL buffer and append SELECT * FROM <name>;. |
:TDEditTarget [volatile\|table] |
Toggle or set in-grid edit destination (volatile sandbox or source database table). |
| Command |
Description |
:TDSync |
Build or refresh the full local metadata index (databases, tables, columns) used for autocompletion. See Autocomplete. |
:[range]TDSync[!] add [DB.OBJ ...] |
Incrementally add objects (DB.OBJ, DB.*, visual selection, or cursor node) into the local catalog. Unqualified names register volatile tables (use ! for server column lookup). |
:[range]TDSync[!] update [DB.OBJ ...] |
Incrementally refresh objects in the local catalog and prune objects deleted from the server. |
:[range]TDSync delete [DB.OBJ ...] |
Remove objects or volatile tables from the local metadata catalog without a server call. |
:TDU |
Open the user profile manager (switch active connection, add or delete profiles). |
:TDS |
Open the settings manager (interactively adjust retlimit, filter_db, and replacements). |
:TDHelp |
Open the quick reference cheat sheet in a split window. |
:checkhealth vim-teradata |
Inspect configuration and verify TTU binaries, Tree-sitter parser, and connection profiles. |
Sessions
See Persistent sessions for full details.
| Command |
Description |
:TDSession [open] |
Open a persistent BTEQ session attached to the current buffer using the active user profile (:TDU). Volatile tables, query bands, DATABASE, and transactions carry over across commands. |
:TDSession! / :TDSession close |
Log off and close the current buffer's session. Teradata drops the session's volatile tables. |
:TDSession restart |
Close the session and open a new one (recommended after switching users with :TDU or altering output settings). |
:TDSession status |
Show the user, host, state (logging on, idle, or busy), and queued commands count for the current buffer's session. |
:TDSessions |
List every open persistent session and its associated buffer across Neovim. |