Mercurial > vim_plugins > dbtables
diff 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 diff
--- a/plugin/dbtables.vim Tue Mar 10 20:25:15 2026 -0400 +++ b/plugin/dbtables.vim Wed Mar 11 08:53:55 2026 -0400 @@ -6,10 +6,31 @@ endif let g:loaded_dbtables = 1 -" Default configuration option -if !exists('g:dbtables_greeting') - let g:dbtables_greeting = 'Hello from dbtables!' -endif +" 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 +"============================================= -" Command that calls an autoloaded function -command! DbtablesGreet call dbtables#greet() +" 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>
