Skip to content

Filetypes

vim-teradata registers the teradata filetype for every extension configured in ft. By default, this applies to .sql and .teradata files.

require('vim-teradata').setup({
  ft = { 'sql', 'teradata', 'btq' },
})

SQL filetype detection (sql_detection)

You can control how .sql files are assigned to the teradata filetype via the sql_detection option:

require('vim-teradata').setup({
  sql_detection = 'always',  -- "always" | "never" | "modeline"
})
  • "always" (default): all .sql buffers are assigned filetype teradata.
  • "never": do not automatically map .sql files to teradata.
  • "modeline": inspect the first and last 5 lines of the buffer for teradata or bteq keywords before switching the filetype.

Deployment scripts (.depl)

.depl files (Teradata deployment scripts) often contain SQL statements embedded within a non-SQL host language.

vim-teradata includes special ftplugin handling for .depl files: it restricts Tree-sitter parsing and diagnostics to the actual SQL regions of the buffer, dynamically refreshing the ranges on BufReadPost, BufWritePost, TextChanged, and TextChangedI.