Skip to content

Commit 0fa44e4

Browse files
authored
Merge pull request #1276 from brianhuster/main
docs: update Neovim intruction
2 parents a39a09d + c12369d commit 0fa44e4

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

README.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -128,32 +128,29 @@ let g:ale_linters = {
128128
\ }
129129
```
130130

131+
For Vim8/NeoVim v0.5 using [jayli/vim-easycomplete](https://github.com/jayli/vim-easycomplete). Execute `:InstallLspServer sh` and config nothing. Maybe it's the easiest way to use bash-language-server in vim/nvim.
132+
131133
#### Neovim
132134

133-
For Neovim v0.8:
135+
For Neovim 0.11+ with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
134136

135137
```lua
136-
vim.api.nvim_create_autocmd('FileType', {
137-
pattern = 'sh',
138-
callback = function()
139-
vim.lsp.start({
140-
name = 'bash-language-server',
141-
cmd = { 'bash-language-server', 'start' },
142-
})
143-
end,
144-
})
138+
vim.lsp.enable 'bashls'
145139
```
140+
For Neovim 0.11+ without plugins
146141

147-
For NeoVim using [autozimu/LanguageClient-neovim][languageclient-neovim], add the following configuration to
148-
`init.vim`:
149-
150-
```vim
151-
let g:LanguageClient_serverCommands = {
152-
\ 'sh': ['bash-language-server', 'start']
153-
\ }
142+
```lua
143+
vim.lsp.config.bashls = {
144+
cmd = { 'bash-language-server', 'start' },
145+
filetypes = { 'bash', 'sh' }
146+
}
147+
vim.lsp.enable 'bashls'
154148
```
155149

156-
For Vim8/NeoVim v0.5 using [jayli/vim-easycomplete](https://github.com/jayli/vim-easycomplete). Execute `:InstallLspServer sh` and config nothing. Maybe it's the easiest way to use bash-language-server in vim/nvim.
150+
For Neovim 0.10 or lower with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
151+
```lua
152+
require 'lspconfig'.bashls.setup {}
153+
```
157154

158155
#### Oni
159156

0 commit comments

Comments
 (0)