Neovim Plugin
vi-sql.nvim opens vi-sql in a floating Neovim window and keeps the session alive in the background between visits. No need to reconnect every time you switch context.
How It Works
:ViSQL— opens vi-sql (or reopens a running background session)hide_key— hides the floating window without ending the session:ViSQLJump schema/table— opens vi-sql and jumps directly to a table in the schema tree- If vi-sql is not found in PATH, the plugin offers to install it automatically via the official install script
Installation
lazy.nvim
lua
{
"kopecmaciej/vi-sql.nvim",
config = function()
require("vi-sql").setup({
hide_key = "<C-q>",
})
end,
cmd = { "ViSQL", "ViSQLJump" },
keys = {
{ "<leader>vs", "<cmd>ViSQL<cr>", desc = "Open vi-sql" },
-- { "<leader>vj", ":ViSQLJump ", desc = "vi-sql: jump to table", silent = false },
},
}packer.nvim
lua
use {
'kopecmaciej/vi-sql.nvim',
config = function()
require('vi-sql').setup({
hide_key = "<C-q>",
})
end
}vim-plug
vim
Plug 'kopecmaciej/vi-sql.nvim'Commands
| Command | Description |
|---|---|
:ViSQL | Open vi-sql (or reopen a running background session) |
:ViSQLJump public/users | Open vi-sql and jump to a schema/table |
Configuration
lua
require("vi-sql").setup({
-- Auto-connect to a named connection on open (default: nil)
connection = nil,
-- Key to hide the window from inside vi-sql without ending the session
-- Set to nil to disable.
hide_key = nil,
-- Floating window size as a fraction of the editor (default: 0.9)
width = 0.9,
height = 0.9,
})Requirements
- Neovim 0.5+
curl— used for auto-install if vi-sql is not found in PATHvi-sql— installed automatically on first use if missing