Skip to content

Install

This guide uses Neovim 0.12+ and the built‑in vim.pack.add. If you use a different plugin manager, adapt accordingly.

1) Add plugins

-- init.lua
-- Neovim 0.12+
vim.pack.add('ErwonB/vim-teradata')
vim.pack.add('ErwonB/sql-autocomplete')

require('vim-teradata').setup({
  users = {
    {
      log_mech = 'TD2',   -- e.g. TD2, LDAP, ...
      user    = 'USER',   -- username (password stored in tdwallet)
      tdpid   = 'HOST',   -- hostname or IP of the Teradata system
    },
  },
  replacements = {
    ['${DB_NAME}'] = 'MY_DB',
  },
 keymaps = {
        ["gcu"] = "uncomment_node",
        ["gcq"] = { "comment_node", { "statement" } },
        ["gcs"] = { "comment_node", { "select_expression" } },
        ["gcw"] = { "comment_node", { "where" } },
        ["gcf"] = { "comment_node", { "term" } },
        ["gcb"] = { "comment_node", { "binary_expression" } },
        ["gdq"] = { "delete_node", { "statement" } },
        ["gds"] = { "delete_node", { "select_expression" } },
        ["gdw"] = { "delete_node", { "where" } },
        ["gdf"] = { "delete_node", { "term" } },
        ["gdb"] = { "delete_node", { "binary_expression" } },
        ["]s"] = { "jump_to_next", { "statement" } },
        ["[s"] = { "jump_to_prev", { "statement" } },
    },
  -- Optional: enable Tree-sitter for specific filetypes (see Treesitter page)
  -- ft = { 'sql' },
})

require('sql-autocomplete').setup({})

2) Install the Teradata Tree‑sitter parser

The Teradata grammar replaces the default sql parser for accurate syntax. Follow Tree‑sitter (Teradata SQL) to copy the parser library and queries.

3) First‑time metadata sync

Open Neovim and run:

:TDSync

This builds a local metadata index (databases, tables, columns) used by sql-autocomplete.

4) Verify

  • Run :checkhealth treesitter to ensure the sql parser is detected.
  • Open a .sql file and start typing — you should see Blink.cmp completion after FROM and JOIN.
  • Execute a query with :TDO and view async jobs in :TDJ.