view plugin/dbtables.vim @ 1:8530ebeda72c

Adding actual db tables implementation from original script.
author Luka Sitas <lsitas@avatarasoftware.com>
date Wed, 11 Mar 2026 08:53:55 -0400
parents 238b45cc333b
children c19add1b66a9
line wrap: on
line source

" plugin/dbtables.vim
" Basic plugin entry point

if exists('g:loaded_dbtables')
  finish
endif
let g:loaded_dbtables = 1

" Config default values
let g:snippets_directory = get(g:, 'snippets_directory',
      \ expand('$HOME/.config/heidisql/Snippets'))
let g:db_user          = get(g:, 'db_user',          '')
let g:db_password      = get(g:, 'db_password',      '')
let g:db_name          = get(g:, 'db_name',          '')
let g:db_host          = get(g:, 'db_host',          '')

"=============================================
" 				Key Bindings	
"=============================================

" Keybinding to open query history
command! DBTables call dbtables#OpenDBTablesWindow()
command! DBConsole call dbtables#DBConsole()
command! ExecuteSQL call dbtables#ExecuteSQLQuery()
command! QueryHistory call dbtables#OpenQueryHistory()
command! QuerySnippets call dbtables#OpenQuerySnippets()

" Function to open the database tables window
nnoremap <Leader>dt :DBTables<CR>

nnoremap <Leader>eq :ExecuteSQL<CR>
xnoremap <silent> <Leader>ev :call dbtables#ExecuteVisualSQLQuery()<CR>

nnoremap <Leader>db :call DBConsole<CR>
nnoremap <Leader>qh :call QueryHistory<CR>
nnoremap <Leader>qs :call QuerySnippets<CR>