diff --git a/common/.config/nvim/lsp/sqlls.lua b/common/.config/nvim/lsp/sqlls.lua deleted file mode 100644 index e286a34..0000000 --- a/common/.config/nvim/lsp/sqlls.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - cmd = { "sql-language-server", "up", "--method", "stdio" }, - filetypes = { "sql" }, -} diff --git a/common/.config/nvim/lua/core/lsp.lua b/common/.config/nvim/lua/core/lsp.lua index 8fa13e0..3586f3f 100644 --- a/common/.config/nvim/lua/core/lsp.lua +++ b/common/.config/nvim/lua/core/lsp.lua @@ -17,7 +17,6 @@ vim.lsp.enable({ "shellcheck", "shellharden", "shfmt", - "sqlls", "taplo", "trivy", "ts_ls", diff --git a/common/.config/nvim/lua/plugins/code-db.lua b/common/.config/nvim/lua/plugins/code-db.lua index 1f0144a..5f1253b 100644 --- a/common/.config/nvim/lua/plugins/code-db.lua +++ b/common/.config/nvim/lua/plugins/code-db.lua @@ -1,62 +1,41 @@ -local function db_completion() - require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } } }) -end - return { { - "tpope/vim-dadbod", - cond = require("config.util").is_not_vscode(), - opt = true, + "kristijanhusak/vim-dadbod-ui", + ft = { "sql", "mysql", "plsql" }, dependencies = { - { "kristijanhusak/vim-dadbod-ui" }, - { "kristijanhusak/vim-dadbod-completion" }, + { "tpope/vim-dadbod" }, + { + "kristijanhusak/vim-dadbod-completion", + }, }, - config = function() + cmd = { + "DBUI", + "DBUIToggle", + "DBUIAddConnection", + "DBUIFindBuffer", + }, + init = function() local data_path = vim.fn.stdpath("data") - vim.g.db_ui_auto_execute_table_helpers = 1 vim.g.db_ui_save_location = data_path .. "/db_ui" - vim.g.db_ui_show_database_icon = true vim.g.db_ui_tmp_query_location = data_path .. "/db_ui/tmp" + + vim.g.db_ui_auto_execute_table_helpers = 1 + vim.g.db_ui_show_database_icon = true vim.g.db_ui_use_nerd_fonts = true vim.g.db_ui_use_nvim_notify = true - - -- NOTE: The default behavior of auto-execution of queries on save is disabled - -- this is useful when you have a big query that you don't want to run every time - -- you save the file running those queries can crash neovim to run use the - -- default keymap: S vim.g.db_ui_execute_on_save = false vim.api.nvim_create_autocmd("FileType", { - pattern = { - "sql", - }, + pattern = { "sql" }, command = [[setlocal omnifunc=vim_dadbod_completion#omni]], }) - - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "sql", - "mysql", - "plsql", - }, - callback = function() - vim.schedule(db_completion) - end, - }) end, keys = { - { "qq", desc = "DB: UI" }, { "qq", "DBUIToggle", desc = "DB: UI Toggle" }, { "qa", "DBUIAddConnection", desc = "DB: Add Connection" }, { "qf", "DBUIFindBuffer", desc = "DB: Find Connection" }, + { "Q", "(DBUI_ExecuteQuery)", desc = "DB: Execute Query Under Cursor" }, }, }, - - { - "kristijanhusak/vim-dadbod-ui", - cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" }, - dependencies = "vim-dadbod", - init = function() end, - }, }