@@ -14,6 +14,7 @@ This is a Neovim plugin/library for generating statusline components from the bu
14
14
1 . [ Protocol Extensions] ( #protocol-extensions )
15
15
2 . [ Configuration] ( #configuration )
16
16
4 . [ Example Use] ( #example-use )
17
+ 1 . [ All together, now] ( #all-together-now )
17
18
5 . [ Status] ( #status )
18
19
6 . [ Contributing] ( #contributing )
19
20
@@ -117,7 +118,8 @@ showing how `lsp-status` can be integrated into one's statusline and other LSP c
117
118
``` lua
118
119
local lsp_status = require (' lsp-status' )
119
120
-- completion_customize_lsp_label as used in completion-nvim
120
- lsp_status .config { kind_labels = vim .g .completion_customize_lsp_label }
121
+ -- Optional: customize the kind labels used in identifying the current function
122
+ -- lsp_status.config { kind_labels = vim.g.completion_customize_lsp_label }
121
123
122
124
-- Register the progress callback
123
125
lsp_status .register_progress ()
@@ -154,6 +156,47 @@ and develop your own statusline segment, but if you'd like something reasonable
154
156
can call ` lsp_status.status() ` somewhere in your statusline definition (make sure you have
155
157
` require ` 'd the ` lsp-status ` module too!)
156
158
159
+ ### All together, now
160
+
161
+ Here's a complete example:
162
+
163
+ ``` vim
164
+ lua << END
165
+ local lsp_status = require('lsp-status')
166
+ lsp_status.register_progress()
167
+
168
+ local nvim_lsp = require('nvim-lsp')
169
+
170
+ -- Some arbitrary servers
171
+ nvim_lsp.clangd.setup({
172
+ callbacks = lsp_status.extensions.clangd.setup(),
173
+ init_options = {
174
+ clangdFileStatus = true
175
+ },
176
+ on_attach = lsp_status.on_attach
177
+ })
178
+
179
+ nvim_lsp.pyls_ms.setup({
180
+ callbacks = lsp_status.extensions.pyls_ms.setup(),
181
+ settings = { python = { workspaceSymbols = { enabled = true }}},
182
+ on_attach = lsp_status.on_attach
183
+ })
184
+
185
+ nvim_lsp.ghcide.setup({ on_attach = lsp_status.on_attach })
186
+ nvim_lsp.rust_analyzer.setup({ on_attach = lsp_status.on_attach })
187
+ END
188
+
189
+ " Statusline
190
+ function! LspStatus() abort
191
+ if luaeval('#vim.lsp.buf_get_clients() > 0')
192
+ return luaeval("require('lsp-status').status()")
193
+ endif
194
+
195
+ return ''
196
+ endfunction
197
+
198
+ ```
199
+
157
200
## Status
158
201
159
202
This plugin is "complete" - it works in all the ways it was originally intended to, and it doesn't
0 commit comments