From 0608e7e6f9b6609b00ae71dd2e9f1ec2c050b39c Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Fri, 26 Jun 2026 14:11:40 +0100 Subject: [PATCH] add sql stuff --- lazyvim.json | 1 + lua/config/keymaps.lua | 24 ++++++++++++++++++------ lua/plugins/lualine.lua | 16 ++++++++++++++++ lua/plugins/mason.lua | 1 + 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 lua/plugins/lualine.lua diff --git a/lazyvim.json b/lazyvim.json index 9480deb..cf2b65e 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -3,6 +3,7 @@ "lazyvim.plugins.extras.dap.core", "lazyvim.plugins.extras.editor.fzf", "lazyvim.plugins.extras.lang.go", + "lazyvim.plugins.extras.lang.sql", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", "lazyvim.plugins.extras.test.core" diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 1612993..558d791 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,10 +1,22 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here -vim.keymap.set("n", "/", function() - require("fzf-lua").live_grep({ cwd = LazyVim.root() }) -end, { desc = "Grep (Root Dir)" }) -vim.keymap.set("n", " ", function() - require("fzf-lua").files({ cwd = LazyVim.root() }) -end, { desc = "Find Files (Root Dir)" }) +local function toggle_or_focus_explorer() + local explorers = Snacks.picker.get({ source = "explorer" }) + local explorer = explorers[1] + + if explorer then + if explorer:is_focused() then + explorer:close() + else + explorer:focus() + end + return + end + + -- No explorer open; open one at the project root + Snacks.explorer({ cwd = LazyVim.root() }) +end + +vim.keymap.set("n", "e", toggle_or_focus_explorer, { desc = "Explorer (toggle/focus)" }) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..f07726f --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,16 @@ +return { + { + "nvim-lualine/lualine.nvim", + opts = { + sections = { + lualine_c = { + { + "filename", + path = 1, + shorting_target = 0, -- 0 = no shortening, show full path + }, + }, + }, + }, + }, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index a2dfde4..cd96fac 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -12,6 +12,7 @@ return { "markdown-toc", "markdownlint-cli2", "marksman", + "sqlfluff", "shfmt", "stylua", "tree-sitter-cli",