From ae1151950e588a7351247c9200f9f066da970734 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Tue, 31 Jan 2023 13:42:43 -0500 Subject: [PATCH] Add sqls keymaps --- lua/plugins/lsp.lua | 1 + lua/user/keymaps.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 15613f8..99f9e4b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -78,6 +78,7 @@ require('lspconfig')['marksman'].setup({ }) require('lspconfig')['sqls'].setup({ on_attach = function(client, bufn) + on_attach(client, bufn) require('sqls').on_attach(client, bufn) end, flags = lsp_flags, diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 09b2dfb..1668b56 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -31,3 +31,9 @@ elseif vim.fn.has("unix") == 1 then else vim.keymap.set[''].gx = {[[lua print("Error: gx is not supported on this OS!")]]} end + +-- this is needed here since it doesn't work in plugins/sqls.lua for some reason +vim.keymap.set('n', 's', [[SqlsExecuteQuery]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor" }) +vim.keymap.set('n', 'S', [[SqlsExecuteQueryVertical]], { noremap = false, silent = true, desc = "[S]qls execute query under cursor in vertical split" }) +vim.keymap.set('x', 's', [[(sqls-execute-query)]], { noremap = false, silent = true, desc = "[S]qls execute selected query" }) +vim.keymap.set('x', 'S', [[(sqls-execute-query-vertical)]], { noremap = false, silent = true, desc = "[S]qls execute selected query in vertical split" })