Skip to content

docs: update Neovim intruction #1276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,32 +128,29 @@ let g:ale_linters = {
\ }
```

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.

#### Neovim

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

```lua
vim.api.nvim_create_autocmd('FileType', {
pattern = 'sh',
callback = function()
vim.lsp.start({
name = 'bash-language-server',
cmd = { 'bash-language-server', 'start' },
})
end,
})
vim.lsp.enable 'bashls'
```
For Neovim 0.11+ without plugins

For NeoVim using [autozimu/LanguageClient-neovim][languageclient-neovim], add the following configuration to
`init.vim`:

```vim
let g:LanguageClient_serverCommands = {
\ 'sh': ['bash-language-server', 'start']
\ }
```lua
vim.lsp.config.bashls = {
cmd = { 'bash-language-server', 'start' },
filetypes = { 'bash', 'sh' }
}
vim.lsp.enable 'bashls'
```

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.
For Neovim 0.10 or lower with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
```lua
require 'lspconfig'.bashls.setup {}
```

#### Oni

Expand Down