Mercurial > vim
changeset 4:1a705d7a7521
working on stuff
| author | luka |
|---|---|
| date | Thu, 23 Oct 2025 12:33:51 -0400 |
| parents | 951569ccb9c7 |
| children | 4a7bc1c8551b |
| files | .vimrc autoload/plug.vim autoload/plug.vim.old coc-settings.json plugins/ale plugins/db.aichat plugins/dbtables.vim plugins/dbtables.vim.new plugins/taghelp plugins/tags |
| diffstat | 10 files changed, 1212 insertions(+), 153 deletions(-) [+] |
line wrap: on
line diff
--- a/.vimrc Thu Apr 24 20:28:09 2025 -0400 +++ b/.vimrc Thu Oct 23 12:33:51 2025 -0400 @@ -95,6 +95,11 @@ " AI-ify Plug 'madox2/vim-ai' +" LLama.vim +" put before llama.vim loads +" let g:llama_config = { 'show_info': 0, 'endpoint': 'http://0.0.0.0:8080/infill' } +" Plug 'ggml-org/llama.vim' + call plug#end() " CTRLP
--- a/autoload/plug.vim Thu Apr 24 20:28:09 2025 -0400 +++ b/autoload/plug.vim Thu Oct 23 12:33:51 2025 -0400 @@ -372,8 +372,10 @@ for [cmd, names] in items(lod.cmd) execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)', - \ cmd, string(cmd), string(names)) + \ has('patch-7.4.1898') + \ ? 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, <q-mods> ,%s)' + \ : 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)' + \ , cmd, string(cmd), string(names)) endfor for [map, names] in items(lod.map) @@ -651,11 +653,19 @@ call s:doautocmd('filetypeindent', 'FileType') endfunction -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction +if has('patch-7.4.1898') + function! s:lod_cmd(cmd, bang, l1, l2, args, mods, names) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + execute printf('%s %s%s%s %s', a:mods, (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) + endfunction +else + function! s:lod_cmd(cmd, bang, l1, l2, args, names) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) + endfunction +endif function! s:lod_map(map, names, with_prefix, prefix) call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
--- a/autoload/plug.vim.old Thu Apr 24 20:28:09 2025 -0400 +++ b/autoload/plug.vim.old Thu Oct 23 12:33:51 2025 -0400 @@ -1075,12 +1075,16 @@ return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 endfunction +function! s:disable_credential_helper() + return s:git_version_requirement(2) && get(g:, 'plug_disable_credential_helper', 1) +endfunction + function! s:checkout(spec) let sha = a:spec.commit let output = s:git_revision(a:spec.dir) let error = 0 if !empty(output) && !s:hash_match(sha, s:lines(output)[0]) - let credential_helper = s:git_version_requirement(2) ? '-c credential.helper= ' : '' + let credential_helper = s:disable_credential_helper() ? '-c credential.helper= ' : '' let output = s:system( \ 'git '.credential_helper.'fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) let error = v:shell_error @@ -1589,7 +1593,7 @@ let [error, _] = s:git_validate(spec, 0) if empty(error) if pull - let cmd = s:git_version_requirement(2) ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] + let cmd = s:disable_credential_helper() ? ['git', '-c', 'credential.helper=', 'fetch'] : ['git', 'fetch'] if has_tag && !empty(globpath(spec.dir, '.git/shallow')) call extend(cmd, ['--depth', '99999999']) endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coc-settings.json Thu Oct 23 12:33:51 2025 -0400 @@ -0,0 +1,3 @@ +{ + "extensions.updateCheck": "daily" +} \ No newline at end of file
--- a/plugins/ale Thu Apr 24 20:28:09 2025 -0400 +++ b/plugins/ale Thu Oct 23 12:33:51 2025 -0400 @@ -3,11 +3,17 @@ let g:ale_php_langserver_executable = expand('~/.config/composer/vendor/phpactor/language-server/bin/serve.php') +let g:ale_linters = { +\ 'php': ['phpcs', 'phpstan', 'psalm', 'ctags'], +\} + +let g:ale_php_ctags_executable = 'ctags' + " Enable completion where available. " This setting must be set before ALE is loaded. " " You should not turn this setting on if you wish to use ALE as a completion " source for other completion plugins, like Deoplete. -let g:ale_completion_enabled = 1 +let g:ale_completion_enabled = 0 let g:ale_sign_column_always = 1 let g:ale_lint_delay = 500
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/db.aichat Thu Oct 23 12:33:51 2025 -0400 @@ -0,0 +1,726 @@ +>>> user + +This is my vim plugin for working with a mariadb database, can you please provide some feedback and suggest some changes or new features that we could work together to implement? + +>>> include + +/home/luka/.vim/plugins/dbtables.vim + + + +<<< assistant + +Your Vim plugin for interacting with a MariaDB database is a useful tool for developers who often work with SQL databases directly from their text editor. Here's some feedback along with suggestions for improvements and additional features: + +### Feedback + +1. **Security Concerns:** + - Storing database credentials directly in the `.vim` file can be a security risk. Consider using environment variables or prompting the user to enter credentials when needed. You could also add encryption or vault-like features to manage credentials securely. + +2. **Error Handling:** + - Enhance error handling to provide more informative messages. If the `result` from `systemlist()` includes known error patterns, you could display specific error messages. + +3. **User Interface:** + - The current buffer logic (such as non-modifiable and no-number) is good for a dashboard type of view. You might also want to add syntax highlighting to make the views more visually appealing. Consider adding some color to differentiate headers from data rows. + +### Suggested Improvements + +1. **Configuration:** + - Move configuration settings (like user credentials) to a separate file and load them at runtime. This abstraction can help simplify the process of updating credentials or supporting multiple configurations. + +2. **Enhanced Queries:** + - Implement functionalities that allow executing more complex queries, such as support for multi-line queries. + +3. **UX Improvements:** + - Add more keyboard shortcuts for common tasks, like refreshing the table list or switching between query results tabs. + +### New Features + +1. **Query History:** + - Support a query history buffer where past queries are stored so users can quickly rerun historical queries. + +2. **Table Schema Viewer:** + - Build a function to view the schema or structure of a selected table. This will help in understanding the table schema without leaving Vim. + +3. **Integrate with Other Plugins:** + - Consider integrating with plugins like `fzf` or `ctrlp` for fuzzy search capabilities when selecting tables or executing queries. + +4. **Export Results:** + - Add functionality to export query results to a file, possibly in formats like CSV or JSON, for further analysis. + +5. **Data Editing:** + - Basic data manipulation (like simple updates) could be considered, transforming Vim into a lightweight database interface. However, you should be mindful of the complexities and introduce it cautiously. + +6. **Support for Multiple Databases or Connections:** + - Allow users to switch between connections easily, supporting multiple databases and users. + +7. **Configuration Wizard:** + - Implement a wizard for configuring connection settings interactively within Vim for ease of use. + +Incorporating these suggestions can help enhance the usability and functionality of your Vim plugin, making it more powerful and appealing to users who prefer powerful text editors like Vim for development tasks. Let me know if there's any feature you'd like to tackle together! + +>>> user + +Wow, these are all great ideas, I knew you'd be up for the task. Lets start with distilling all this feedback and set a list of "tickets" that need to be addressed. Then we can go through one by one and implement them. How does that sound? + + +<<< assistant + +That sounds like a great plan! Let's break down the feedback and suggestions into actionable "tickets." Here's a prioritized list of tasks we can work through: + +### Tickets + +#### Security & Configuration +1. **Secure Credentials Management** + - Replace direct credential storage with environment variables or prompt for credentials at runtime. + - Introduce support for encrypted storage or a vault system. + +2. **Configuration Abstraction** + - Move configuration settings to a separate file and load them at runtime to support multiple configurations. + +#### User Experience & UI Improvements +3. **Enhanced Error Handling** + - Improve error messages based on known MariaDB error patterns. + +4. **Syntax Highlighting & UI Enhancements** + - Implement syntax highlighting for query results and table views to differentiate headers from data. + +5. **Keyboard Shortcuts & Usability** + - Add more shortcuts for common tasks like refreshing table lists and switching tabs. + +#### New Features +6. **Query History** + - Implement a query history feature to store and rerun past queries easily. + +7. **Table Schema Viewer** + - Provide functionality to view the schema or structure of selected tables. + +8. **Integration with Fuzzy Search** + - Integrate with `fzf` or similar plugins to enable fuzzy search capabilities for table and query selection. + +9. **Export Query Results** + - Add functionality to export query results to CSV or JSON files. + +10. **Support Multiple Connections** + - Implement functionality to switch easily between multiple database connections. + +11. **Configuration Wizard** + - Develop an interactive configuration wizard to set up connection settings within Vim. + +12. **Basic Data Editing** + - Consider basic data manipulation features, ensuring safety and clarity in implementation. + +Let me know if you'd like to adjust the priorities or add anything else. Once you're ready, we can start with the implementation of the first ticket! + +>>> user + +This seems great. Lets start with the first ticket. I think we should keep this rather simple since this plugin will likely just be used locally in development environments. Also I haven't released it anywhere so I doubt anyone else will use it. Lets start with a simple implementation of the security enhancement. + + +<<< assistant + +Great! Let's start by implementing a simple and secure way to handle database credentials, leveraging environment variables. This approach will keep your credentials out of the Vim config files while still being easily accessible for your local development work. + +### Steps to Implement Secure Credentials Management + +1. **Environment Variables:** + - Instead of storing the credentials directly in the Vim configuration, use environment variables that can be set in your shell profile (`.bashrc`, `.zshrc`, etc.). + +2. **Modifying the Plugin:** + - Modify your Vim script to read from these environment variables. + +Here's how you can implement this: + +#### Step 1: Set Environment Variables + +First, set your credentials in your shell profile file. Add the following lines to `.bashrc`, `.zshrc`, or your shell's equivalent: + +```bash +# Add these to your shell profile, replacing with your actual credentials +export DB_USER="your_username" +export DB_PASSWORD="your_password" +export DB_NAME="your_database_name" +export DB_HOST="localhost" # or another host if needed +``` + +After adding them, remember to source your shell configuration to apply the changes: + +```bash +source ~/.bashrc +# or +source ~/.zshrc +``` + +#### Step 2: Modify the Vim Plugin + +Update your Vim plugin to use these environment variables: + +```vim +" Remove direct assignments and instead fetch from environment variables +let g:db_user = $DB_USER +let g:db_password = $DB_PASSWORD +let g:db_name = $DB_NAME +let g:db_host = $DB_HOST + +function! s:ExecuteDBQuery(query) + " Fetch the list of tables from the database + let db_user = shellescape(g:db_user) + let db_password = shellescape(g:db_password) + let db_name = shellescape(g:db_name) + let db_host = shellescape(g:db_host) + + " Command to fetch tables + let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' -e "' . a:query . '" --database=' . db_name . ' --host=' . db_host + " echo "Running command: " . command + " Capture both stdout and stderr + let result = systemlist(command . ' 2>&1') + + " Check for errors + if v:shell_error != 0 + echoerr "Shell command failed: " . command + echoerr join(result, "\n") + return + endif + return result +endfunction +``` + +### Testing + +1. **Open your terminal and Vim**: Make sure your environment variables are set (`echo $DB_USER` to check). +2. **Run** the plugin commands in Vim to ensure it connects using the environment variables. +3. **Check for Errors**: Verify connections and query executions are successful. If there's an issue, double-check the environment variable values. + +By using environment variables, you've simplified credential management and improved security. If you're ready, we can move to the next ticket or adjust anything else in this implementation! + +>>> user + +Is there a way that those could be set for specific projects? The main reason I chose my previous method was that different apps use different databases and have different database users. + + +<<< assistant + +Yes, you can manage environment variables for specific projects by utilizing project-specific configuration files or scripts. Here are a few approaches to achieve this: + +### Approach 1: Project-Specific Shell Scripts + +You can create a shell script for each project to set the environment variables before starting Vim. + +**Steps:** + +1. **Create a Shell Script for Each Project** + + For each project, create a script named something like `setenv.sh` in the project's root directory: + + ```bash + # setenv.sh + export DB_USER="project_specific_user" + export DB_PASSWORD="project_specific_password" + export DB_NAME="project_specific_database" + export DB_HOST="localhost" # or specific host + ``` + +2. **Source the Script Before Launching Vim** + + ```bash + cd /path/to/project + source ./setenv.sh + vim + ``` + +### Approach 2: Project-Specific `.vimrc` Configuration + +If you'd like to keep everything within Vim, consider using a `local.vim` configuration setup for each project. + +**Steps:** + +1. **Create a `local.vim` in Each Project** + + Create a `.vim` or `local.vim` in each project directory specifically for project configurations: + + ```vim + " local.vim + let $DB_USER = "project_specific_user" + let $DB_PASSWORD = "project_specific_password" + let $DB_NAME = "project_specific_database" + let $DB_HOST = "localhost" + ``` + +2. **Include Project `local.vim` in Main `.vimrc`** + + Modify your `.vimrc` to source this `local.vim` file if it exists: + + ```vim + if filereadable(expand(".local.vim")) + source .local.vim + endif + ``` + +3. **Use Vim from the Project Directory** + + Start Vim from the root directory of your project to ensure `local.vim` is sourced: + + ```bash + cd /path/to/project + vim + ``` + +### Approach 3: Use a Vim Plugin for Project Configurations + +Consider using a Vim plugin like vim-project that can automatically load project-specific configurations. + +This tactic allows you to manage different configurations easily without hardcoding any credentials directly into your main Vim plugin or `.vimrc` file, thereby improving organization and security across projects. + +Choose the approach that best fits your workflow! Let me know if you need help implementing any specific option. + +>>> user + +Ok let's move on to the next ticket. + + +<<< assistant + +Great! The next ticket involves enhancing error handling within your Vim plugin. Let's focus on improving the feedback the user receives when a command fails, making it more informative and user-friendly. + +### Enhanced Error Handling + +**Objective:** Improve error messaging by adding more context to common MariaDB errors, helping users understand what went wrong and possibly how to fix it. + +#### Steps to Implement Enhanced Error Handling: + +1. **Identify Common Error Patterns:** + - Analyze typical error messages returned by MariaDB and categorize them by type (e.g., authentication errors, connection issues, syntax errors). + +2. **Implement Enhanced Messaging:** + - Modify the `s:ExecuteDBQuery` function to provide detailed error messages based on error patterns. + +Here's how you can implement enhanced error handling within the plugin: + +```vim +function! s:ExecuteDBQuery(query) + " Fetch the list of tables from the database + let db_user = shellescape(g:db_user) + let db_password = shellescape(g:db_password) + let db_name = shellescape(g:db_name) + let db_host = shellescape(g:db_host) + + " Command to fetch tables + let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' -e "' . a:query . '" --database=' . db_name . ' --host=' . db_host + + " Capture both stdout and stderr + let result = systemlist(command . ' 2>&1') + + " Check for errors and enhance messages + if v:shell_error != 0 + " Basic error handling + echoerr "Shell command failed: " . command + echoerr join(result, "\n") + + " Additional error pattern matching + if result =~# 'Access denied' + echoerr "Authentication error: Please check your username and password." + elseif result =~# 'Unknown database' + echoerr "Database error: The specified database does not exist. Check the database name." + elseif result =~# 'Could not connect' + echoerr "Connection error: Unable to reach the database server. Verify the host and network connectivity." + elseif result =~# 'You have an error in your SQL syntax' + echoerr "Syntax error: There is an error in your SQL query." + else + echoerr "An unknown error occurred." + endif + + return + endif + return result +endfunction +``` + +### Testing and Iteration + +1. **Simulate Errors:** + - Intentionally misconfigure database settings or enter incorrect queries to simulate different types of errors. + +2. **Verify Output:** + - Check if the enhanced error messages provide helpful feedback based on the simulated errors. + +3. **Iterate:** + - Refine patterns and messages as needed based on your testing or feedback from others utilizing the plugin. + +By adding this level of error handling, you'll provide clearer guidance to users about what went wrong, reducing frustration and aiding in quicker debugging. Let me know if you want to refine this further or if you'd like to move on to another ticket! + +>>> user + +I see what you are trying to do here, however when I run a command like DBTables I get errors from trying to parse the output of ExecuteDBQuery + + +<<< assistant + +Ah, I see. The issue may arise if the command output or the state in your query handling is not accounted for, especially when handling unexpected output or errors not fully captured by the provided patterns. Let's ensure that the function gracefully handles unexpected cases. + +### Debugging & Fixing the Error Handling + +1. **Safe Handling of Query Results:** + - Ensure that `result` in `ExecuteDBQuery` is processed only if it's valid. + +2. **Check Output Before Processing:** + - Add a check to verify that `result` has expected output before it is processed further. + +Here’s a refined version of `ExecuteDBQuery` with added safety checks: + +```vim +function! s:ExecuteDBQuery(query) + " Fetch the list of tables from the database + let db_user = shellescape(g:db_user) + let db_password = shellescape(g:db_password) + let db_name = shellescape(g:db_name) + let db_host = shellescape(g:db_host) + + " Command to fetch tables + let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' -e "' . a:query . '" --database=' . db_name . ' --host=' . db_host + + " Capture both stdout and stderr + let result = systemlist(command . ' 2>&1') + + " Check for errors and enhance messages + if v:shell_error != 0 + let error_handled = 0 + " Basic error handling + echoerr "Shell command failed: " . command + echoerr join(result, "\n") + + " Additional error pattern matching + if result =~# 'Access denied' + echoerr "Authentication error: Please check your username and password." + let error_handled = 1 + elseif result =~# 'Unknown database' + echoerr "Database error: The specified database does not exist. Check the database name." + let error_handled = 1 + elseif result =~# 'Could not connect' + echoerr "Connection error: Unable to reach the database server. Verify the host and network connectivity." + let error_handled = 1 + elseif result =~# 'You have an error in your SQL syntax' + echoerr "Syntax error: There is an error in your SQL query." + let error_handled = 1 + elseif !empty(result) + echoerr "Unexpected error: " . join(result, "\n") + let error_handled = 1 + endif + + " Return an empty list if there is an error + return error_handled ? [] : result + endif + + " Further processing can assume `result` is well-formed + return result +endfunction +``` + +### Additional Considerations + +1. **Empty and Well-Formed Output:** + - Handle both empty result scenarios and ensure further processing happens only if `result` is not empty and contains valid output. + +2. **Non-Critical Execution:** + - Implement logic in other parts (like `s:OpenDBTablesWindow`) to check whether `ExecuteDBQuery` returns an empty list due to an error, and handle those gracefully. For example: + + ```vim + function! s:OpenDBTablesWindow() + let tables = s:ExecuteDBQuery("SHOW TABLES;") + if empty(tables) + echo "No tables found or an error occurred." + return + endif + + " Process tables as expected + " ... + endfunction + ``` + +3. **Verbose Logging for Debugging:** + - Optionally add more `echo` statements or use a verbose level to provide detailed command execution logs during development. + +This approach should help prevent errors when parsing the command output and provide clear messaging when errors do happen. Let me know any further issues or if you're ready for the next ticket! + +>>> user + +I found that the source of the error is that when executing the system command we use `systemlist` which is expecting a list. How can we fix this? + +<<< assistant + +To address the issue with using `systemlist`, especially if parsing line-by-line output isn't necessary or beneficial, you can switch to `system()` to capture the entire output as a single string. This can often simplify processing, especially if you're concatenating the output back together for display. + +Here's how you can adjust the implementation to use `system()`: + +### Modifying the Execution Function + +```vim +function! s:ExecuteDBQuery(query) + " Fetch the list of tables from the database + let db_user = shellescape(g:db_user) + let db_password = shellescape(g:db_password) + let db_name = shellescape(g:db_name) + let db_host = shellescape(g:db_host) + + " Command to fetch tables + let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' -e "' . a:query . '" --database=' . db_name . ' --host=' . db_host + + " Capture both stdout and stderr in a single string + let result = system(command . ' 2>&1') + + " Check for errors and enhance messages + if v:shell_error != 0 + let error_handled = 0 + " Basic error handling + echoerr "Shell command failed: " . command + echoerr result + + " Additional error pattern matching + if result =~# 'Access denied' + echoerr "Authentication error: Please check your username and password." + let error_handled = 1 + elseif result =~# 'Unknown database' + echoerr "Database error: The specified database does not exist. Check the database name." + let error_handled = 1 + elseif result =~# 'Could not connect' + echoerr "Connection error: Unable to reach the database server. Verify the host and network connectivity." + let error_handled = 1 + elseif result =~# 'You have an error in your SQL syntax' + echoerr "Syntax error: There is an error in your SQL query." + let error_handled = 1 + else + echoerr "Unexpected error: " . result + let error_handled = 1 + endif + + " Return an empty list if there is an error + return error_handled ? [] : split(result, "\n") + endif + + " Process and return as list for further operation + return split(result, "\n") +endfunction +``` + +### Explanation + +- **Use of `system`:** Captures the command output as a single string, including both stdout and stderr. It allows you to manage entirety of the output more directly than `systemlist`, especially useful if the processing is line-agnostic. + +- **Return Format:** We're converting `result` back into a list with `split(result, "\n")` for any subsequent functions expecting a list, ensuring compatibility with prior logic. + +- **Error Handling using Result String:** Since `result` is a single string, all error messages are easily echoed without iteration. + +This change should resolve issues with parsing the system command output while retaining your existing logic for processing DB query results. Let me know if there's anything else you'd like to address! + +>>> user + +Alright this seems to be working well now. +Now may be a good time to review what was done and re-iterate the remaining tickets. + + +<<< assistant + +Great to hear that the changes are working well for you! Let's review what we've accomplished and then revisit the remaining tickets to ensure we're aligned on the next steps. + +### Completed Tickets + +1. **Secure Credentials Management:** + - Migrated database credential handling from direct Vim configuration to environment variables. + - Introduced methods for managing these variables on a per-project basis. + +2. **Enhanced Error Handling:** + - Improved error messaging in the `ExecuteDBQuery` function by providing more descriptive problem descriptions based on error patterns. + - Adjusted `system` command usage to better capture and process execution results. + +### Remaining Tickets + +Here's a recap of the remaining tasks we initially identified: + +3. **Syntax Highlighting & UI Enhancements:** + - Implement syntax highlighting for SQL queries and query results within Vim to improve readability. + +4. **Keyboard Shortcuts & Usability:** + - Add additional shortcuts to improve usability for frequently used actions, like refreshing table lists or switching between buffers. + +5. **Query History:** + - Implement a feature to store and access past queries for easy rerun and management within Vim. + +6. **Table Schema Viewer:** + - Develop functionality to view the schema or structure of selected tables directly in Vim. + +7. **Integration with Fuzzy Search:** + - Integrate with plugins like `fzf` to enable fuzzy search capabilities for table and query selection. + +8. **Export Query Results:** + - Add functionality to export query results to files in formats like CSV or JSON. + +9. **Support Multiple Connections:** + - Implement enhanced logic to manage and switch between multiple database connections seamlessly. + +10. **Configuration Wizard:** + - Develop an interactive setup wizard to simplify configuration and setup of database connections. + +11. **Basic Data Editing:** + - Explore simple data manipulation capabilities, considering safety and usability. + +### Next Steps + +Please let me know your priorities among these remaining tasks, or if you'd like to add, remove, or redefine any of them. Once we have our next tasks identified, we can dive into implementation! + +>>> user + +I think you got it, lets get some syntax highliting! + +<<< assistant + +Great choice! Syntax highlighting can significantly enhance readability and usability, particularly when dealing with complex SQL queries or large sets of data. In Vim, syntax highlighting is achieved through defining specific syntax rules and applying them to buffers. + +### Steps to Implement Syntax Highlighting + +1. **Define SQL Syntax for Vim:** + - Vim supports SQL syntax highlighting out of the box. We'll ensure it's enabled for SQL query buffers. + +2. **Ensure Data Display Uses Plain Text:** + - When displaying query results like table listings, use basic text syntax for clarity. + +3. **Assign Appropriate File Types:** + - Ensure the correct file type is set for buffers where queries are displayed to invoke syntax rules. + +### Implementation + +#### Step 1: Highlight SQL Queries + +For buffers displaying SQL queries: + +```vim +function! s:ExecuteSQLQuery() + " Get the content of the current buffer (SQL query) + let query = join(getline(1, '$'), " ") + let data = s:ExecuteDBQuery(query) + + tabnew + enew + execute 'file SQLQueryResult' + call append(0, data) + + " Set the buffer file type to SQL for syntax highlighting + setlocal filetype=sql + + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal nomodifiable +endfunction +``` + +#### Step 2: Plain Text for Data Buffers + +For buffers displaying tabular data: + +```vim + +function! s:ShowTableData() + let lnum = line('.') + let table_name = getline(lnum) + + tabnew + enew + execute 'file ' . table_name + call append(0, s:ExecuteDBQuery("SELECT * FROM " . table_name . ";")) + + " Use plain text, but syntax can be defined similarly if needed + setlocal filetype= + + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal nomodifiable +endfunction +``` + +### Testing Syntax Highlighting + +1. **Open a SQL Query Buffer:** + - Run a command that opens a buffer displaying an SQL query to verify syntax highlighting. + +2. **Open a Data Buffer:** + - Display table data and ensure the absence of syntax highlighting (or integrate minimal highlighting if desired). + +3. **Adjust as Necessary:** + - Customize the syntax definitions or switch syntax off if it negatively affects readability in specific contexts. + +### Further Enhancements + +- **Custom Highlighting:** Consider defining custom syntax highlighting rules or colors for your specific needs in your Vim configuration. +- **Themes:** Try different Vim color schemes to see which provides the best clarity for SQL, especially when dealing with complex queries. + +This setup should give you effective syntax highlighting for your SQL work within Vim. Let me know if you'd like further customization or experimentation with other features! + +>>> user + +Lets move on to the next ticket. + + +<<< assistant + +Alright! The next ticket involves enhancing the usability of your plugin by adding keyboard shortcuts for common tasks. These shortcuts will allow you to perform frequent actions more quickly, enhancing your workflow efficiency. + +### Usability & Keyboard Shortcuts + +**Objective:** Introduce convenient keyboard mappings for frequently used functions like refreshing table lists, executing queries, or navigating buffers. + +### Steps to Implement Shortcuts + +1. **Identify Common Operations:** + - Determine which operations are frequent and would benefit from keyboard shortcuts, such as opening the tables window, executing SQL queries, or refreshing data. + +2. **Define Shortcuts:** + - Assign key mappings for these operations. + +#### Implementation + +Here's how you can add keyboard shortcuts within your plugin: + +```vim +" Function to refresh the list of tables +nnoremap <Leader>rt :DBTables<CR> + +" Function to execute the contents of the current buffer as an SQL query +nnoremap <Leader>eq :ExecuteSQL<CR> + +" Function to open the database tables window +nnoremap <Leader>ot :DBTables<CR> + +" Optional: Shortcut to open MariaDB console +nnoremap <Leader>mc :call DBConsole()<CR> +``` + +- **`<Leader>`**: The leader key is a commonly used prefix to create custom mappings, making it less likely to conflict with existing Vim commands. + +- **Defined Shortcuts:** + - `<Leader>rt`: Refresh the list of tables (`DBTables` command). + - `<Leader>eq`: Execute an SQL query from the current buffer (`ExecuteSQL` command). + - `<Leader>ot`: Open the database tables window. + - `<Leader>mc`: Open the MariaDB console (if using), just as an example of interactively running the console within Vim. + +### Testing Shortcuts + +1. **Verify Key Bindings:** + - Test each shortcut in your Vim session to ensure that they trigger the desired commands. + +2. **Adjust as Needed:** + - Modify any shortcuts that might conflict with other Vim keybindings or aren't intuitively placed for your workflow. + +3. **Utilize Leader Key:** + - Ensure you're comfortable with the leader key setup and adjust your `.vimrc` if needed, like changing the default leader from `\` to `,` if that suits your style better. + +### Further Enhancements + +- **Personal Customizations:** Adjust shortcuts based on your muscle memory or personal preferences. +- **Documentation:** Document the shortcuts within your `.vimrc` or maintain a cheatsheet, especially helpful if you plan to share the plugin with others. + +This should provide you with a smooth and efficient navigation experience within your MariaDB plugin. Let me know how it works for you or if there are more areas you'd like to enhance! + +>>> user +
--- a/plugins/dbtables.vim Thu Apr 24 20:28:09 2025 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -let g:db_user = "budgeter_db_user" " Replace with your default database username -let g:db_password = "qSTedfw39(0" " Replace with your default database password -let g:db_name = "budgeter" " Replace with your default database name -let g:db_host = "127.0.0.1" " Replace with your default database name - - -function! s:ExecuteDBQuery(query) - " Fetch the list of tables from the database - let db_user = shellescape(g:db_user) - let db_password = shellescape(g:db_password) - let db_name = shellescape(g:db_name) - let db_host = shellescape(g:db_host) - - " Command to fetch tables - let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' -e "' . a:query . '" --database=' . db_name . ' --host=' . db_host - " echo "Running command: " . command - " Capture both stdout and stderr - let result = systemlist(command . ' 2>&1') - - " Check for errors - if v:shell_error != 0 - echoerr "Shell command failed: " . command - echoerr join(result, "\n") - return - endif - return result -endfunction - - -function! s:OpenDBTablesWindow() - " Open a new vertical split window - execute '34 vsplit' - " Create a new buffer - enew - " Set buffer name to "DBTables" - file DBTables - - let tables = s:ExecuteDBQuery("SHOW TABLES;") - - " Display the tables in the buffer - call append(0, 'Available Tables:') - call remove(tables, 0) - for table in tables - call append('$', table) - endfor - - " Set buffer options - setlocal buftype=nofile - setlocal bufhidden=wipe - setlocal nobuflisted - setlocal noswapfile - setlocal nomodifiable - setlocal nonumber - setlocal norelativenumber - setlocal winfixwidth - - " Map <Enter> to a function that displays table data - nnoremap <buffer> <CR> :call <SID>ShowTableData()<CR> -endfunction - - -function! s:ShowTableData() - " Get the current line (table name) - let lnum = line('.') - let table_name = getline(lnum) - - " Open a new tab and create a new buffer - tabnew - enew - " Set buffer name to the table name - execute 'file ' . table_name - - let data = s:ExecuteDBQuery("SELECT * FROM " . table_name . ";") - - " Display the table data in the buffer - if len(data) > 0 - call append(0, data) - else - call append(0, 'No data found.') - endif - - " Set buffer options - setlocal buftype=nofile - setlocal bufhidden=wipe - setlocal nobuflisted - setlocal noswapfile - setlocal nomodifiable -endfunction - -function! s:ExecuteSQLQuery() - " Get the content of the current buffer (SQL query) - let query = join(getline(1, '$'), " ") - let db_user = shellescape(g:db_user) - let db_password = shellescape(g:db_password) - let db_name = shellescape(g:db_name) - - let data = s:ExecuteDBQuery(query) - - tabnew - enew - execute 'file SQLQueryResult' - call append(0, data) - setlocal buftype=nofile - setlocal bufhidden=wipe - setlocal nobuflisted - setlocal noswapfile - setlocal nomodifiable -endfunction - -function! DBConsole() - " Save the current cursor position - let save_cursor = getpos(".") - - "Format the files - let db_user = g:db_user - let db_password = g:db_password - let db_name = g:db_name - " let db_host = shellescape(g:db_host) - let db_host = g:db_host - - - - let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' --database=' . db_name . ' --host=' . db_host . ' ' - let command = substitute(command, '\n', '', 'g') - execute ':term ' . command - call setpos(".", save_cursor) -endfunction - -function! OpenMariaDBConsole() - " The command to connect to MariaDB. Customize it with your actual connection details. - let cmd = 'mariadb -u your_username -p your_database_name' - - " Open a new terminal window at the bottom with 10 lines height. - " Split the window horizontally; you can adjust the height by changing `10`. - botright 10split - call termopen(cmd) -endfunction - -nnoremap <Leader>db :call DBConsole()<cr> - -command! DBTables call s:OpenDBTablesWindow() -command! ExecuteSQL call s:ExecuteSQLQuery()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/dbtables.vim.new Thu Oct 23 12:33:51 2025 -0400 @@ -0,0 +1,377 @@ +let g:db_user = "" " Replace with your default database username +let g:db_password = "" " Replace with your default database password +let g:db_name = "" " Replace with your default database name +let g:db_host = "" " Replace with your default database name + +let s:popup_table = "" + + +" Helper function to execute a command and handle errors +function! s:ExecuteShellCommand(command) + let result = system(a:command . ' 2>&1') + if v:shell_error != 0 + return [v:false, result] + endif + return [v:true, result] +endfunction + +function! s:ExecuteDBQuery(query) + let db_user = shellescape(g:db_user) + let db_password = shellescape(g:db_password) + let db_name = shellescape(g:db_name) + let db_host = shellescape(g:db_host) + + let command = 'mariadb --user=' . db_user + \ . ' --password=' . db_password + \ . ' --database=' . db_name + \ . ' --host=' . db_host + \ . ' -e ' . shellescape(a:query) + + let [success, result] = s:ExecuteShellCommand(command) + + if !success + call s:HandleDBError(result, command) + return [] + endif + return split(result, "\n") +endfunction + +function! s:HandleDBError(result, command) + echoerr 'Shell command failed: ' . a:command + echoerr a:result + + if a:result =~# 'Access denied' + echoerr 'Authentication error: Check your username and password.' + elseif a:result =~# 'Unknown database' + echoerr 'Database error: The specified database does not exist.' + elseif a:result =~# 'Could not connect' + echoerr 'Connection error: Verify host and network connectivity.' + elseif a:result =~# 'You have an error in your SQL syntax' + echoerr 'Syntax error in SQL query.' + else + echoerr 'Unexpected error: ' . a:result + endif +endfunction + + +" Show the structure/schema of the selected table +function! s:ShowTableSchema(table) + " Open a new tab for schema + tabnew + enew + execute 'file ' . table . '_schema' + " Describe the table structure + let data = s:ExecuteDBQuery('DESCRIBE ' . table . ';') + if len(data) > 0 + call append(0, data) + else + call append(0, 'No schema found or an error occurred.') + endif + " Set buffer options and syntax + setlocal filetype=sql buftype=nofile bufhidden=wipe nobuflisted noswapfile nomodifiable +endfunction + + +" Popup selection for table actions +function! s:ShowTablePopup() + " Use Vim popup_menu if available + if exists('*popup_menu') + s:popup_table = getline(line('.')) + let items = ['View Data', 'View Schema', 'Cancel'] + popup_menu(items, {}) + + nnoremap <buffer> <CR> :call <SID>HandlePopupSelection()<CR> + return + endif + " Popup_menu not available + echoerr 'Floating popup requires Vim8.2+.' +endfunction + +function! s:HandlePopupSelection() + let choice = getline('.') + let table = s:popup_table + call s:ClosePopup() + if choice ==# 'View Data' + call s:OpenTableData(table) + elseif choice ==# 'View Schema' + call s:OpenTableSchema(table) + else + call s:ClosePopup() + endif +endfunction + +function! s:ClosePopup() + unlet! s:popup_table +endfunction + + +" Modal menu: let user pick Data or Schema from a simple list +function! s:ShowTableMenuModal() + let table = getline(line('.')) + let opts = [ 'Select action for "' . table . '"', 'View Data', 'View Schema', 'Cancel' ] + let choice = inputlist(opts) + if choice == 1 + call s:ShowTableData() + elseif choice == 2 + call s:ShowTableSchema() + endif +endfunction + +" Internal: remove any existing dropdown option lines from the DBTables buffer +function! s:ClearTableOptions() + let to_del = [] + for lnum in range(1, line('$')) + let ln = getline(lnum) + if ln =~# '^\s\+\(Data\|Schema\)$' + call add(to_del, lnum) + endif + endfor + if !empty(to_del) + for lnum in reverse(to_del) + call deletebufline('%', lnum) + endfor + endif +endfunction + +" Internal: insert Data/Schema options under the selected table +function! s:InsertTableOptions() + call s:ClearTableOptions() + let tlnum = line('.') + " Insert indented options + call append(tlnum, ' Data') + call append(tlnum+1, ' Schema') + " Move cursor to the 'Data' line + call cursor(tlnum+1, 1) +endfunction + +" Internal: find the nearest table name above the cursor (first non-indented line) +function! s:GetNearestTableName() + let lnum = line('.') + while lnum > 0 + let text = getline(lnum) + if text =~# '^\S' + if text ==# 'Available Tables:' + return '' + endif + return text + endif + let lnum -= 1 + endwhile + return '' +endfunction + + +" Open table data for a given table name +function! s:OpenTableData(table) + tabnew + enew + execute 'file ' . a:table + let data = s:ExecuteDBQuery('SELECT * FROM ' . a:table . ';') + if !empty(data) + call append(0, data) + else + call append(0, 'No data found.') + endif + setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nomodifiable +endfunction + +" Open table schema for a given table name +function! s:OpenTableSchema(table) + tabnew + enew + execute 'file ' . a:table . '_schema' + let data = s:ExecuteDBQuery('DESCRIBE ' . a:table . ';') + if !empty(data) + call append(0, data) + else + call append(0, 'No schema found or an error occurred.') + endif + setlocal filetype=sql buftype=nofile bufhidden=wipe nobuflisted noswapfile nomodifiable +endfunction + +function! s:OpenDBTablesWindow() + " Open a new vertical split window + execute '34 vsplit' + " Create a new buffer + enew + " Set buffer name to "DBTables" + file DBTables + + let tables = s:ExecuteDBQuery("SHOW TABLES;") + if empty(tables) + echo "No tables found or an error occurred." + return + endif + + " Display the tables in the buffer + call append(0, 'Available Tables:') + call remove(tables, 0) + for table in tables + call append('$', table) + endfor + + " Set buffer options + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal nomodifiable + setlocal nonumber + setlocal norelativenumber + setlocal winfixwidth + + " Map <Enter> to a modal menu (data or schema) + nnoremap <buffer> <CR> :call <SID>ShowTablePopup()<CR> +endfunction + + +function! s:ShowTableData() + " Get the current line (table name) + let lnum = line('.') + let table_name = getline(lnum) + + " Open a new tab and create a new buffer + tabnew + enew + " Set buffer name to the table name + execute 'file ' . table_name + + let data = s:ExecuteDBQuery("SELECT * FROM " . table_name . ";") + + " Display the table data in the buffer + if len(data) > 0 + call append(0, data) + else + call append(0, 'No data found.') + endif + + " Set buffer options + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal nomodifiable +endfunction + +let s:query_history = [] + +function! s:ExecuteSQLQuery() + " Get the content of the current buffer (SQL query) + let query = join(getline(1, '$'), " ") + + " Append the query to history + call add(s:query_history, query) + + let data = s:ExecuteDBQuery(query) + + tabnew + enew + execute 'file SQLQueryResult' + call append(0, data) + + " Set the buffer file type to SQL for syntax highlighting + setlocal filetype=sql + + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile + setlocal nomodifiable +endfunction + +" Execute SQL from a visual selection +function! s:ExecuteVisualSQLQuery() range + " Get the content of the selected lines as a single SQL query + let lines = getline(a:firstline, a:lastline) + let query = join(lines, " ") + + " Append the query to history + call add(s:query_history, query) + + " Execute the query and capture results + let data = s:ExecuteDBQuery(query) + + " Open results in a new tab + tabnew + enew + execute 'file SQLQueryResult' + call append(0, data) + + " Set buffer options and highlight + setlocal filetype=sql + setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nomodifiable +endfunction + +function! s:OpenQueryHistory() + " Open the query history in a new split window + execute 'vsplit' + enew + call setline(1, s:query_history) + + " Allow selecting a query to be put into a new buffer to execute + nnoremap <buffer> <CR> :call <SID>ExecuteHistoryQuery(line('.'))<CR> + + " Set buffer options + setlocal buftype=nofile + setlocal bufhidden=wipe + setlocal nobuflisted + setlocal noswapfile +endfunction + +function! s:ExecuteHistoryQuery(lnum) + " Execute the selected query from history + let query = getline(a:lnum) + execute 'normal! i' . query + " Optionally call the execute function directly or process +endfunction + + +function! DBConsole() + " Save the current cursor position + let save_cursor = getpos(".") + + "Format the files + let db_user = g:db_user + let db_password = g:db_password + let db_name = g:db_name + " let db_host = shellescape(g:db_host) + let db_host = g:db_host + + + + let command = 'mariadb --user=' . db_user . ' --password=' . db_password . ' --database=' . db_name . ' --host=' . db_host . ' ' + let command = substitute(command, '\n', '', 'g') + execute ':term ' . command + call setpos(".", save_cursor) +endfunction + +function! OpenMariaDBConsole() + " The command to connect to MariaDB. Customize it with your actual connection details. + let cmd = 'mariadb -u your_username -p your_database_name' + + " Open a new terminal window at the bottom with 10 lines height. + " Split the window horizontally; you can adjust the height by changing `10`. + botright 10split + call termopen(cmd) +endfunction + +" Keybinding to open query history +nnoremap <Leader>qh :call <SID>OpenQueryHistory()<CR> +nnoremap <Leader>db :call DBConsole()<cr> + +command! DBTables call s:OpenDBTablesWindow() +command! ExecuteSQL call s:ExecuteSQLQuery() + +" Function to refresh the list of tables +nnoremap <Leader>rt :DBTables<CR> + +" Function to execute the contents of the current buffer as an SQL query +nnoremap <Leader>eq :ExecuteSQL<CR> + +" Function to open the database tables window +nnoremap <Leader>dt :DBTables<CR> + +" Optional: Shortcut to open MariaDB console +nnoremap <Leader>mc :call DBConsole()<CR> +" Map visual selection to execute selected SQL +xnoremap <silent> <Leader>ev :call <SID>ExecuteVisualSQLQuery()<CR>
--- a/plugins/taghelp Thu Apr 24 20:28:09 2025 -0400 +++ b/plugins/taghelp Thu Oct 23 12:33:51 2025 -0400 @@ -1,7 +1,7 @@ autocmd BufRead,BufNewFile *.blade.php set filetype=blade -autocmd FileType blade inoremap<buffer> > <c-r>=CreateTag()<cr> +" autocmd FileType blade inoremap<buffer> > <c-r>=CreateTag()<cr> " Abbreviations
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/tags Thu Oct 23 12:33:51 2025 -0400 @@ -0,0 +1,70 @@ +!_TAG_EXTRA_DESCRIPTION anonymous /Include tags for non-named objects like lambda/ +!_TAG_EXTRA_DESCRIPTION fileScope /Include tags of file scope/ +!_TAG_EXTRA_DESCRIPTION pseudo /Include pseudo tags/ +!_TAG_EXTRA_DESCRIPTION subparser /Include tags generated by subparsers/ +!_TAG_FIELD_DESCRIPTION epoch /the last modified time of the input file (only for F\/file kind tag)/ +!_TAG_FIELD_DESCRIPTION file /File-restricted scoping/ +!_TAG_FIELD_DESCRIPTION input /input file/ +!_TAG_FIELD_DESCRIPTION name /tag name/ +!_TAG_FIELD_DESCRIPTION pattern /pattern/ +!_TAG_FIELD_DESCRIPTION typeref /Type and name of a variable or typedef/ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_KIND_DESCRIPTION!Vim C,constant /constant definitions/ +!_TAG_KIND_DESCRIPTION!Vim a,augroup /autocommand groups/ +!_TAG_KIND_DESCRIPTION!Vim c,command /user-defined commands/ +!_TAG_KIND_DESCRIPTION!Vim f,function /function definitions/ +!_TAG_KIND_DESCRIPTION!Vim m,map /maps/ +!_TAG_KIND_DESCRIPTION!Vim n,filename /vimball filename/ +!_TAG_KIND_DESCRIPTION!Vim v,variable /variable definitions/ +!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/ +!_TAG_OUTPUT_FILESEP slash /slash or backslash/ +!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ +!_TAG_OUTPUT_VERSION 0.0 /current.age/ +!_TAG_PARSER_VERSION!Vim 0.0 /current.age/ +!_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ +!_TAG_PROC_CWD /home/luka/.vim/plugins/ // +!_TAG_PROGRAM_AUTHOR Universal Ctags Team // +!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ +!_TAG_PROGRAM_URL https://ctags.io/ /official site/ +!_TAG_PROGRAM_VERSION 6.1.0 /v6.1.0/ +<CR> dbtables/dbtables.vim /^ nnoremap <buffer> <CR> :call <SID>ExecuteHistoryQuery(line('.'))<CR>$/;" m +<CR> dbtables/dbtables.vim /^ nnoremap <buffer> <CR> :call <SID>ShowTablePopup()<CR>$/;" m +<Leader>db dbtables/dbtables.vim /^nnoremap <Leader>db :call DBConsole()<cr>$/;" m +<Leader>dt dbtables/dbtables.vim /^nnoremap <Leader>dt :DBTables<CR>$/;" m +<Leader>eq dbtables/dbtables.vim /^nnoremap <Leader>eq :ExecuteSQL<CR>$/;" m +<Leader>ev dbtables/dbtables.vim /^xnoremap <silent> <Leader>ev :call <SID>ExecuteVisualSQLQuery()<CR>$/;" m +<Leader>mc dbtables/dbtables.vim /^nnoremap <Leader>mc :call DBConsole()<CR>$/;" m +<Leader>qh dbtables/dbtables.vim /^nnoremap <Leader>qh :call <SID>OpenQueryHistory()<CR>$/;" m +<Leader>rt dbtables/dbtables.vim /^nnoremap <Leader>rt :DBTables<CR>$/;" m +DBConsole dbtables/dbtables.vim /^function! DBConsole()$/;" f +DBTables dbtables/dbtables.vim /^command! DBTables call s:OpenDBTablesWindow()$/;" c +ExecuteSQL dbtables/dbtables.vim /^command! ExecuteSQL call s:ExecuteSQLQuery()$/;" c +OpenMariaDBConsole dbtables/dbtables.vim /^function! OpenMariaDBConsole()$/;" f +g:db_host dbtables/dbtables.vim /^let g:db_host = "" " Replace with your default database name$/;" v +g:db_name dbtables/dbtables.vim /^let g:db_name = "" " Replace with your default database name$/;" v +g:db_password dbtables/dbtables.vim /^let g:db_password = "" " Replace with your default database password$/;" v +g:db_user dbtables/dbtables.vim /^let g:db_user = "" " Replace with your default database username$/;" v +s:ClearTableOptions dbtables/dbtables.vim /^function! s:ClearTableOptions()$/;" f +s:ClosePopup dbtables/dbtables.vim /^function! s:ClosePopup()$/;" f +s:ExecuteDBQuery dbtables/dbtables.vim /^function! s:ExecuteDBQuery(query)$/;" f +s:ExecuteHistoryQuery dbtables/dbtables.vim /^function! s:ExecuteHistoryQuery(lnum)$/;" f +s:ExecuteSQLQuery dbtables/dbtables.vim /^function! s:ExecuteSQLQuery()$/;" f +s:ExecuteShellCommand dbtables/dbtables.vim /^function! s:ExecuteShellCommand(command)$/;" f +s:ExecuteVisualSQLQuery dbtables/dbtables.vim /^function! s:ExecuteVisualSQLQuery() range$/;" f +s:GetNearestTableName dbtables/dbtables.vim /^function! s:GetNearestTableName()$/;" f +s:HandleDBError dbtables/dbtables.vim /^function! s:HandleDBError(result, command)$/;" f +s:HandlePopupSelection dbtables/dbtables.vim /^function! s:HandlePopupSelection()$/;" f +s:HandleTableMenu dbtables/dbtables.vim /^function! s:HandleTableMenu()$/;" f +s:InsertTableOptions dbtables/dbtables.vim /^function! s:InsertTableOptions()$/;" f +s:OpenDBTablesWindow dbtables/dbtables.vim /^function! s:OpenDBTablesWindow()$/;" f +s:OpenQueryHistory dbtables/dbtables.vim /^function! s:OpenQueryHistory()$/;" f +s:OpenTableData dbtables/dbtables.vim /^function! s:OpenTableData(table)$/;" f +s:OpenTableSchema dbtables/dbtables.vim /^function! s:OpenTableSchema(table)$/;" f +s:RunTableOption dbtables/dbtables.vim /^function! s:RunTableOption()$/;" f +s:ShowTableAction dbtables/dbtables.vim /^function! s:ShowTableAction()$/;" f +s:ShowTableData dbtables/dbtables.vim /^function! s:ShowTableData()$/;" f +s:ShowTableMenuModal dbtables/dbtables.vim /^function! s:ShowTableMenuModal()$/;" f +s:ShowTablePopup dbtables/dbtables.vim /^function! s:ShowTablePopup()$/;" f +s:ShowTableSchema dbtables/dbtables.vim /^function! s:ShowTableSchema(table)$/;" f +s:query_history dbtables/dbtables.vim /^let s:query_history = []$/;" v
