-
Notifications
You must be signed in to change notification settings - Fork 11
/
sqls-nvim.txt
89 lines (71 loc) · 3.93 KB
/
sqls-nvim.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
*sqls-nvim.txt* Neovim plugin for the sqls language server
SETUP *sqls-nvim-setup*
Setup the plugin with nvim-lspconfig https://github.com/neovim/nvim-lspconfig
>
require('lspconfig').sqls.setup{
on_attach = function(client, bufnr)
require('sqls').on_attach(client, bufnr)
end
}
<
==============================================================================
COMMANDS *sqls-nvim-commands*
*:SqlsExecuteQuery*
:SqlsExecuteQuery In normal mode, executes the query in the current
buffer. In visual mode, executes the selected query
(only works line-wise). Shows the results in a
preview buffer.
*:SqlsExecuteQueryVertical*
:SqlsExecuteQueryVertical Same as `:SqlsExecuteQuery`, but the results are
displayed vertically.
*:SqlsShowDatabases*
:SqlsShowDatabases Shows a list of available databases in a preview
buffer.
*:SqlsShowSchemas*
:SqlsShowSchemas Shows a list of available schemas in a preview
buffer.
*:SqlsShowConnections*
:SqlsShowConnections Shows a list of available database connections in a
preview buffer.
*:SqlsSwitchDatabase*
:SqlsSwitchDatabase {database_name}
Switches to a different database. If
{database_name} is omitted, displays an interactive
prompt with |vim.ui.select()| to select a database.
*:SqlsSwitchConnection*
:SqlsSwitchConnection {connection_index}
Switches to a different database connection. If
{connection_index} is omitted, displays an
interactive prompt with |vim.ui.select()| to select
a connection.
==============================================================================
MAPS *sqls-nvim-maps*
*<Plug>(sqls-execute-query)*
<Plug>(sqls-execute-query) In visual mode, executes the selected
range. In normal mode, executes a motion
(like |ip| or |aw|)
*<Plug>(sqls-execute-query-vertical)*
<Plug>(sqls-execute-query-vertical) same as |<Plug>(sqls-execute-query)|, but
the results are displayed vertically
==============================================================================
EVENTS *sqls-nvim-events*
sqls.nvim dispatches custom |User| events that can be subscribed to using
|autocommand|s. It exposes custom data via the `data` key in Lua callbacks
(see |nvim_create_autocmd()|):
>
vim.api.nvim_create_autocmd('User', {
pattern = 'SqlsConnectionChoice',
callback = function(event)
vim.notify(event.data.choice)
end,
})
<
*User_SqlsDatabaseChoice*
User SqlsDatabaseChoice
After switching databases. Callback data:
• choice: (string) the chosen database
*User_SqlsConnectionChoice*
User SqlsConnectionChoice
After switching connections. Callback data:
• choice: (string) the chosen connection
vim:tw=78:et:ft=help:norl: